@ParametersAreNonnullByDefault
public final class SwaggerMigrators
extends java.lang.Object
SwaggerMigrator
sModifier and Type | Class and Description |
---|---|
static class |
SwaggerMigrators.MembersToString
Migrator converting object member values to JSON Strings
|
Constructor and Description |
---|
SwaggerMigrators() |
Modifier and Type | Method and Description |
---|---|
static SwaggerMigrator |
fromPatch(com.github.fge.jsonpatch.JsonPatch patch)
Return a migrator applying a JSON Patch
|
static SwaggerMigrator |
membersToString(java.lang.String first,
java.lang.String... others)
Return a migrator converting object member values to JSON Strings
|
static SwaggerMigrator |
patchFromResource(java.lang.String resourcePath)
Return a migrator applying a JSON Patch as read from the classpath
|
static SwaggerMigrator |
renameMember(java.lang.String from,
java.lang.String to)
Return a migrator renaming object members
|
public static SwaggerMigrator membersToString(java.lang.String first, java.lang.String... others)
Note that this will only work if member values are not containers (ie, JSON Arrays or Objects).
first
- first member nameothers
- one or more other member namesSwaggerMigrators.MembersToString
public static SwaggerMigrator fromPatch(com.github.fge.jsonpatch.JsonPatch patch)
The JSON Patch must be deserialized at this point. You can also load
one from the classpath using patchFromResource(String)
.
patch
- the JSON patch to applyJsonPatch
public static SwaggerMigrator renameMember(java.lang.String from, java.lang.String to)
Note that this migrator will not fail if the member to rename does not exists; however it will fail if the target member already exists in the target JSON Object.
from
- the member name to renameto
- the new namepublic static SwaggerMigrator patchFromResource(java.lang.String resourcePath)
resourcePath
- the resource pathfromPatch(JsonPatch)
Copyright © 2019. All Rights Reserved.