@ParametersAreNonnullByDefault public final class SwaggerMigrators extends Object
SwaggerMigrators| Modifier 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(String first,
String... others)
Return a migrator converting object member values to JSON Strings
|
static SwaggerMigrator |
patchFromResource(String resourcePath)
Return a migrator applying a JSON Patch as read from the classpath
|
static SwaggerMigrator |
renameMember(String from,
String to)
Return a migrator renaming object members
|
public static SwaggerMigrator membersToString(String first, 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.MembersToStringpublic 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 applyJsonPatchpublic static SwaggerMigrator renameMember(String from, 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(String resourcePath)
resourcePath - the resource pathfromPatch(JsonPatch)Copyright © 2023. All rights reserved.