public interface SwaggerResponses
| Modifier and Type | Method and Description |
|---|---|
default JSONObject |
createArrayProperty(java.lang.String description,
java.lang.Integer minItems,
java.lang.Integer maxItems)
Check https://swagger.io/docs/specification/data-models/data-types/#array/ for details
|
default JSONObject |
createBooleanProperty(java.lang.String description,
boolean example)
Check https://swagger.io/docs/specification/data-models/data-types/#boolean/ for details
|
default JSONObject |
createIntegerProperty(java.lang.String description,
java.lang.String format,
long example,
java.lang.Integer minimum,
java.lang.Integer maximum,
java.lang.Integer mutiple)
Check https://swagger.io/docs/specification/data-models/data-types/#numbers/ for details
|
default JSONObject |
createNumberProperty(java.lang.String description,
java.lang.String format,
java.lang.Object example,
java.lang.Double minimum,
java.lang.Double maximum,
java.lang.Double mutiple)
Check https://swagger.io/docs/specification/data-models/data-types/#numbers/ for details
|
default JSONObject |
createObjectProperty(java.lang.String description)
Check https://swagger.io/docs/specification/data-models/data-types/#object/ for details
|
default JSONObject |
createStringProperty(java.lang.String description,
java.lang.String format,
java.lang.String pattern,
java.lang.Object example)
Check https://swagger.io/docs/specification/data-models/data-types/#string/ for details
|
void |
describeResponse(WebClient client,
RestDefinition rd,
Method method,
JSONObject responses,
JSONObject operationObj,
java.lang.String restPath,
JSONObject definitions)
describe the response format.
|
default JSONObject |
getStandardProperty(java.lang.String type,
java.lang.String description,
java.lang.String format,
java.lang.Object example)
Check https://swagger.io/docs/specification/data-models/ for details
|
@Nullable
void describeResponse(@Nonnull
WebClient client,
@Nonnull
RestDefinition rd,
@Nonnull
Method method,
@Nonnull
JSONObject responses,
@Nonnull
JSONObject operationObj,
@Nonnull
java.lang.String restPath,
@Nonnull
JSONObject definitions)
throws java.lang.Exception
describe the response format. Check https://swagger.io/docs/specification/describing-responses/ for details
sample:
{
"200": {
"description": "successful operation",
"schema": {
"$ref": "#/definitions/class_v8_GET"
}
},
"404": {
"description": "Not found"
}
}
client - web clientrd - rest definitionmethod - methodresponses - JSONObject that holds the responsesoperationObj - the operation json for this service, such as GET /v8/class/Person/{_key} and GET /v8/class/Person are two different operation jsonrestPath - rest path such as /v8/class/{className}/{_key}definitions - $ref definition JSONObjectjava.lang.Exception - a serious problem.@Nonnull default JSONObject createStringProperty(@Nullable java.lang.String description, @Nullable java.lang.String format, @Nullable java.lang.String pattern, @Nullable java.lang.Object example)
Check https://swagger.io/docs/specification/data-models/data-types/#string/ for details
create the string itemdescription - descriptionformat - value formatpattern - Regular expression for the string valueexample - example@Nonnull default JSONObject createNumberProperty(@Nullable java.lang.String description, @Nullable java.lang.String format, @Nullable java.lang.Object example, @Nullable java.lang.Double minimum, @Nullable java.lang.Double maximum, @Nullable java.lang.Double mutiple)
Check https://swagger.io/docs/specification/data-models/data-types/#numbers/ for details
create the number itemdescription - descriptionformat - value formatexample - exampleminimum - minimum valuemaximum - maximum valuemutiple - specify a number must be the multiple of this number@Nonnull default JSONObject createIntegerProperty(@Nullable java.lang.String description, @Nullable java.lang.String format, @Nullable long example, @Nullable java.lang.Integer minimum, @Nullable java.lang.Integer maximum, @Nullable java.lang.Integer mutiple)
Check https://swagger.io/docs/specification/data-models/data-types/#numbers/ for details
create the integer itemdescription - descriptionformat - value formatexample - exampleminimum - minimum valuemaximum - maximum valuemutiple - specify a number must be the multiple of this number@Nonnull default JSONObject createBooleanProperty(@Nullable java.lang.String description, @Nullable boolean example)
Check https://swagger.io/docs/specification/data-models/data-types/#boolean/ for details
create the boolean itemdescription - descriptionexample - example@Nonnull default JSONObject createArrayProperty(@Nullable java.lang.String description, @Nullable java.lang.Integer minItems, @Nullable java.lang.Integer maxItems)
Check https://swagger.io/docs/specification/data-models/data-types/#array/ for details
create the array itemdescription - descriptionminItems - array min lengthmaxItems - array max length@Nonnull default JSONObject createObjectProperty(@Nullable java.lang.String description)
Check https://swagger.io/docs/specification/data-models/data-types/#object/ for details
create the object itemdescription - description@Nonnull default JSONObject getStandardProperty(@Nonnull java.lang.String type, @Nullable java.lang.String description, @Nullable java.lang.String format, @Nullable java.lang.Object example)
Check https://swagger.io/docs/specification/data-models/ for details
create the property jsontype - data typedescription - descriptionformat - data formatexample - example valuestSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.