From 8c8be7482b9660394749a889f22c926093b98a8c Mon Sep 17 00:00:00 2001
From: William Cheng
Date: Mon, 18 Sep 2023 11:26:33 +0800
Subject: [PATCH] Update java undertow to newer version (#16606)
* update java undertow to newer version
* update compiler plugin to newer version
* test undertow in circleci
* use 3.0 spec
---
.../workflows/samples-java-server-jdk8.yaml | 5 +-
...ndertow.yaml => java-undertow-server.yaml} | 2 +-
.../java-undertow-server/pom.mustache | 2 +-
pom.xml | 2 +
.../java-undertow/dependency-reduced-pom.xml | 2 +-
samples/server/petstore/java-undertow/pom.xml | 2 +-
.../handler/PathHandlerInterface.java | 60 +++-
.../src/main/resources/config/openapi.json | 283 +++++++++++-------
8 files changed, 233 insertions(+), 125 deletions(-)
rename bin/configs/{java-undertow-server-java-undertow.yaml => java-undertow-server.yaml} (78%)
diff --git a/.github/workflows/samples-java-server-jdk8.yaml b/.github/workflows/samples-java-server-jdk8.yaml
index 73e4bcfb0b8..342a624b0c7 100644
--- a/.github/workflows/samples-java-server-jdk8.yaml
+++ b/.github/workflows/samples-java-server-jdk8.yaml
@@ -8,6 +8,7 @@ on:
- 'samples/server/petstore/java-vertx-web/**'
- 'samples/server/petstore/java-inflector/**'
- 'samples/server/petstore/java-pkmst/**'
+ # test in circleci instead
- 'samples/server/petstore/java-undertow/**'
pull_request:
paths:
@@ -15,7 +16,7 @@ on:
- 'samples/server/petstore/java-vertx-web/**'
- 'samples/server/petstore/java-inflector/**'
- 'samples/server/petstore/java-pkmst/**'
- - 'samples/server/petstore/java-undertow/**'
+ #- 'samples/server/petstore/java-undertow/**'
jobs:
build:
name: Build Java Server
@@ -29,7 +30,7 @@ jobs:
- samples/server/petstore/java-vertx-web/
- samples/server/petstore/java-inflector/
- samples/server/petstore/java-pkmst/
- - samples/server/petstore/java-undertow/
+ #- samples/server/petstore/java-undertow/
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
diff --git a/bin/configs/java-undertow-server-java-undertow.yaml b/bin/configs/java-undertow-server.yaml
similarity index 78%
rename from bin/configs/java-undertow-server-java-undertow.yaml
rename to bin/configs/java-undertow-server.yaml
index 2cbb1160f17..0abaa522f85 100644
--- a/bin/configs/java-undertow-server-java-undertow.yaml
+++ b/bin/configs/java-undertow-server.yaml
@@ -1,6 +1,6 @@
generatorName: java-undertow-server
outputDir: samples/server/petstore/java-undertow
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/java-undertow-server
additionalProperties:
hideGenerationTimestamp: "true"
diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache
index 09880bfb29e..0c935a6ad27 100644
--- a/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache
@@ -29,7 +29,7 @@
1.2.0
4.13.2
2.1.0-beta.124
- 2.2.24.Final
+ 2.3.5.Final
2.2.0
4.5.13
4.1.2
diff --git a/pom.xml b/pom.xml
index 18a60a47967..d69e6af2c80 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1290,6 +1290,8 @@
samples/client/petstore/java/resteasy
samples/client/petstore/java-micronaut-client
samples/client/petstore/java/apache-httpclient
+
+ samples/server/petstore/java-undertow
diff --git a/samples/server/petstore/java-undertow/dependency-reduced-pom.xml b/samples/server/petstore/java-undertow/dependency-reduced-pom.xml
index 5ed0060b336..43d9fc19edd 100644
--- a/samples/server/petstore/java-undertow/dependency-reduced-pom.xml
+++ b/samples/server/petstore/java-undertow/dependency-reduced-pom.xml
@@ -135,7 +135,7 @@
0.1.1
2.14.1
4.1.2
- 2.2.24.Final
+ 2.3.5.Final
1.7.21
2.14.1
UTF-8
diff --git a/samples/server/petstore/java-undertow/pom.xml b/samples/server/petstore/java-undertow/pom.xml
index 4659968f144..d4503f49f40 100644
--- a/samples/server/petstore/java-undertow/pom.xml
+++ b/samples/server/petstore/java-undertow/pom.xml
@@ -29,7 +29,7 @@
1.2.0
4.13.2
2.1.0-beta.124
- 2.2.24.Final
+ 2.3.5.Final
2.2.0
4.5.13
4.1.2
diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java
index e55763683cd..24e6b8d80f4 100644
--- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java
+++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java
@@ -21,6 +21,8 @@ public interface PathHandlerInterface {
/**
* Add a new pet to the store
*
+ *
+ *
* Endpoint: {@link Methods#POST POST} "/v2/pet" (privileged: true)
*
* Request parameters:
@@ -30,9 +32,12 @@ public interface PathHandlerInterface {
* Consumes: [{isJson=true, mediaType=application/json}, {isXml=true, mediaType=application/xml}]
* Payload: {@link Pet} (required: true)
*
+ * Produces: [{isXml=true, mediaType=application/xml}, {isJson=true, mediaType=application/json}]
+ * Returns: {@link Pet}
*
* Responses:
*
+ * - 200 (success): successful operation
* - 405 (client error): Invalid input
*
*/
@@ -42,6 +47,8 @@ public interface PathHandlerInterface {
/**
* Deletes a pet
*
+ *
+ *
* Endpoint: {@link Methods#DELETE DELETE} "/v2/pet/{petId}" (privileged: true)
*
* Request parameters:
@@ -175,6 +182,8 @@ public interface PathHandlerInterface {
/**
* Update an existing pet
*
+ *
+ *
* Endpoint: {@link Methods#PUT PUT} "/v2/pet" (privileged: true)
*
* Request parameters:
@@ -184,9 +193,12 @@ public interface PathHandlerInterface {
* Consumes: [{isJson=true, mediaType=application/json}, {isXml=true, mediaType=application/xml}]
* Payload: {@link Pet} (required: true)
*
+ * Produces: [{isXml=true, mediaType=application/xml}, {isJson=true, mediaType=application/json}]
+ * Returns: {@link Pet}
*
* Responses:
*
+ * - 200 (success): successful operation
* - 400 (client error): Invalid ID supplied
* - 404 (client error): Pet not found
* - 405 (client error): Validation exception
@@ -198,6 +210,8 @@ public interface PathHandlerInterface {
/**
* Updates a pet in the store with form data
*
+ *
+ *
* Endpoint: {@link Methods#POST POST} "/v2/pet/{petId}" (privileged: true)
*
* Request parameters:
@@ -245,6 +259,8 @@ public interface PathHandlerInterface {
/**
* uploads an image
*
+ *
+ *
* Endpoint: {@link Methods#POST POST} "/v2/pet/{petId}/uploadImage" (privileged: true)
*
* Request parameters:
@@ -375,12 +391,17 @@ public interface PathHandlerInterface {
/**
* Place an order for a pet
*
+ *
+ *
* Endpoint: {@link Methods#POST POST} "/v2/store/order" (privileged: false)
*
* Request parameters:
*
*
+ * Consumes: [{isJson=true, mediaType=application/json}]
+ * Payload: {@link Order} (required: true)
+ *
* Produces: [{isXml=true, mediaType=application/xml}, {isJson=true, mediaType=application/json}]
* Returns: {@link Order}
*
@@ -398,12 +419,15 @@ public interface PathHandlerInterface {
*
* This can only be done by the logged in user.
*
- * Endpoint: {@link Methods#POST POST} "/v2/user" (privileged: false)
+ * Endpoint: {@link Methods#POST POST} "/v2/user" (privileged: true)
*
* Request parameters:
*
*
+ * Consumes: [{isJson=true, mediaType=application/json}]
+ * Payload: {@link User} (required: true)
+ *
*
* Responses:
*
@@ -416,12 +440,17 @@ public interface PathHandlerInterface {
/**
* Creates list of users with given input array
*
- * Endpoint: {@link Methods#POST POST} "/v2/user/createWithArray" (privileged: false)
+ *
+ *
+ * Endpoint: {@link Methods#POST POST} "/v2/user/createWithArray" (privileged: true)
*
* Request parameters:
*
*
+ * Consumes: [{isJson=true, mediaType=application/json}]
+ * Payload: {@link java.util.List List} of {@link User} (required: true)
+ *
*
* Responses:
*
@@ -434,12 +463,17 @@ public interface PathHandlerInterface {
/**
* Creates list of users with given input array
*
- * Endpoint: {@link Methods#POST POST} "/v2/user/createWithList" (privileged: false)
+ *
+ *
+ * Endpoint: {@link Methods#POST POST} "/v2/user/createWithList" (privileged: true)
*
* Request parameters:
*
*
+ * Consumes: [{isJson=true, mediaType=application/json}]
+ * Payload: {@link java.util.List List} of {@link User} (required: true)
+ *
*
* Responses:
*
@@ -454,7 +488,7 @@ public interface PathHandlerInterface {
*
* This can only be done by the logged in user.
*
- * Endpoint: {@link Methods#DELETE DELETE} "/v2/user/{username}" (privileged: false)
+ * Endpoint: {@link Methods#DELETE DELETE} "/v2/user/{username}" (privileged: true)
*
* Request parameters:
*
@@ -482,6 +516,8 @@ public interface PathHandlerInterface {
/**
* Get user by user name
*
+ *
+ *
* Endpoint: {@link Methods#GET GET} "/v2/user/{username}" (privileged: false)
*
* Request parameters:
@@ -513,6 +549,8 @@ public interface PathHandlerInterface {
/**
* Logs user into the system
*
+ *
+ *
* Endpoint: {@link Methods#GET GET} "/v2/user/login" (privileged: false)
*
* Request parameters:
@@ -536,7 +574,10 @@ public interface PathHandlerInterface {
*
*
*
- * Response headers: [CodegenProperty{openApiType='integer', baseName='X-Rate-Limit', complexType='null', getter='getxRateLimit', setter='setxRateLimit', description='calls per hour allowed by the user', dataType='Integer', datatypeWithEnum='Integer', dataFormat='int32', name='xRateLimit', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Rate-Limit;', baseType='Integer', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='calls per hour allowed by the user', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{
+ *
Response headers: [CodegenProperty{openApiType='string', baseName='Set-Cookie', complexType='null', getter='getSetCookie', setter='setSetCookie', description='Cookie authentication key for use with the `api_key` apiKey authentication.', dataType='String', datatypeWithEnum='String', dataFormat='null', name='setCookie', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.Set-Cookie;', baseType='String', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='Cookie authentication key for use with the `api_key` apiKey authentication.', maxLength=null, minLength=null, pattern='null', example='AUTH_KEY=abcde12345; Path=/; HttpOnly', jsonSchema='{
+ "type" : "string",
+ "example" : "AUTH_KEY=abcde12345; Path=/; HttpOnly"
+}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=true, isNumeric=false, isInteger=false, isShort=false, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='SetCookie', nameInSnakeCase='SET_COOKIE', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null}, CodegenProperty{openApiType='integer', baseName='X-Rate-Limit', complexType='null', getter='getxRateLimit', setter='setxRateLimit', description='calls per hour allowed by the user', dataType='Integer', datatypeWithEnum='Integer', dataFormat='int32', name='xRateLimit', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Rate-Limit;', baseType='Integer', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='calls per hour allowed by the user', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{
"type" : "integer",
"format" : "int32"
}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=false, isNumeric=true, isInteger=true, isShort=true, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='XRateLimit', nameInSnakeCase='X_RATE_LIMIT', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=int32, dependentRequired=null, contains=null}, CodegenProperty{openApiType='string', baseName='X-Expires-After', complexType='Date', getter='getxExpiresAfter', setter='setxExpiresAfter', description='date in UTC when token expires', dataType='Date', datatypeWithEnum='Date', dataFormat='date-time', name='xExpiresAfter', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Expires-After;', baseType='Date', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='date in UTC when token expires', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{
@@ -559,7 +600,9 @@ public interface PathHandlerInterface {
/**
*
Logs out current logged in user session
*
- * Endpoint: {@link Methods#GET GET} "/v2/user/logout" (privileged: false)
+ *
+ *
+ * Endpoint: {@link Methods#GET GET} "/v2/user/logout" (privileged: true)
*
*
* Responses:
@@ -575,7 +618,7 @@ public interface PathHandlerInterface {
*
* This can only be done by the logged in user.
*
- * Endpoint: {@link Methods#PUT PUT} "/v2/user/{username}" (privileged: false)
+ * Endpoint: {@link Methods#PUT PUT} "/v2/user/{username}" (privileged: true)
*
* Request parameters:
*
@@ -590,6 +633,9 @@ public interface PathHandlerInterface {
*
*
*
+ * Consumes: [{isJson=true, mediaType=application/json}]
+ * Payload: {@link User} (required: true)
+ *
*
* Responses:
*
diff --git a/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json b/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json
index 8b12859e647..04da14326f8 100644
--- a/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json
+++ b/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json
@@ -1,5 +1,5 @@
{
- "openapi" : "3.0.1",
+ "openapi" : "3.0.0",
"info" : {
"description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.",
"license" : {
@@ -9,6 +9,10 @@
"title" : "OpenAPI Petstore",
"version" : "1.0.0"
},
+ "externalDocs" : {
+ "description" : "Find out more about Swagger",
+ "url" : "http://swagger.io"
+ },
"servers" : [ {
"url" : "http://petstore.swagger.io/v2"
} ],
@@ -25,26 +29,28 @@
"paths" : {
"/pet" : {
"post" : {
+ "description" : "",
"operationId" : "addPet",
"requestBody" : {
- "content" : {
- "application/json" : {
- "schema" : {
- "$ref" : "#/components/schemas/Pet"
- }
- },
- "application/xml" : {
- "schema" : {
- "$ref" : "#/components/schemas/Pet"
- }
- }
- },
- "description" : "Pet object that needs to be added to the store",
- "required" : true
+ "$ref" : "#/components/requestBodies/Pet"
},
"responses" : {
+ "200" : {
+ "content" : {
+ "application/xml" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Pet"
+ }
+ },
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Pet"
+ }
+ }
+ },
+ "description" : "successful operation"
+ },
"405" : {
- "content" : { },
"description" : "Invalid input"
}
},
@@ -53,39 +59,42 @@
} ],
"summary" : "Add a new pet to the store",
"tags" : [ "pet" ],
- "x-codegen-request-body-name" : "body",
"x-content-type" : "application/json",
"x-accepts" : "application/json"
},
"put" : {
+ "description" : "",
+ "externalDocs" : {
+ "description" : "API documentation for the updatePet operation",
+ "url" : "http://petstore.swagger.io/v2/doc/updatePet"
+ },
"operationId" : "updatePet",
"requestBody" : {
- "content" : {
- "application/json" : {
- "schema" : {
- "$ref" : "#/components/schemas/Pet"
- }
- },
- "application/xml" : {
- "schema" : {
- "$ref" : "#/components/schemas/Pet"
- }
- }
- },
- "description" : "Pet object that needs to be added to the store",
- "required" : true
+ "$ref" : "#/components/requestBodies/Pet"
},
"responses" : {
+ "200" : {
+ "content" : {
+ "application/xml" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Pet"
+ }
+ },
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Pet"
+ }
+ }
+ },
+ "description" : "successful operation"
+ },
"400" : {
- "content" : { },
"description" : "Invalid ID supplied"
},
"404" : {
- "content" : { },
"description" : "Pet not found"
},
"405" : {
- "content" : { },
"description" : "Validation exception"
}
},
@@ -94,7 +103,6 @@
} ],
"summary" : "Update an existing pet",
"tags" : [ "pet" ],
- "x-codegen-request-body-name" : "body",
"x-content-type" : "application/json",
"x-accepts" : "application/json"
}
@@ -104,6 +112,7 @@
"description" : "Multiple status values can be provided with comma separated strings",
"operationId" : "findPetsByStatus",
"parameters" : [ {
+ "deprecated" : true,
"description" : "Status values that need to be considered for filter",
"explode" : false,
"in" : "query",
@@ -142,12 +151,11 @@
"description" : "successful operation"
},
"400" : {
- "content" : { },
"description" : "Invalid status value"
}
},
"security" : [ {
- "petstore_auth" : [ "write:pets", "read:pets" ]
+ "petstore_auth" : [ "read:pets" ]
} ],
"summary" : "Finds Pets by status",
"tags" : [ "pet" ],
@@ -196,12 +204,11 @@
"description" : "successful operation"
},
"400" : {
- "content" : { },
"description" : "Invalid tag value"
}
},
"security" : [ {
- "petstore_auth" : [ "write:pets", "read:pets" ]
+ "petstore_auth" : [ "read:pets" ]
} ],
"summary" : "Finds Pets by tags",
"tags" : [ "pet" ],
@@ -210,26 +217,31 @@
},
"/pet/{petId}" : {
"delete" : {
+ "description" : "",
"operationId" : "deletePet",
"parameters" : [ {
+ "explode" : false,
"in" : "header",
"name" : "api_key",
+ "required" : false,
"schema" : {
"type" : "string"
- }
+ },
+ "style" : "simple"
}, {
"description" : "Pet id to delete",
+ "explode" : false,
"in" : "path",
"name" : "petId",
"required" : true,
"schema" : {
"format" : "int64",
"type" : "integer"
- }
+ },
+ "style" : "simple"
} ],
"responses" : {
"400" : {
- "content" : { },
"description" : "Invalid pet value"
}
},
@@ -245,13 +257,15 @@
"operationId" : "getPetById",
"parameters" : [ {
"description" : "ID of pet to return",
+ "explode" : false,
"in" : "path",
"name" : "petId",
"required" : true,
"schema" : {
"format" : "int64",
"type" : "integer"
- }
+ },
+ "style" : "simple"
} ],
"responses" : {
"200" : {
@@ -270,11 +284,9 @@
"description" : "successful operation"
},
"400" : {
- "content" : { },
"description" : "Invalid ID supplied"
},
"404" : {
- "content" : { },
"description" : "Pet not found"
}
},
@@ -286,16 +298,19 @@
"x-accepts" : "application/json"
},
"post" : {
+ "description" : "",
"operationId" : "updatePetWithForm",
"parameters" : [ {
"description" : "ID of pet that needs to be updated",
+ "explode" : false,
"in" : "path",
"name" : "petId",
"required" : true,
"schema" : {
"format" : "int64",
"type" : "integer"
- }
+ },
+ "style" : "simple"
} ],
"requestBody" : {
"content" : {
@@ -308,7 +323,6 @@
},
"responses" : {
"405" : {
- "content" : { },
"description" : "Invalid input"
}
},
@@ -323,16 +337,19 @@
},
"/pet/{petId}/uploadImage" : {
"post" : {
+ "description" : "",
"operationId" : "uploadFile",
"parameters" : [ {
"description" : "ID of pet to update",
+ "explode" : false,
"in" : "path",
"name" : "petId",
"required" : true,
"schema" : {
"format" : "int64",
"type" : "integer"
- }
+ },
+ "style" : "simple"
} ],
"requestBody" : {
"content" : {
@@ -394,10 +411,11 @@
},
"/store/order" : {
"post" : {
+ "description" : "",
"operationId" : "placeOrder",
"requestBody" : {
"content" : {
- "*/*" : {
+ "application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Order"
}
@@ -423,14 +441,12 @@
"description" : "successful operation"
},
"400" : {
- "content" : { },
"description" : "Invalid Order"
}
},
"summary" : "Place an order for a pet",
"tags" : [ "store" ],
- "x-codegen-request-body-name" : "body",
- "x-content-type" : "*/*",
+ "x-content-type" : "application/json",
"x-accepts" : "application/json"
}
},
@@ -440,20 +456,20 @@
"operationId" : "deleteOrder",
"parameters" : [ {
"description" : "ID of the order that needs to be deleted",
+ "explode" : false,
"in" : "path",
"name" : "orderId",
"required" : true,
"schema" : {
"type" : "string"
- }
+ },
+ "style" : "simple"
} ],
"responses" : {
"400" : {
- "content" : { },
"description" : "Invalid ID supplied"
},
"404" : {
- "content" : { },
"description" : "Order not found"
}
},
@@ -466,6 +482,7 @@
"operationId" : "getOrderById",
"parameters" : [ {
"description" : "ID of pet that needs to be fetched",
+ "explode" : false,
"in" : "path",
"name" : "orderId",
"required" : true,
@@ -474,7 +491,8 @@
"maximum" : 5,
"minimum" : 1,
"type" : "integer"
- }
+ },
+ "style" : "simple"
} ],
"responses" : {
"200" : {
@@ -493,11 +511,9 @@
"description" : "successful operation"
},
"400" : {
- "content" : { },
"description" : "Invalid ID supplied"
},
"404" : {
- "content" : { },
"description" : "Order not found"
}
},
@@ -512,7 +528,7 @@
"operationId" : "createUser",
"requestBody" : {
"content" : {
- "*/*" : {
+ "application/json" : {
"schema" : {
"$ref" : "#/components/schemas/User"
}
@@ -523,96 +539,85 @@
},
"responses" : {
"default" : {
- "content" : { },
"description" : "successful operation"
}
},
+ "security" : [ {
+ "api_key" : [ ]
+ } ],
"summary" : "Create user",
"tags" : [ "user" ],
- "x-codegen-request-body-name" : "body",
- "x-content-type" : "*/*",
+ "x-content-type" : "application/json",
"x-accepts" : "application/json"
}
},
"/user/createWithArray" : {
"post" : {
+ "description" : "",
"operationId" : "createUsersWithArrayInput",
"requestBody" : {
- "content" : {
- "*/*" : {
- "schema" : {
- "items" : {
- "$ref" : "#/components/schemas/User"
- },
- "type" : "array"
- }
- }
- },
- "description" : "List of user object",
- "required" : true
+ "$ref" : "#/components/requestBodies/UserArray"
},
"responses" : {
"default" : {
- "content" : { },
"description" : "successful operation"
}
},
+ "security" : [ {
+ "api_key" : [ ]
+ } ],
"summary" : "Creates list of users with given input array",
"tags" : [ "user" ],
- "x-codegen-request-body-name" : "body",
- "x-content-type" : "*/*",
+ "x-content-type" : "application/json",
"x-accepts" : "application/json"
}
},
"/user/createWithList" : {
"post" : {
+ "description" : "",
"operationId" : "createUsersWithListInput",
"requestBody" : {
- "content" : {
- "*/*" : {
- "schema" : {
- "items" : {
- "$ref" : "#/components/schemas/User"
- },
- "type" : "array"
- }
- }
- },
- "description" : "List of user object",
- "required" : true
+ "$ref" : "#/components/requestBodies/UserArray"
},
"responses" : {
"default" : {
- "content" : { },
"description" : "successful operation"
}
},
+ "security" : [ {
+ "api_key" : [ ]
+ } ],
"summary" : "Creates list of users with given input array",
"tags" : [ "user" ],
- "x-codegen-request-body-name" : "body",
- "x-content-type" : "*/*",
+ "x-content-type" : "application/json",
"x-accepts" : "application/json"
}
},
"/user/login" : {
"get" : {
+ "description" : "",
"operationId" : "loginUser",
"parameters" : [ {
"description" : "The user name for login",
+ "explode" : true,
"in" : "query",
"name" : "username",
"required" : true,
"schema" : {
+ "pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$",
"type" : "string"
- }
+ },
+ "style" : "form"
}, {
"description" : "The password for login in clear text",
+ "explode" : true,
"in" : "query",
"name" : "password",
"required" : true,
"schema" : {
"type" : "string"
- }
+ },
+ "style" : "form"
} ],
"responses" : {
"200" : {
@@ -630,24 +635,36 @@
},
"description" : "successful operation",
"headers" : {
+ "Set-Cookie" : {
+ "description" : "Cookie authentication key for use with the `api_key` apiKey authentication.",
+ "explode" : false,
+ "schema" : {
+ "example" : "AUTH_KEY=abcde12345; Path=/; HttpOnly",
+ "type" : "string"
+ },
+ "style" : "simple"
+ },
"X-Rate-Limit" : {
"description" : "calls per hour allowed by the user",
+ "explode" : false,
"schema" : {
"format" : "int32",
"type" : "integer"
- }
+ },
+ "style" : "simple"
},
"X-Expires-After" : {
"description" : "date in UTC when token expires",
+ "explode" : false,
"schema" : {
"format" : "date-time",
"type" : "string"
- }
+ },
+ "style" : "simple"
}
}
},
"400" : {
- "content" : { },
"description" : "Invalid username/password supplied"
}
},
@@ -658,13 +675,16 @@
},
"/user/logout" : {
"get" : {
+ "description" : "",
"operationId" : "logoutUser",
"responses" : {
"default" : {
- "content" : { },
"description" : "successful operation"
}
},
+ "security" : [ {
+ "api_key" : [ ]
+ } ],
"summary" : "Logs out current logged in user session",
"tags" : [ "user" ],
"x-accepts" : "application/json"
@@ -676,37 +696,43 @@
"operationId" : "deleteUser",
"parameters" : [ {
"description" : "The name that needs to be deleted",
+ "explode" : false,
"in" : "path",
"name" : "username",
"required" : true,
"schema" : {
"type" : "string"
- }
+ },
+ "style" : "simple"
} ],
"responses" : {
"400" : {
- "content" : { },
"description" : "Invalid username supplied"
},
"404" : {
- "content" : { },
"description" : "User not found"
}
},
+ "security" : [ {
+ "api_key" : [ ]
+ } ],
"summary" : "Delete user",
"tags" : [ "user" ],
"x-accepts" : "application/json"
},
"get" : {
+ "description" : "",
"operationId" : "getUserByName",
"parameters" : [ {
"description" : "The name that needs to be fetched. Use user1 for testing.",
+ "explode" : false,
"in" : "path",
"name" : "username",
"required" : true,
"schema" : {
"type" : "string"
- }
+ },
+ "style" : "simple"
} ],
"responses" : {
"200" : {
@@ -725,11 +751,9 @@
"description" : "successful operation"
},
"400" : {
- "content" : { },
"description" : "Invalid username supplied"
},
"404" : {
- "content" : { },
"description" : "User not found"
}
},
@@ -742,16 +766,18 @@
"operationId" : "updateUser",
"parameters" : [ {
"description" : "name that need to be deleted",
+ "explode" : false,
"in" : "path",
"name" : "username",
"required" : true,
"schema" : {
"type" : "string"
- }
+ },
+ "style" : "simple"
} ],
"requestBody" : {
"content" : {
- "*/*" : {
+ "application/json" : {
"schema" : {
"$ref" : "#/components/schemas/User"
}
@@ -762,23 +788,55 @@
},
"responses" : {
"400" : {
- "content" : { },
"description" : "Invalid user supplied"
},
"404" : {
- "content" : { },
"description" : "User not found"
}
},
+ "security" : [ {
+ "api_key" : [ ]
+ } ],
"summary" : "Updated user",
"tags" : [ "user" ],
- "x-codegen-request-body-name" : "body",
- "x-content-type" : "*/*",
+ "x-content-type" : "application/json",
"x-accepts" : "application/json"
}
}
},
"components" : {
+ "requestBodies" : {
+ "UserArray" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "items" : {
+ "$ref" : "#/components/schemas/User"
+ },
+ "type" : "array"
+ }
+ }
+ },
+ "description" : "List of user object",
+ "required" : true
+ },
+ "Pet" : {
+ "content" : {
+ "application/json" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Pet"
+ }
+ },
+ "application/xml" : {
+ "schema" : {
+ "$ref" : "#/components/schemas/Pet"
+ }
+ }
+ },
+ "description" : "Pet object that needs to be added to the store",
+ "required" : true
+ }
+ },
"schemas" : {
"Order" : {
"description" : "An order for a pets from the pet store",
@@ -835,6 +893,7 @@
"type" : "integer"
},
"name" : {
+ "pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$",
"type" : "string"
}
},
@@ -964,6 +1023,7 @@
}
},
"status" : {
+ "deprecated" : true,
"description" : "pet status in the store",
"enum" : [ "available", "pending", "sold" ],
"type" : "string"
@@ -1045,6 +1105,5 @@
"type" : "apiKey"
}
}
- },
- "x-original-swagger-version" : "2.0"
+ }
}
\ No newline at end of file