forked from loafle/openapi-generator-original
Mark nodejs-server as deprecated (#3083)
* mark nodejs-server as deprecated * update opeanpi3 script * add new file
This commit is contained in:
parent
89d0c01764
commit
c6207c0a49
@ -27,6 +27,6 @@ fi
|
|||||||
|
|
||||||
# if you've executed sbt assembly previously it will use that instead.
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g nodejs-server --additional-properties=googleCloudFunctions=true -o samples/server/petstore/nodejs-google-cloud-functions -Dservice $@"
|
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g nodejs-server-deprecated --additional-properties=googleCloudFunctions=true -o samples/server/petstore/nodejs-google-cloud-functions -Dservice $@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
@ -27,6 +27,6 @@ fi
|
|||||||
|
|
||||||
# if you've executed sbt assembly previously it will use that instead.
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
ags="generate -t modules/openapi-generator/src/main/resources/nodejs -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g nodejs-server -o samples/server/petstore/nodejs -Dservice $@"
|
ags="generate -t modules/openapi-generator/src/main/resources/nodejs -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g nodejs-server-deprecated -o samples/server/petstore/nodejs -Dservice $@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
@ -27,6 +27,6 @@ fi
|
|||||||
|
|
||||||
# if you've executed sbt assembly previously it will use that instead.
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g nodejs-server --additional-properties=googleCloudFunctions=true -o samples/server/petstore/nodejs-google-cloud-functions -Dservice $@"
|
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g nodejs-server-deprecated --additional-properties=googleCloudFunctions=true -o samples/server/petstore/nodejs-google-cloud-functions -Dservice $@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
@ -27,6 +27,6 @@ fi
|
|||||||
|
|
||||||
# if you've executed sbt assembly previously it will use that instead.
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
ags="generate -t modules/openapi-generator/src/main/resources/nodejs -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g nodejs-server -o samples/server/petstore/nodejs -Dservice $@"
|
ags="generate -t modules/openapi-generator/src/main/resources/nodejs -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g nodejs-server-deprecated -o samples/server/petstore/nodejs -Dservice $@"
|
||||||
|
|
||||||
java $JAVA_OPTS -jar $executable $ags
|
java $JAVA_OPTS -jar $executable $ags
|
||||||
|
@ -91,7 +91,7 @@ The following generators are available:
|
|||||||
- [jaxrs-spec](generators/jaxrs-spec.md)
|
- [jaxrs-spec](generators/jaxrs-spec.md)
|
||||||
- [kotlin-server](generators/kotlin-server.md)
|
- [kotlin-server](generators/kotlin-server.md)
|
||||||
- [kotlin-spring](generators/kotlin-spring.md)
|
- [kotlin-spring](generators/kotlin-spring.md)
|
||||||
- [nodejs-server](generators/nodejs-server.md)
|
- [nodejs-server-deprecated](generators/nodejs-server-deprecated.md) (deprecated)
|
||||||
- [php-laravel](generators/php-laravel.md)
|
- [php-laravel](generators/php-laravel.md)
|
||||||
- [php-lumen](generators/php-lumen.md)
|
- [php-lumen](generators/php-lumen.md)
|
||||||
- [php-silex](generators/php-silex.md)
|
- [php-silex](generators/php-silex.md)
|
||||||
|
16
docs/generators/nodejs-server-deprecated.md
Normal file
16
docs/generators/nodejs-server-deprecated.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
id: generator-opts-server-nodejs-server-deprecated
|
||||||
|
title: Config Options for nodejs-server-deprecated
|
||||||
|
sidebar_label: nodejs-server-deprecated
|
||||||
|
---
|
||||||
|
|
||||||
|
| Option | Description | Values | Default |
|
||||||
|
| ------ | ----------- | ------ | ------- |
|
||||||
|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||||
|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||||
|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||||
|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||||
|
|googleCloudFunctions|When specified, it will generate the code which runs within Google Cloud Functions instead of standalone Node.JS server. See https://cloud.google.com/functions/docs/quickstart for the details of how to deploy the generated code.| |false|
|
||||||
|
|exportedName|When the generated code will be deployed to Google Cloud Functions, this option can be used to update the name of the exported function. By default, it refers to the basePath. This does not affect normal standalone nodejs server code.| |null|
|
||||||
|
|serverPort|TCP port to listen on.| |null|
|
@ -28,6 +28,8 @@ import io.swagger.v3.oas.models.Paths;
|
|||||||
import io.swagger.v3.oas.models.info.Info;
|
import io.swagger.v3.oas.models.info.Info;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.config.GeneratorProperties;
|
import org.openapitools.codegen.config.GeneratorProperties;
|
||||||
|
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||||
|
import org.openapitools.codegen.meta.Stability;
|
||||||
import org.openapitools.codegen.utils.URLPathUtils;
|
import org.openapitools.codegen.utils.URLPathUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -58,6 +60,11 @@ public class NodeJSServerCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
public NodeJSServerCodegen() {
|
public NodeJSServerCodegen() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
// mark the generator as deprecated in the documentation
|
||||||
|
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
||||||
|
.stability(Stability.DEPRECATED)
|
||||||
|
.build();
|
||||||
|
|
||||||
// set the output folder here
|
// set the output folder here
|
||||||
outputFolder = "generated-code/nodejs";
|
outputFolder = "generated-code/nodejs";
|
||||||
|
|
||||||
@ -142,7 +149,7 @@ public class NodeJSServerCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "nodejs-server";
|
return "nodejs-server-deprecated";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -153,7 +160,7 @@ public class NodeJSServerCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getHelp() {
|
public String getHelp() {
|
||||||
return "Generates a nodejs server library using the swagger-tools project. By default, " +
|
return "[DEPRECATED] Generates a nodejs server library using the swagger-tools project. By default, " +
|
||||||
"it will also generate service classes--which you can disable with the `-Dnoservice` environment variable.";
|
"it will also generate service classes--which you can disable with the `-Dnoservice` environment variable.";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -303,6 +310,8 @@ public class NodeJSServerCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
message.append(System.lineSeparator()).append(System.lineSeparator())
|
message.append(System.lineSeparator()).append(System.lineSeparator())
|
||||||
.append("=======================================================================================")
|
.append("=======================================================================================")
|
||||||
.append(System.lineSeparator())
|
.append(System.lineSeparator())
|
||||||
|
.append("IMPORTANT: The nodejs-server generator has been deprecated.")
|
||||||
|
.append(System.lineSeparator())
|
||||||
.append("Currently, Node.js server doesn't work as its dependency doesn't support OpenAPI Spec3.")
|
.append("Currently, Node.js server doesn't work as its dependency doesn't support OpenAPI Spec3.")
|
||||||
.append(System.lineSeparator())
|
.append(System.lineSeparator())
|
||||||
.append("For further details, see https://github.com/OpenAPITools/openapi-generator/issues/34")
|
.append("For further details, see https://github.com/OpenAPITools/openapi-generator/issues/34")
|
||||||
|
@ -1 +1 @@
|
|||||||
3.0.0-SNAPSHOT
|
4.0.2-SNAPSHOT
|
File diff suppressed because it is too large
Load Diff
@ -16,8 +16,8 @@ module.exports.addPet = function addPet (req, res, next) {
|
|||||||
|
|
||||||
module.exports.deletePet = function deletePet (req, res, next) {
|
module.exports.deletePet = function deletePet (req, res, next) {
|
||||||
var petId = req.swagger.params['petId'].value;
|
var petId = req.swagger.params['petId'].value;
|
||||||
var api_key = req.swagger.params['api_key'].value;
|
var apiUnderscorekey = req.swagger.params['api_key'].value;
|
||||||
Pet.deletePet(petId,api_key)
|
Pet.deletePet(petId,apiUnderscorekey)
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
utils.writeJson(res, response);
|
utils.writeJson(res, response);
|
||||||
})
|
})
|
||||||
@ -39,7 +39,8 @@ module.exports.findPetsByStatus = function findPetsByStatus (req, res, next) {
|
|||||||
|
|
||||||
module.exports.findPetsByTags = function findPetsByTags (req, res, next) {
|
module.exports.findPetsByTags = function findPetsByTags (req, res, next) {
|
||||||
var tags = req.swagger.params['tags'].value;
|
var tags = req.swagger.params['tags'].value;
|
||||||
Pet.findPetsByTags(tags)
|
var maxCount = req.swagger.params['maxCount'].value;
|
||||||
|
Pet.findPetsByTags(tags,maxCount)
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
utils.writeJson(res, response);
|
utils.writeJson(res, response);
|
||||||
})
|
})
|
||||||
|
@ -18,10 +18,10 @@ exports.addPet = function(pet) {
|
|||||||
* Deletes a pet
|
* Deletes a pet
|
||||||
*
|
*
|
||||||
* petId Long Pet id to delete
|
* petId Long Pet id to delete
|
||||||
* api_key String (optional)
|
* apiUnderscorekey String (optional)
|
||||||
* no response value expected for this operation
|
* no response value expected for this operation
|
||||||
**/
|
**/
|
||||||
exports.deletePet = function(petId,api_key) {
|
exports.deletePet = function(petId,apiUnderscorekey) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
@ -69,9 +69,10 @@ exports.findPetsByStatus = function(status) {
|
|||||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
*
|
*
|
||||||
* tags List Tags to filter by
|
* tags List Tags to filter by
|
||||||
|
* maxCount Integer Maximum number of items to return (optional)
|
||||||
* returns List
|
* returns List
|
||||||
**/
|
**/
|
||||||
exports.findPetsByTags = function(tags) {
|
exports.findPetsByTags = function(tags,maxCount) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var examples = {};
|
var examples = {};
|
||||||
examples['application/json'] = {
|
examples['application/json'] = {
|
||||||
|
@ -1 +1 @@
|
|||||||
3.1.0-SNAPSHOT
|
4.0.2-SNAPSHOT
|
@ -1,11 +1,15 @@
|
|||||||
openapi: 3.0.1
|
openapi: 3.0.0
|
||||||
info:
|
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.
|
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:
|
license:
|
||||||
name: Apache-2.0
|
name: Apache-2.0
|
||||||
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
title: OpenAPI Petstore
|
title: OpenAPI Petstore
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
|
externalDocs:
|
||||||
|
description: Find out more about Swagger
|
||||||
|
url: http://swagger.io
|
||||||
servers:
|
servers:
|
||||||
- url: http://petstore.swagger.io/v2
|
- url: http://petstore.swagger.io/v2
|
||||||
tags:
|
tags:
|
||||||
@ -20,18 +24,9 @@ paths:
|
|||||||
post:
|
post:
|
||||||
operationId: addPet
|
operationId: addPet
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
$ref: '#/components/requestBodies/Pet'
|
||||||
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
|
|
||||||
responses:
|
responses:
|
||||||
405:
|
405:
|
||||||
content: {}
|
|
||||||
description: Invalid input
|
description: Invalid input
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
@ -44,24 +39,13 @@ paths:
|
|||||||
put:
|
put:
|
||||||
operationId: updatePet
|
operationId: updatePet
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
$ref: '#/components/requestBodies/Pet'
|
||||||
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
|
|
||||||
responses:
|
responses:
|
||||||
400:
|
400:
|
||||||
content: {}
|
|
||||||
description: Invalid ID supplied
|
description: Invalid ID supplied
|
||||||
404:
|
404:
|
||||||
content: {}
|
|
||||||
description: Pet not found
|
description: Pet not found
|
||||||
405:
|
405:
|
||||||
content: {}
|
|
||||||
description: Validation exception
|
description: Validation exception
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
@ -106,11 +90,9 @@ paths:
|
|||||||
type: array
|
type: array
|
||||||
description: successful operation
|
description: successful operation
|
||||||
400:
|
400:
|
||||||
content: {}
|
|
||||||
description: Invalid status value
|
description: Invalid status value
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- write:pets
|
|
||||||
- read:pets
|
- read:pets
|
||||||
summary: Finds Pets by status
|
summary: Finds Pets by status
|
||||||
tags:
|
tags:
|
||||||
@ -119,7 +101,8 @@ paths:
|
|||||||
/pet/findByTags:
|
/pet/findByTags:
|
||||||
get:
|
get:
|
||||||
deprecated: true
|
deprecated: true
|
||||||
description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
description: Multiple tags can be provided with comma separated strings. Use
|
||||||
|
tag1, tag2, tag3 for testing.
|
||||||
operationId: findPetsByTags
|
operationId: findPetsByTags
|
||||||
parameters:
|
parameters:
|
||||||
- description: Tags to filter by
|
- description: Tags to filter by
|
||||||
@ -132,6 +115,15 @@ paths:
|
|||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
style: form
|
style: form
|
||||||
|
- description: Maximum number of items to return
|
||||||
|
explode: true
|
||||||
|
in: query
|
||||||
|
name: maxCount
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
format: int32
|
||||||
|
type: integer
|
||||||
|
style: form
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
content:
|
content:
|
||||||
@ -147,11 +139,9 @@ paths:
|
|||||||
type: array
|
type: array
|
||||||
description: successful operation
|
description: successful operation
|
||||||
400:
|
400:
|
||||||
content: {}
|
|
||||||
description: Invalid tag value
|
description: Invalid tag value
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- write:pets
|
|
||||||
- read:pets
|
- read:pets
|
||||||
summary: Finds Pets by tags
|
summary: Finds Pets by tags
|
||||||
tags:
|
tags:
|
||||||
@ -161,20 +151,24 @@ paths:
|
|||||||
delete:
|
delete:
|
||||||
operationId: deletePet
|
operationId: deletePet
|
||||||
parameters:
|
parameters:
|
||||||
- in: header
|
- explode: false
|
||||||
|
in: header
|
||||||
name: api_key
|
name: api_key
|
||||||
|
required: false
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
style: simple
|
||||||
- description: Pet id to delete
|
- description: Pet id to delete
|
||||||
|
explode: false
|
||||||
in: path
|
in: path
|
||||||
name: petId
|
name: petId
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
format: int64
|
format: int64
|
||||||
type: integer
|
type: integer
|
||||||
|
style: simple
|
||||||
responses:
|
responses:
|
||||||
400:
|
400:
|
||||||
content: {}
|
|
||||||
description: Invalid pet value
|
description: Invalid pet value
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
@ -189,12 +183,14 @@ paths:
|
|||||||
operationId: getPetById
|
operationId: getPetById
|
||||||
parameters:
|
parameters:
|
||||||
- description: ID of pet to return
|
- description: ID of pet to return
|
||||||
|
explode: false
|
||||||
in: path
|
in: path
|
||||||
name: petId
|
name: petId
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
format: int64
|
format: int64
|
||||||
type: integer
|
type: integer
|
||||||
|
style: simple
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
content:
|
content:
|
||||||
@ -206,10 +202,8 @@ paths:
|
|||||||
$ref: '#/components/schemas/Pet'
|
$ref: '#/components/schemas/Pet'
|
||||||
description: successful operation
|
description: successful operation
|
||||||
400:
|
400:
|
||||||
content: {}
|
|
||||||
description: Invalid ID supplied
|
description: Invalid ID supplied
|
||||||
404:
|
404:
|
||||||
content: {}
|
|
||||||
description: Pet not found
|
description: Pet not found
|
||||||
security:
|
security:
|
||||||
- api_key: []
|
- api_key: []
|
||||||
@ -221,13 +215,16 @@ paths:
|
|||||||
operationId: updatePetWithForm
|
operationId: updatePetWithForm
|
||||||
parameters:
|
parameters:
|
||||||
- description: ID of pet that needs to be updated
|
- description: ID of pet that needs to be updated
|
||||||
|
explode: false
|
||||||
in: path
|
in: path
|
||||||
name: petId
|
name: petId
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
format: int64
|
format: int64
|
||||||
type: integer
|
type: integer
|
||||||
|
style: simple
|
||||||
requestBody:
|
requestBody:
|
||||||
|
$ref: '#/components/requestBodies/inline_object'
|
||||||
content:
|
content:
|
||||||
application/x-www-form-urlencoded:
|
application/x-www-form-urlencoded:
|
||||||
schema:
|
schema:
|
||||||
@ -238,9 +235,9 @@ paths:
|
|||||||
status:
|
status:
|
||||||
description: Updated status of the pet
|
description: Updated status of the pet
|
||||||
type: string
|
type: string
|
||||||
|
type: object
|
||||||
responses:
|
responses:
|
||||||
405:
|
405:
|
||||||
content: {}
|
|
||||||
description: Invalid input
|
description: Invalid input
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
@ -255,13 +252,16 @@ paths:
|
|||||||
operationId: uploadFile
|
operationId: uploadFile
|
||||||
parameters:
|
parameters:
|
||||||
- description: ID of pet to update
|
- description: ID of pet to update
|
||||||
|
explode: false
|
||||||
in: path
|
in: path
|
||||||
name: petId
|
name: petId
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
format: int64
|
format: int64
|
||||||
type: integer
|
type: integer
|
||||||
|
style: simple
|
||||||
requestBody:
|
requestBody:
|
||||||
|
$ref: '#/components/requestBodies/inline_object_1'
|
||||||
content:
|
content:
|
||||||
multipart/form-data:
|
multipart/form-data:
|
||||||
schema:
|
schema:
|
||||||
@ -273,6 +273,7 @@ paths:
|
|||||||
description: file to upload
|
description: file to upload
|
||||||
format: binary
|
format: binary
|
||||||
type: string
|
type: string
|
||||||
|
type: object
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
content:
|
content:
|
||||||
@ -313,7 +314,7 @@ paths:
|
|||||||
operationId: placeOrder
|
operationId: placeOrder
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
'*/*':
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Order'
|
$ref: '#/components/schemas/Order'
|
||||||
description: order placed for purchasing the pet
|
description: order placed for purchasing the pet
|
||||||
@ -329,7 +330,6 @@ paths:
|
|||||||
$ref: '#/components/schemas/Order'
|
$ref: '#/components/schemas/Order'
|
||||||
description: successful operation
|
description: successful operation
|
||||||
400:
|
400:
|
||||||
content: {}
|
|
||||||
description: Invalid Order
|
description: Invalid Order
|
||||||
summary: Place an order for a pet
|
summary: Place an order for a pet
|
||||||
tags:
|
tags:
|
||||||
@ -337,31 +337,34 @@ paths:
|
|||||||
x-swagger-router-controller: Store
|
x-swagger-router-controller: Store
|
||||||
/store/order/{orderId}:
|
/store/order/{orderId}:
|
||||||
delete:
|
delete:
|
||||||
description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
description: For valid response try integer IDs with value < 1000. Anything
|
||||||
|
above 1000 or nonintegers will generate API errors
|
||||||
operationId: deleteOrder
|
operationId: deleteOrder
|
||||||
parameters:
|
parameters:
|
||||||
- description: ID of the order that needs to be deleted
|
- description: ID of the order that needs to be deleted
|
||||||
|
explode: false
|
||||||
in: path
|
in: path
|
||||||
name: orderId
|
name: orderId
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
style: simple
|
||||||
responses:
|
responses:
|
||||||
400:
|
400:
|
||||||
content: {}
|
|
||||||
description: Invalid ID supplied
|
description: Invalid ID supplied
|
||||||
404:
|
404:
|
||||||
content: {}
|
|
||||||
description: Order not found
|
description: Order not found
|
||||||
summary: Delete purchase order by ID
|
summary: Delete purchase order by ID
|
||||||
tags:
|
tags:
|
||||||
- store
|
- store
|
||||||
x-swagger-router-controller: Store
|
x-swagger-router-controller: Store
|
||||||
get:
|
get:
|
||||||
description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
description: For valid response try integer IDs with value <= 5 or > 10. Other
|
||||||
|
values will generated exceptions
|
||||||
operationId: getOrderById
|
operationId: getOrderById
|
||||||
parameters:
|
parameters:
|
||||||
- description: ID of pet that needs to be fetched
|
- description: ID of pet that needs to be fetched
|
||||||
|
explode: false
|
||||||
in: path
|
in: path
|
||||||
name: orderId
|
name: orderId
|
||||||
required: true
|
required: true
|
||||||
@ -370,6 +373,7 @@ paths:
|
|||||||
maximum: 5
|
maximum: 5
|
||||||
minimum: 1
|
minimum: 1
|
||||||
type: integer
|
type: integer
|
||||||
|
style: simple
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
content:
|
content:
|
||||||
@ -381,10 +385,8 @@ paths:
|
|||||||
$ref: '#/components/schemas/Order'
|
$ref: '#/components/schemas/Order'
|
||||||
description: successful operation
|
description: successful operation
|
||||||
400:
|
400:
|
||||||
content: {}
|
|
||||||
description: Invalid ID supplied
|
description: Invalid ID supplied
|
||||||
404:
|
404:
|
||||||
content: {}
|
|
||||||
description: Order not found
|
description: Order not found
|
||||||
summary: Find purchase order by ID
|
summary: Find purchase order by ID
|
||||||
tags:
|
tags:
|
||||||
@ -396,15 +398,16 @@ paths:
|
|||||||
operationId: createUser
|
operationId: createUser
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
'*/*':
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/User'
|
$ref: '#/components/schemas/User'
|
||||||
description: Created user object
|
description: Created user object
|
||||||
required: true
|
required: true
|
||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
content: {}
|
|
||||||
description: successful operation
|
description: successful operation
|
||||||
|
security:
|
||||||
|
- auth_cookie: []
|
||||||
summary: Create user
|
summary: Create user
|
||||||
tags:
|
tags:
|
||||||
- user
|
- user
|
||||||
@ -413,18 +416,12 @@ paths:
|
|||||||
post:
|
post:
|
||||||
operationId: createUsersWithArrayInput
|
operationId: createUsersWithArrayInput
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
$ref: '#/components/requestBodies/UserArray'
|
||||||
'*/*':
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/User'
|
|
||||||
type: array
|
|
||||||
description: List of user object
|
|
||||||
required: true
|
|
||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
content: {}
|
|
||||||
description: successful operation
|
description: successful operation
|
||||||
|
security:
|
||||||
|
- auth_cookie: []
|
||||||
summary: Creates list of users with given input array
|
summary: Creates list of users with given input array
|
||||||
tags:
|
tags:
|
||||||
- user
|
- user
|
||||||
@ -433,18 +430,12 @@ paths:
|
|||||||
post:
|
post:
|
||||||
operationId: createUsersWithListInput
|
operationId: createUsersWithListInput
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
$ref: '#/components/requestBodies/UserArray'
|
||||||
'*/*':
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/User'
|
|
||||||
type: array
|
|
||||||
description: List of user object
|
|
||||||
required: true
|
|
||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
content: {}
|
|
||||||
description: successful operation
|
description: successful operation
|
||||||
|
security:
|
||||||
|
- auth_cookie: []
|
||||||
summary: Creates list of users with given input array
|
summary: Creates list of users with given input array
|
||||||
tags:
|
tags:
|
||||||
- user
|
- user
|
||||||
@ -454,17 +445,22 @@ paths:
|
|||||||
operationId: loginUser
|
operationId: loginUser
|
||||||
parameters:
|
parameters:
|
||||||
- description: The user name for login
|
- description: The user name for login
|
||||||
|
explode: true
|
||||||
in: query
|
in: query
|
||||||
name: username
|
name: username
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
|
pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$
|
||||||
type: string
|
type: string
|
||||||
|
style: form
|
||||||
- description: The password for login in clear text
|
- description: The password for login in clear text
|
||||||
|
explode: true
|
||||||
in: query
|
in: query
|
||||||
name: password
|
name: password
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
style: form
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
content:
|
content:
|
||||||
@ -476,18 +472,29 @@ paths:
|
|||||||
type: string
|
type: string
|
||||||
description: successful operation
|
description: successful operation
|
||||||
headers:
|
headers:
|
||||||
|
Set-Cookie:
|
||||||
|
description: Cookie authentication key for use with the `auth_cookie`
|
||||||
|
apiKey authentication.
|
||||||
|
explode: false
|
||||||
|
schema:
|
||||||
|
example: AUTH_KEY=abcde12345; Path=/; HttpOnly
|
||||||
|
type: string
|
||||||
|
style: simple
|
||||||
X-Rate-Limit:
|
X-Rate-Limit:
|
||||||
description: calls per hour allowed by the user
|
description: calls per hour allowed by the user
|
||||||
|
explode: false
|
||||||
schema:
|
schema:
|
||||||
format: int32
|
format: int32
|
||||||
type: integer
|
type: integer
|
||||||
|
style: simple
|
||||||
X-Expires-After:
|
X-Expires-After:
|
||||||
description: date in UTC when toekn expires
|
description: date in UTC when toekn expires
|
||||||
|
explode: false
|
||||||
schema:
|
schema:
|
||||||
format: date-time
|
format: date-time
|
||||||
type: string
|
type: string
|
||||||
|
style: simple
|
||||||
400:
|
400:
|
||||||
content: {}
|
|
||||||
description: Invalid username/password supplied
|
description: Invalid username/password supplied
|
||||||
summary: Logs user into the system
|
summary: Logs user into the system
|
||||||
tags:
|
tags:
|
||||||
@ -498,8 +505,9 @@ paths:
|
|||||||
operationId: logoutUser
|
operationId: logoutUser
|
||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
content: {}
|
|
||||||
description: successful operation
|
description: successful operation
|
||||||
|
security:
|
||||||
|
- auth_cookie: []
|
||||||
summary: Logs out current logged in user session
|
summary: Logs out current logged in user session
|
||||||
tags:
|
tags:
|
||||||
- user
|
- user
|
||||||
@ -510,18 +518,20 @@ paths:
|
|||||||
operationId: deleteUser
|
operationId: deleteUser
|
||||||
parameters:
|
parameters:
|
||||||
- description: The name that needs to be deleted
|
- description: The name that needs to be deleted
|
||||||
|
explode: false
|
||||||
in: path
|
in: path
|
||||||
name: username
|
name: username
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
style: simple
|
||||||
responses:
|
responses:
|
||||||
400:
|
400:
|
||||||
content: {}
|
|
||||||
description: Invalid username supplied
|
description: Invalid username supplied
|
||||||
404:
|
404:
|
||||||
content: {}
|
|
||||||
description: User not found
|
description: User not found
|
||||||
|
security:
|
||||||
|
- auth_cookie: []
|
||||||
summary: Delete user
|
summary: Delete user
|
||||||
tags:
|
tags:
|
||||||
- user
|
- user
|
||||||
@ -530,11 +540,13 @@ paths:
|
|||||||
operationId: getUserByName
|
operationId: getUserByName
|
||||||
parameters:
|
parameters:
|
||||||
- description: The name that needs to be fetched. Use user1 for testing.
|
- description: The name that needs to be fetched. Use user1 for testing.
|
||||||
|
explode: false
|
||||||
in: path
|
in: path
|
||||||
name: username
|
name: username
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
style: simple
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
content:
|
content:
|
||||||
@ -546,10 +558,8 @@ paths:
|
|||||||
$ref: '#/components/schemas/User'
|
$ref: '#/components/schemas/User'
|
||||||
description: successful operation
|
description: successful operation
|
||||||
400:
|
400:
|
||||||
content: {}
|
|
||||||
description: Invalid username supplied
|
description: Invalid username supplied
|
||||||
404:
|
404:
|
||||||
content: {}
|
|
||||||
description: User not found
|
description: User not found
|
||||||
summary: Get user by user name
|
summary: Get user by user name
|
||||||
tags:
|
tags:
|
||||||
@ -560,30 +570,62 @@ paths:
|
|||||||
operationId: updateUser
|
operationId: updateUser
|
||||||
parameters:
|
parameters:
|
||||||
- description: name that need to be deleted
|
- description: name that need to be deleted
|
||||||
|
explode: false
|
||||||
in: path
|
in: path
|
||||||
name: username
|
name: username
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
style: simple
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
'*/*':
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/User'
|
$ref: '#/components/schemas/User'
|
||||||
description: Updated user object
|
description: Updated user object
|
||||||
required: true
|
required: true
|
||||||
responses:
|
responses:
|
||||||
400:
|
400:
|
||||||
content: {}
|
|
||||||
description: Invalid user supplied
|
description: Invalid user supplied
|
||||||
404:
|
404:
|
||||||
content: {}
|
|
||||||
description: User not found
|
description: User not found
|
||||||
|
security:
|
||||||
|
- auth_cookie: []
|
||||||
summary: Updated user
|
summary: Updated user
|
||||||
tags:
|
tags:
|
||||||
- user
|
- user
|
||||||
x-swagger-router-controller: User
|
x-swagger-router-controller: User
|
||||||
components:
|
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
|
||||||
|
inline_object:
|
||||||
|
content:
|
||||||
|
application/x-www-form-urlencoded:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/inline_object'
|
||||||
|
inline_object_1:
|
||||||
|
content:
|
||||||
|
multipart/form-data:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/inline_object_1'
|
||||||
schemas:
|
schemas:
|
||||||
Order:
|
Order:
|
||||||
description: An order for a pets from the pet store
|
description: An order for a pets from the pet store
|
||||||
@ -631,6 +673,7 @@ components:
|
|||||||
format: int64
|
format: int64
|
||||||
type: integer
|
type: integer
|
||||||
name:
|
name:
|
||||||
|
pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$
|
||||||
type: string
|
type: string
|
||||||
title: Pet category
|
title: Pet category
|
||||||
type: object
|
type: object
|
||||||
@ -756,6 +799,25 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
title: An uploaded response
|
title: An uploaded response
|
||||||
type: object
|
type: object
|
||||||
|
inline_object:
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
description: Updated name of the pet
|
||||||
|
type: string
|
||||||
|
status:
|
||||||
|
description: Updated status of the pet
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
inline_object_1:
|
||||||
|
properties:
|
||||||
|
additionalMetadata:
|
||||||
|
description: Additional data to pass to server
|
||||||
|
type: string
|
||||||
|
file:
|
||||||
|
description: file to upload
|
||||||
|
format: binary
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
securitySchemes:
|
securitySchemes:
|
||||||
petstore_auth:
|
petstore_auth:
|
||||||
flows:
|
flows:
|
||||||
@ -769,3 +831,7 @@ components:
|
|||||||
in: header
|
in: header
|
||||||
name: api_key
|
name: api_key
|
||||||
type: apiKey
|
type: apiKey
|
||||||
|
auth_cookie:
|
||||||
|
in: cookie
|
||||||
|
name: AUTH_KEY
|
||||||
|
type: apiKey
|
||||||
|
@ -16,8 +16,8 @@ module.exports.addPet = function addPet (req, res, next) {
|
|||||||
|
|
||||||
module.exports.deletePet = function deletePet (req, res, next) {
|
module.exports.deletePet = function deletePet (req, res, next) {
|
||||||
var petId = req.swagger.params['petId'].value;
|
var petId = req.swagger.params['petId'].value;
|
||||||
var api_key = req.swagger.params['api_key'].value;
|
var apiUnderscorekey = req.swagger.params['api_key'].value;
|
||||||
Pet.deletePet(petId,api_key)
|
Pet.deletePet(petId,apiUnderscorekey)
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
utils.writeJson(res, response);
|
utils.writeJson(res, response);
|
||||||
})
|
})
|
||||||
@ -39,7 +39,8 @@ module.exports.findPetsByStatus = function findPetsByStatus (req, res, next) {
|
|||||||
|
|
||||||
module.exports.findPetsByTags = function findPetsByTags (req, res, next) {
|
module.exports.findPetsByTags = function findPetsByTags (req, res, next) {
|
||||||
var tags = req.swagger.params['tags'].value;
|
var tags = req.swagger.params['tags'].value;
|
||||||
Pet.findPetsByTags(tags)
|
var maxCount = req.swagger.params['maxCount'].value;
|
||||||
|
Pet.findPetsByTags(tags,maxCount)
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
utils.writeJson(res, response);
|
utils.writeJson(res, response);
|
||||||
})
|
})
|
||||||
|
@ -18,10 +18,10 @@ exports.addPet = function(pet) {
|
|||||||
* Deletes a pet
|
* Deletes a pet
|
||||||
*
|
*
|
||||||
* petId Long Pet id to delete
|
* petId Long Pet id to delete
|
||||||
* api_key String (optional)
|
* apiUnderscorekey String (optional)
|
||||||
* no response value expected for this operation
|
* no response value expected for this operation
|
||||||
**/
|
**/
|
||||||
exports.deletePet = function(petId,api_key) {
|
exports.deletePet = function(petId,apiUnderscorekey) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
@ -69,9 +69,10 @@ exports.findPetsByStatus = function(status) {
|
|||||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
*
|
*
|
||||||
* tags List Tags to filter by
|
* tags List Tags to filter by
|
||||||
|
* maxCount Integer Maximum number of items to return (optional)
|
||||||
* returns List
|
* returns List
|
||||||
**/
|
**/
|
||||||
exports.findPetsByTags = function(tags) {
|
exports.findPetsByTags = function(tags,maxCount) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var examples = {};
|
var examples = {};
|
||||||
examples['application/json'] = {
|
examples['application/json'] = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user