diff --git a/bin/objc-petstore-coredata.sh b/bin/objc-petstore-coredata.sh index 1ca38f1c89b..ca16ae9f868 100755 --- a/bin/objc-petstore-coredata.sh +++ b/bin/objc-petstore-coredata.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/openapi-generator/src/main/resources/objc -i modules/openapi-generator/src/test/resources/2_0/petstore.json -l objc -D apiDocs=false -D modelDocs=false -o samples/client/petstore/objc/core-data --additional-properties coreData=true -D appName=PetstoreClient" +ags="$@ generate -t modules/openapi-generator/src/main/resources/objc -i modules/openapi-generator/src/test/resources/2_0/petstore.json -l objc -D apiDocs=false -D modelDocs=false -o samples/client/petstore/objc/core-data --additional-properties coreData=true -c bin/objc-petstore.json" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/objc-petstore.json b/bin/objc-petstore.json new file mode 100644 index 00000000000..9cbfa58d39c --- /dev/null +++ b/bin/objc-petstore.json @@ -0,0 +1,4 @@ +{ + "classPrefix": "SWG", + "podName": "SwaggerClient" +} diff --git a/bin/objc-petstore.sh b/bin/objc-petstore.sh index e04fe111471..876f2cd15a5 100755 --- a/bin/objc-petstore.sh +++ b/bin/objc-petstore.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/objc -i modules/openapi-generator/src/test/resources/2_0/petstore.json -l objc -o samples/client/petstore/objc/default -D appName=PetstoreClient $@" +ags="generate -t modules/openapi-generator/src/main/resources/objc -i modules/openapi-generator/src/test/resources/2_0/petstore.json -l objc -o samples/client/petstore/objc/default -c ./bin/objc-petstore.json $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/android-petstore-all.sh b/bin/openapi3/android-petstore-all.sh new file mode 100755 index 00000000000..c01f0997041 --- /dev/null +++ b/bin/openapi3/android-petstore-all.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +./bin/openapi3/android-petstore-httpclient.sh +./bin/openapi3/android-petstore-volley.sh + diff --git a/bin/openapi3/python-flask-petstore-python2.sh b/bin/openapi3/python-flask-petstore-python2.sh new file mode 100755 index 00000000000..e7e2435703d --- /dev/null +++ b/bin/openapi3/python-flask-petstore-python2.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +#ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l python-flask -o samples/server/petstore/flaskConnexion-python2 -DsupportPython2=true" +ags="$@ generate -t modules/openapi-generator/src/main/resources/flaskConnexion -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l python-flask -o samples/server/petstore/flaskConnexion-python2 -c bin/supportPython2.json -D service" + +rm -rf samples/server/petstore/flaskConnexion-python2/* +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/python-flask-petstore.sh b/bin/openapi3/python-flask-petstore.sh new file mode 100755 index 00000000000..a1d4ef69d32 --- /dev/null +++ b/bin/openapi3/python-flask-petstore.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -t modules/openapi-generator/src/main/resources/flaskConnexion -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l python-flask -o samples/server/petstore/flaskConnexion -Dservice $@" + +rm -rf samples/server/petstore/flaskConnexion/* +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 80e25e5a8e7..688c0389fcc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -4240,7 +4240,6 @@ public class DefaultCodegen implements CodegenConfig { codegenParameter.paramName = toParamName(codegenParameter.baseName); codegenParameter.items = codegenProperty.items; codegenParameter.dataType = getTypeDeclaration(schema); - LOGGER.info("debugging inline map: " + codegenParameter.dataType); codegenParameter.baseType = getSchemaType(inner); codegenParameter.isContainer = Boolean.TRUE; codegenParameter.isMapContainer = Boolean.TRUE; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java index be08b75624c..65674eaf39c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AndroidClientCodegen.java @@ -289,7 +289,8 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi if (p.defaultValue == null) { example = p.example; } else { - example = p.defaultValue; + p.example = p.defaultValue; + return; } String type = p.baseType; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java index 12c44b9dc3f..ef112f047f4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/BashClientCodegen.java @@ -691,7 +691,8 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig { if (p.defaultValue == null) { example = p.example; } else { - example = p.defaultValue; + p.example = p.defaultValue; + return; } String type = p.baseType; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSServerCodegen.java index 01fadae9c06..1cdbd6d8eb9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSServerCodegen.java @@ -393,8 +393,8 @@ public class NodeJSServerCodegen extends DefaultCodegen implements CodegenConfig operation.setOperationId(getOrGenerateOperationId(operation, pathname, method.toString())); } if (operation.getExtensions() == null || - operation.getExtensions().get("x-openapi-router-controller") == null) { - operation.addExtension("x-openapi-router-controller", sanitizeTag(tag)); + operation.getExtensions().get("x-swagger-router-controller") == null) { + operation.addExtension("x-swagger-router-controller", sanitizeTag(tag)); } } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java index 07ed71eca93..1e770b061b8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ObjcClientCodegen.java @@ -56,7 +56,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { protected Set foundationClasses = new HashSet(); protected String podName = "OpenAPIClient"; protected String podVersion = "1.0.0"; - protected String classPrefix = "SWG"; + protected String classPrefix = "OAI"; protected String authorName = "OpenAPI"; protected String authorEmail = "team@openapitools.org"; protected String license = DEFAULT_LICENSE; @@ -141,7 +141,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { typeMapping.put("List", "NSArray"); typeMapping.put("object", "NSObject"); typeMapping.put("file", "NSURL"); - typeMapping.put("binary", "NSData"); + typeMapping.put("binary", "NSURL"); typeMapping.put("bytearray", "NSData"); typeMapping.put("byte", "NSData"); typeMapping.put("uuid", "NSString"); @@ -189,7 +189,7 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { cliOptions.clear(); cliOptions.add(new CliOption(CORE_DATA, "Should generate core data models").defaultValue("false")); cliOptions.add(new CliOption(CLASS_PREFIX, "prefix for generated classes (convention: Abbreviation of pod name e.g. `HN` for `HackerNews`).`") - .defaultValue("SWG")); + .defaultValue("OAI")); cliOptions.add(new CliOption(POD_NAME, "cocoapods package name (convention: CameCase).") .defaultValue("OpenAPIClient")); cliOptions.add(new CliOption(CodegenConstants.POD_VERSION, "cocoapods package version.") @@ -698,7 +698,8 @@ public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig { if (p.defaultValue == null) { example = p.example; } else { - example = p.defaultValue; + p.example = p.defaultValue; + return; } String type = p.baseType; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java index 29b2bbd985f..70995b8f2f2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java @@ -400,7 +400,8 @@ public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig { if (p.defaultValue == null) { example = p.example; } else { - example = p.defaultValue; + p.example = p.defaultValue; + return; } String type = p.baseType; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java index ed808c6459e..f14a93804bc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java @@ -330,7 +330,7 @@ public class PythonFlaskConnexionServerCodegen extends DefaultCodegen implements operationId = getOrGenerateOperationId(operation, pathname, method.toString()); } operation.setOperationId(toOperationId(operationId)); - if (operation.getExtensions().get("x-openapi-router-controller") == null) { + if (operation.getExtensions() == null || operation.getExtensions().get("x-openapi-router-controller") == null) { operation.addExtension( "x-openapi-router-controller", controllerPackage + "." + toApiFilename(tag) @@ -526,7 +526,8 @@ public class PythonFlaskConnexionServerCodegen extends DefaultCodegen implements if (p.defaultValue == null) { example = p.example; } else { - example = p.defaultValue; + p.example = p.defaultValue; + return; } String type = p.baseType; diff --git a/modules/openapi-generator/src/main/resources/bash/README.md b/modules/openapi-generator/src/main/resources/bash/README.md deleted file mode 100644 index 906e237b246..00000000000 --- a/modules/openapi-generator/src/main/resources/bash/README.md +++ /dev/null @@ -1,221 +0,0 @@ -# Bash script generator for Swagger Codegen - -## Overview -This is a Bash client script codegen. - -The codegen creates a standalone, single-file Bash script client to quickly test and access Swagger annotated REST services. The generated script uses underneath [cURL](https://curl.haxx.se) to make actual REST calls. - -The generated Bash script has only 2 dependencies: -- Bash (>= 4.3) -- cURL - -## Features -- Fully automatic generation of a client Bash script to access any Swagger-defined REST service -- Generation of Bash and Zsh completion scripts -- All valid cURL options can be passed directly -- Preview of cURL commands to execute each operation using `--dry-run` option -- Complete help for entire service as well as for each operation -- No external dependencies besides Bash and cURL - -## Usage - -### Generating Bash client for REST service - -Get the sources: -```shell -$ git clone https://github.com/swagger-api/swagger-codegen -``` - -Build the codegen: -```shell -$ mvn package -``` - -Define custom codegen properties in a Json file, e.g.: -```shell -{ - "processMarkdown": true, - "curlOptions": "-sS --tlsv1.2", - "scriptName": "petstore-cli", - "generateBashCompletion": true, - "generateZshCompletion": true, - "hostEnvironmentVariable": "PETSTORE_HOST", - "basicAuthEnvironmentVariable": "PETSTORE_BASIC_AUTH", - "apiKeyAuthEnvironmentVariable": "PETSTORE_API_KEY" -} -``` - -Generate the client: -```shell -$ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l bash -o generated/bash/petstore -c modules/openapi-generator/src/test/resources/2_0/bash-config.json - -$ chmod +x generated/bash/petstore/petstore-cli -``` - -Enjoy: -```shell -$ cd generated/bash/petstore -$ ./petstore-cli -h - -Swagger Petstore command line client (API version 1.0.0) - -Usage - - petstore-cli [-h|--help] [-V|--version] [--about] [] - [-ac|--accept ] [-ct,--content-type ] - [--host ] [--dry-run] [-h|--help] [] - [] [] - - - - endpoint of the REST service without basepath - Can also be specified in PETSTORE_HOST environment variable. - - - any valid cURL options can be passed before - - - either full mime-type or one of supported abbreviations: - (text, html, md, csv, css, rtf, json, xml, yaml, js, bin, - rdf, jpg, png, gif, bmp, tiff) - - - HTTP headers can be passed in the form HEADER:VALUE - - - REST operation parameters can be passed in the following - forms: - * KEY=VALUE - path or query parameters - - - simple JSON body content (first level only) can be build - using the following arguments: - * KEY==VALUE - body parameters which will be added to body - JSON as '{ ..., "KEY": "VALUE", ... }' - * KEY:=VALUE - body parameters which will be added to body - JSON as '{ ..., "KEY": VALUE, ... }' - -Authentication methods - - - Api-key - add 'api_key:' after - or export PETSTORE_API_KEY='' - - OAuth2 (flow: implicit) - Authorization URL: - * http://petstore.swagger.io/oauth/dialog - Scopes: - * write:pets - modify pets in your account - * read:pets - read your pets - -Operations (grouped by tags) - -[pet] - addPet Add a new pet to the store - deletePet Deletes a pet - findPetsByStatus Finds Pets by status - findPetsByTags Finds Pets by tags - getPetById Find pet by ID - updatePet Update an existing pet - updatePetWithForm Updates a pet in the store with form data - uploadFile uploads an image - -[store] - deleteOrder Delete purchase order by ID - getInventory Returns pet inventories by status - getOrderById Find purchase order by ID - placeOrder Place an order for a pet - -[user] - createUser Create user - createUsersWithArrayInput Creates list of users with given input array - createUsersWithListInput Creates list of users with given input array - deleteUser Delete user - getUserByName Get user by user name - loginUser Logs user into the system - logoutUser Logs out current logged in user session - updateUser Updated user - -Options - -h,--help Print this help - -V,--version Print API version - --about Print the information about service - --host Specify the host URL - (e.g. 'https://petstore.swagger.io') - --force Force command invocation in spite of missing - required parameters or wrong content type - --dry-run Print out the cURL command without - executing it - -ac,--accept Set the 'Accept' header in the request - -ct,--content-type Set the 'Content-type' header in - the request -``` - -Client generator takes several specific configuration options: -* *processMarkdown* - [boolean] if set to `true`, all text (descriptions) in the Swagger specification will be treated as Markdown and converted to terminal formatting commands, -* *curlOptions* - [string] a list of default cURL options that will be added to each command -* *scriptName* - [string] the name of the target script, necessary when building Bash completion script -* *generateBashCompletion* - [boolean] if set to `true` the Bash completion script will be generated -* *generateZshCompletion* - [boolean] if set to `true` the Bash completion script will be generated -* *hostEnvironmentVariable* - [string] the name of environment variable to search for default host -* *basicAuthEnvironmentVariable* - [string] the name of environment variable to search for default basic auth credentials -* *apiKeyAuthEnvironmentVariable* - [string] the name of environment variable to search for default api key - -These options can be specified in a Json file used when running the codegen using option `-c` (see [example](resources/example-config.json)). - -### Using the generated Bash script - -```shell -# Print the list of operations available on the service -$ petstore-cli --help - -# Print the service description -$ petstore-cli --about - -# Print detailed information about specific operation -$ petstore-cli addPet --help - -# Call REST API operation -$ echo '{"id":891,"name":"lucky","status":"available"}' | petstore-cli --host http://petstore.swagger.io --content-type json addPet - - -{"id":891,"name":"lucky","photoUrls":[],"tags":[],"status":"available"} - -# The above is equivalent to -$ petstore-cli --host http://petstore.swagger.io --content-type json --accept xml addPet id:=891 name==lucky status==available - -891luckyavailable - - -# Preview the cURL command without actually executing it -# The above is equivalent to -$ petstore-cli --host http://petstore.swagger.io --content-type json --dry-run addPet id:=891 name==lucky status==available - -curl -sS --tlsv1.2 -H 'Content-type: application/json' -X POST -d '{"name": "lucky", "status": "available", "id": 891}' "http://petstore.swagger.io/v2/pet" -``` - -## Shell completion - -### Bash -The generated bash-completion script can be either directly loaded to the current Bash session using: - -```shell -source output/petstore-cli.bash-completion -``` - -Alternatively, the script can be copied to the `/etc/bash-completion.d` (or on OSX with Homebrew to `/usr/local/etc/bash-completion.d`): - -```shell -sudo cp output/petstore-cli.bash-completion /etc/bash-completion.d/petstore-cli -``` - -#### OS X -On OSX you might need to install bash-completion using Homebrew: -```shell -brew install bash-completion -``` -and add the following to the `~/.bashrc`: - -```shell -if [ -f $(brew --prefix)/etc/bash_completion ]; then - . $(brew --prefix)/etc/bash_completion -fi -``` - -### Zsh -In Zsh, the generated `_{{scriptName}}` file (e.g. _petstore-cli) must be copied to one of the folders under `$fpath` variable. - - -## TODO -- [ ] Add enum values for parameters shell completion -- [ ] Wrap handling of errors returned by the service, using comments defined in the Swagger specification -- [ ] Improve `--help` and `--about` formatting -- [ ] Add support to bash 4.0-4.2 (currently must be >= 4.3) -- [ ] Add manpage generation -- [ ] Add support for form data -- [ ] Move todos to Github issues diff --git a/modules/openapi-generator/src/main/resources/bash/client.mustache b/modules/openapi-generator/src/main/resources/bash/client.mustache index 3ff6f4051dc..e59d63b3f77 100644 --- a/modules/openapi-generator/src/main/resources/bash/client.mustache +++ b/modules/openapi-generator/src/main/resources/bash/client.mustache @@ -532,7 +532,7 @@ build_request_path() { print_help() { cat <${OFF}\\t\\t\\t\\tSpecify the host URL " -{{#swagger}} +{{#openAPI}} {{#host}}echo -e " \\t\\t\\t\\t(e.g. 'https://{{host}}')"{{/host}} {{^host}}echo -e " \\t\\t\\t\\t(e.g. 'https://127.0.0.1:8080')"{{/host}} -{{/swagger}} +{{/openAPI}} echo -e " --force\\t\\t\\t\\tForce command invocation in spite of missing" echo -e " \\t\\t\\t\\trequired parameters or wrong content type" echo -e " --dry-run\\t\\t\\t\\tPrint out the cURL command without" @@ -634,10 +634,10 @@ echo " $ops" | column -t -s ';' ############################################################################## print_about() { echo "" - echo -e "${BOLD}${WHITE}{{appName}} command line client (API version {{#swagger}}{{#info}}{{version}}{{/info}}{{/swagger}})${OFF}" + echo -e "${BOLD}${WHITE}{{appName}} command line client (API version {{#openAPI}}{{#info}}{{version}}{{/info}}{{/openAPI}})${OFF}" echo "" - echo -e "License: {{#swagger}}{{#info}}{{#license}}{{name}}{{/license}}{{/info}}{{/swagger}}" - echo -e "Contact: {{#swagger}}{{#info}}{{#contact}}{{email}}{{/contact}}{{/info}}{{/swagger}}" + echo -e "License: {{#openAPI}}{{#info}}{{#license}}{{name}}{{/license}}{{/info}}{{/openAPI}}" + echo -e "Contact: {{#openAPI}}{{#info}}{{#contact}}{{email}}{{/contact}}{{/info}}{{/openAPI}}" echo "" read -r -d '' appdescription <mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -44,8 +44,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); diff --git a/modules/openapi-generator/src/main/resources/perl/README.mustache b/modules/openapi-generator/src/main/resources/perl/README.mustache index 8484222a80b..33151399857 100644 --- a/modules/openapi-generator/src/main/resources/perl/README.mustache +++ b/modules/openapi-generator/src/main/resources/perl/README.mustache @@ -180,7 +180,7 @@ Your library files will be built under `WWW::MyProjectName`. $ cd openapi-generator $ mvn package $ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \ - -i [URL or file path to JSON swagger API spec] \ + -i [URL or file path to JSON OpenAPI API spec] \ -l perl \ -c /path/to/config/file.json \ -o /path/to/output/folder @@ -210,7 +210,7 @@ namespace is used if you don't supply your own class. # DOCUMENTATION FROM THE OpenAPI Spec -Additional documentation for each class and method may be provided by the Swagger +Additional documentation for each class and method may be provided by the OpenAPI spec. If so, this is available via the `class_documentation()` and `method_documentation()` methods on each generated object class, and the `method_documentation()` method on the endpoint API classes: diff --git a/modules/openapi-generator/src/main/resources/perl/Role.mustache b/modules/openapi-generator/src/main/resources/perl/Role.mustache index e5a8004339d..cee0a7d9038 100644 --- a/modules/openapi-generator/src/main/resources/perl/Role.mustache +++ b/modules/openapi-generator/src/main/resources/perl/Role.mustache @@ -286,7 +286,7 @@ Your library files will be built under C. $ cd openapi-generator $ mvn package $ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \ - -i [URL or file path to JSON swagger API spec] \ + -i [URL or file path to JSON OpenAPI API spec] \ -l perl \ -c /path/to/config/file.json \ -o /path/to/output/folder @@ -315,7 +315,7 @@ namespace is used if you don't supply your own class. =head1 DOCUMENTATION FROM THE OpenAPI Spec -Additional documentation for each class and method may be provided by the Swagger +Additional documentation for each class and method may be provided by the OpenAPI spec. If so, this is available via the C and C methods on each generated object class, and the C method on the endpoint API classes: diff --git a/modules/openapi-generator/src/main/resources/perl/object.mustache b/modules/openapi-generator/src/main/resources/perl/object.mustache index 71942b61b04..0f57d1dc2f0 100644 --- a/modules/openapi-generator/src/main/resources/perl/object.mustache +++ b/modules/openapi-generator/src/main/resources/perl/object.mustache @@ -52,7 +52,7 @@ __PACKAGE__->method_documentation({ {{/vars}} }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { {{#vars}}'{{name}}' => '{{{datatype}}}'{{#hasMore}}, {{/hasMore}}{{/vars}} } ); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/objc/ObjcModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/objc/ObjcModelTest.java index a06d1f00182..6b77d9bf3ff 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/objc/ObjcModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/objc/ObjcModelTest.java @@ -51,7 +51,7 @@ public class ObjcModelTest { final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "SWGSample"); + Assert.assertEquals(cm.classname, "OAISample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 1); @@ -79,7 +79,7 @@ public class ObjcModelTest { final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "SWGSample"); + Assert.assertEquals(cm.classname, "OAISample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 3); Assert.assertEquals(cm.discriminator.getMapping().get("test"),"test"); @@ -129,7 +129,7 @@ public class ObjcModelTest { final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "SWGSample"); + Assert.assertEquals(cm.classname, "OAISample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 2); @@ -168,7 +168,7 @@ public class ObjcModelTest { final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "SWGSample"); + Assert.assertEquals(cm.classname, "OAISample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 1); @@ -193,15 +193,15 @@ public class ObjcModelTest { final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "SWGSample"); + Assert.assertEquals(cm.classname, "OAISample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 1); final CodegenProperty property1 = cm.vars.get(0); Assert.assertEquals(property1.baseName, "children"); - Assert.assertEquals(property1.datatype, "SWGChildren*"); + Assert.assertEquals(property1.datatype, "OAIChildren*"); Assert.assertEquals(property1.name, "children"); - Assert.assertEquals(property1.baseType, "SWGChildren"); + Assert.assertEquals(property1.baseType, "OAIChildren"); Assert.assertFalse(property1.required); Assert.assertTrue(property1.isNotContainer); } @@ -216,14 +216,14 @@ public class ObjcModelTest { final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "SWGSample"); + Assert.assertEquals(cm.classname, "OAISample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 1); final CodegenProperty property1 = cm.vars.get(0); Assert.assertEquals(property1.baseName, "children"); - Assert.assertEquals(property1.complexType, "SWGChildren"); - Assert.assertEquals(property1.datatype, "NSArray*"); + Assert.assertEquals(property1.complexType, "OAIChildren"); + Assert.assertEquals(property1.datatype, "NSArray*"); Assert.assertEquals(property1.name, "children"); Assert.assertEquals(property1.baseType, "NSArray"); Assert.assertEquals(property1.containerType, "array"); @@ -241,15 +241,15 @@ public class ObjcModelTest { final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "SWGSample"); + Assert.assertEquals(cm.classname, "OAISample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 1); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("SWGChildren")).size(), 1); + Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("OAIChildren")).size(), 1); final CodegenProperty property1 = cm.vars.get(0); Assert.assertEquals(property1.baseName, "children"); - Assert.assertEquals(property1.complexType, "SWGChildren"); - Assert.assertEquals(property1.datatype, "NSDictionary*"); + Assert.assertEquals(property1.complexType, "OAIChildren"); + Assert.assertEquals(property1.datatype, "NSDictionary*"); Assert.assertEquals(property1.name, "children"); Assert.assertEquals(property1.baseType, "NSDictionary"); Assert.assertEquals(property1.containerType, "map"); @@ -267,12 +267,12 @@ public class ObjcModelTest { final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "SWGSample"); + Assert.assertEquals(cm.classname, "OAISample"); Assert.assertEquals(cm.description, "an array model"); Assert.assertEquals(cm.vars.size(), 0); Assert.assertEquals(cm.parent, "NSMutableArray"); Assert.assertEquals(cm.imports.size(), 1); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("SWGChildren")).size(), 1); + Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("OAIChildren")).size(), 1); } @Test(description = "convert an map model") @@ -284,12 +284,12 @@ public class ObjcModelTest { final CodegenModel cm = codegen.fromModel("map_model", model); Assert.assertEquals(cm.name, "map_model"); - Assert.assertEquals(cm.classname, "SWGMapModel"); + Assert.assertEquals(cm.classname, "OAIMapModel"); Assert.assertEquals(cm.description, "a map model for testing ObjC generator"); Assert.assertEquals(cm.vars.size(), 0); Assert.assertEquals(cm.parent, "NSMutableDictionary"); Assert.assertEquals(cm.imports.size(), 1); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("SWGChildren")).size(), 1); + Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("OAIChildren")).size(), 1); } @Test(description = "test udid") @@ -325,7 +325,7 @@ public class ObjcModelTest { final CodegenModel codegenModel = codegen.fromModel("AnimalFarm",definition); Assert.assertEquals(codegenModel.isArrayModel, true); - Assert.assertEquals(codegenModel.arrayModelType,"SWGAnimal"); + Assert.assertEquals(codegenModel.arrayModelType,"OAIAnimal"); } @@ -355,7 +355,7 @@ public class ObjcModelTest { final CodegenOperation animalCo = codegen.fromOperation("/animals", "POST", animalOps.getPost(), model.getComponents().getSchemas()); Assert.assertEquals(animalCo.imports.size(), 1); - Assert.assertTrue(animalCo.imports.contains("SWGAnimal")); + Assert.assertTrue(animalCo.imports.contains("OAIAnimal")); final Map insectPaths = model.getPaths(); final PathItem insectOps = insectPaths.get("/insects"); @@ -363,6 +363,6 @@ public class ObjcModelTest { final CodegenOperation insectCo = codegen.fromOperation("/insects", "POST", insectOps.getPost(), model.getComponents().getSchemas()); Assert.assertEquals(insectCo.imports.size(), 1); - Assert.assertTrue(insectCo.imports.contains("SWGInsect")); + Assert.assertTrue(insectCo.imports.contains("OAIInsect")); } } diff --git a/samples/client/petstore/objc/core-data/SwaggerClient.podspec b/samples/client/petstore/objc/core-data/SwaggerClient.podspec index 717d576a923..f4f4390578e 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient.podspec +++ b/samples/client/petstore/objc/core-data/SwaggerClient.podspec @@ -24,7 +24,7 @@ Pod::Spec.new do |s| s.homepage = "https://github.com/openapitools/openapi-generator" s.license = "Proprietary" s.source = { :git => "https://github.com/openapitools/openapi-generator.git", :tag => "#{s.version}" } - s.author = { "Swagger" => "team@openapitools.org" } + s.author = { "OpenAPI" => "team@openapitools.org" } s.source_files = 'SwaggerClient/**/*.{m,h}' s.public_header_files = 'SwaggerClient/**/*.h' diff --git a/samples/client/petstore/objc/default/OpenAPIClient.podspec b/samples/client/petstore/objc/default/OpenAPIClient.podspec new file mode 100644 index 00000000000..36156fa1484 --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient.podspec @@ -0,0 +1,37 @@ +# +# Be sure to run `pod lib lint OpenAPIClient.podspec' to ensure this is a +# valid spec and remove all comments before submitting the spec. +# +# Any lines starting with a # are optional, but encouraged +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# + +Pod::Spec.new do |s| + s.name = "OpenAPIClient" + s.version = "1.0.0" + + s.summary = "OpenAPI Petstore" + s.description = <<-DESC + This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters + DESC + + s.platform = :ios, '7.0' + s.requires_arc = true + + s.framework = 'SystemConfiguration' + + s.homepage = "https://github.com/openapitools/openapi-generator" + s.license = "Proprietary" + s.source = { :git => "https://github.com/openapitools/openapi-generator.git", :tag => "#{s.version}" } + s.author = { "OpenAPI" => "team@openapitools.org" } + + s.source_files = 'OpenAPIClient/**/*.{m,h}' + s.public_header_files = 'OpenAPIClient/**/*.h' + + + s.dependency 'AFNetworking', '~> 3' + s.dependency 'JSONModel', '~> 1.2' + s.dependency 'ISO8601', '~> 0.6' +end + diff --git a/samples/client/petstore/objc/default/SwaggerClient.podspec b/samples/client/petstore/objc/default/SwaggerClient.podspec index 9d7e506b005..f00eda35f71 100644 --- a/samples/client/petstore/objc/default/SwaggerClient.podspec +++ b/samples/client/petstore/objc/default/SwaggerClient.podspec @@ -24,7 +24,7 @@ Pod::Spec.new do |s| s.homepage = "https://github.com/openapitools/openapi-generator" s.license = "Proprietary" s.source = { :git => "https://github.com/openapitools/openapi-generator.git", :tag => "#{s.version}" } - s.author = { "Swagger" => "team@openapitools.org" } + s.author = { "OpenAPI" => "team@openapitools.org" } s.source_files = 'SwaggerClient/**/*.{m,h}' s.public_header_files = 'SwaggerClient/**/*.h' diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 04b1fadf4e2..af3c4267b12 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -174,7 +174,7 @@ Your library files will be built under `WWW::MyProjectName`. $ cd openapi-generator $ mvn package $ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \ - -i [URL or file path to JSON swagger API spec] \ + -i [URL or file path to JSON OpenAPI API spec] \ -l perl \ -c /path/to/config/file.json \ -o /path/to/output/folder @@ -204,7 +204,7 @@ namespace is used if you don't supply your own class. # DOCUMENTATION FROM THE OpenAPI Spec -Additional documentation for each class and method may be provided by the Swagger +Additional documentation for each class and method may be provided by the OpenAPI spec. If so, this is available via the `class_documentation()` and `method_documentation()` methods on each generated object class, and the `method_documentation()` method on the endpoint API classes: diff --git a/samples/client/petstore/perl/docs/FakeApi.md b/samples/client/petstore/perl/docs/FakeApi.md index 09201877899..57f57988424 100644 --- a/samples/client/petstore/perl/docs/FakeApi.md +++ b/samples/client/petstore/perl/docs/FakeApi.md @@ -386,13 +386,13 @@ my $api_instance = WWW::OpenAPIClient::FakeApi->new( ); my $enum_header_string_array = [("'$'")]; # ARRAY[string] | Header parameter enum test (string array) -my $enum_header_string = "'-efg'"; # string | Header parameter enum test (string) +my $enum_header_string = '-efg'; # string | Header parameter enum test (string) my $enum_query_string_array = [("'$'")]; # ARRAY[string] | Query parameter enum test (string array) -my $enum_query_string = "'-efg'"; # string | Query parameter enum test (string) +my $enum_query_string = '-efg'; # string | Query parameter enum test (string) my $enum_query_integer = 56; # int | Query parameter enum test (double) my $enum_query_double = 3.4; # double | Query parameter enum test (double) -my $enum_form_string_array = ["'$'"]; # ARRAY[string] | Form parameter enum test (string array) -my $enum_form_string = "'-efg'"; # string | Form parameter enum test (string) +my $enum_form_string_array = ['$']; # ARRAY[string] | Form parameter enum test (string array) +my $enum_form_string = '-efg'; # string | Form parameter enum test (string) eval { $api_instance->test_enum_parameters(enum_header_string_array => $enum_header_string_array, enum_header_string => $enum_header_string, enum_query_string_array => $enum_query_string_array, enum_query_string => $enum_query_string, enum_query_integer => $enum_query_integer, enum_query_double => $enum_query_double, enum_form_string_array => $enum_form_string_array, enum_form_string => $enum_form_string); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/AdditionalPropertiesClass.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/AdditionalPropertiesClass.pm index 812a76b5710..5df24d81a47 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/AdditionalPropertiesClass.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/AdditionalPropertiesClass.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -159,7 +159,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'map_property' => 'HASH[string,string]', 'map_of_map_property' => 'HASH[string,HASH[string,string]]' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Animal.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Animal.pm index 7850f71f5c9..2d2e89fecb1 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Animal.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Animal.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -159,7 +159,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'class_name' => 'string', 'color' => 'string' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/AnimalFarm.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/AnimalFarm.pm index 57944d63f67..27d93be1436 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/AnimalFarm.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/AnimalFarm.pm @@ -62,7 +62,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -101,8 +101,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -146,7 +146,7 @@ __PACKAGE__->class_documentation({description => '', __PACKAGE__->method_documentation({ }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ApiResponse.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ApiResponse.pm index 5afb8172f00..ddbe5c5a211 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ApiResponse.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ApiResponse.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -166,7 +166,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'code' => 'int', 'type' => 'string', 'message' => 'string' diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ArrayOfArrayOfNumberOnly.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ArrayOfArrayOfNumberOnly.pm index fb05b223491..6ba81c73888 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ArrayOfArrayOfNumberOnly.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ArrayOfArrayOfNumberOnly.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -152,7 +152,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'array_array_number' => 'ARRAY[ARRAY[double]]' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ArrayOfNumberOnly.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ArrayOfNumberOnly.pm index 21af1a61bc1..0dd88817e11 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ArrayOfNumberOnly.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ArrayOfNumberOnly.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -152,7 +152,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'array_number' => 'ARRAY[double]' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ArrayTest.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ArrayTest.pm index b2c5b51c9be..2f04d5a797c 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ArrayTest.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ArrayTest.pm @@ -62,7 +62,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -101,8 +101,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -167,7 +167,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'array_of_string' => 'ARRAY[string]', 'array_array_of_integer' => 'ARRAY[ARRAY[int]]', 'array_array_of_model' => 'ARRAY[ARRAY[ReadOnlyFirst]]' diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Capitalization.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Capitalization.pm index c55caab2a53..34739279f57 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Capitalization.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Capitalization.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -187,7 +187,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'small_camel' => 'string', 'capital_camel' => 'string', 'small_snake' => 'string', diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Cat.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Cat.pm index 8d23738cbde..183755cde92 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Cat.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Cat.pm @@ -62,7 +62,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -101,8 +101,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -167,7 +167,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'class_name' => 'string', 'color' => 'string', 'declawed' => 'boolean' diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Category.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Category.pm index 4d1486da50e..017b17928dc 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Category.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Category.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -159,7 +159,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'id' => 'int', 'name' => 'string' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ClassModel.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ClassModel.pm index 4970b745680..62a1bcefb6a 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ClassModel.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ClassModel.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -152,7 +152,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { '_class' => 'string' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Client.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Client.pm index 486c693a0c2..fb5375afd37 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Client.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Client.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -152,7 +152,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'client' => 'string' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Dog.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Dog.pm index b12dd6ddf5d..7574b9ab1ed 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Dog.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Dog.pm @@ -62,7 +62,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -101,8 +101,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -167,7 +167,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'class_name' => 'string', 'color' => 'string', 'breed' => 'string' diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/EnumArrays.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/EnumArrays.pm index 64d57a53c12..b9bc8ee4c51 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/EnumArrays.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/EnumArrays.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -159,7 +159,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'just_symbol' => 'string', 'array_enum' => 'ARRAY[string]' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/EnumClass.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/EnumClass.pm index 33f8b35209d..72fd7cd34da 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/EnumClass.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/EnumClass.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -145,7 +145,7 @@ __PACKAGE__->class_documentation({description => '', __PACKAGE__->method_documentation({ }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/EnumTest.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/EnumTest.pm index e53ab35eb5e..3fbffd72c15 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/EnumTest.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/EnumTest.pm @@ -62,7 +62,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -101,8 +101,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -181,7 +181,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'enum_string' => 'string', 'enum_string_required' => 'string', 'enum_integer' => 'int', diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/FormatTest.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/FormatTest.pm index 1b5166262fe..c796d794c84 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/FormatTest.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/FormatTest.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -236,7 +236,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'integer' => 'int', 'int32' => 'int', 'int64' => 'int', diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/HasOnlyReadOnly.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/HasOnlyReadOnly.pm index 2da14fb0935..0c35e214512 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/HasOnlyReadOnly.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/HasOnlyReadOnly.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -159,7 +159,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'bar' => 'string', 'foo' => 'string' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/List.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/List.pm index e565eef31fb..63ee13919e2 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/List.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/List.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -152,7 +152,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { '_123_list' => 'string' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/MapTest.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/MapTest.pm index 0d8d58d5886..f5e16474b54 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/MapTest.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/MapTest.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -159,7 +159,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'map_map_of_string' => 'HASH[string,HASH[string,string]]', 'map_of_enum_string' => 'HASH[string,string]' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/MixedPropertiesAndAdditionalPropertiesClass.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/MixedPropertiesAndAdditionalPropertiesClass.pm index 1491c92c3f8..114601dec2b 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/MixedPropertiesAndAdditionalPropertiesClass.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/MixedPropertiesAndAdditionalPropertiesClass.pm @@ -62,7 +62,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -101,8 +101,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -167,7 +167,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'uuid' => 'string', 'date_time' => 'DateTime', 'map' => 'HASH[string,Animal]' diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Model200Response.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Model200Response.pm index 929f999826f..295e5d11979 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Model200Response.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Model200Response.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -159,7 +159,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'name' => 'int', 'class' => 'string' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ModelReturn.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ModelReturn.pm index 0f6db462ea7..787855c6e8a 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ModelReturn.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ModelReturn.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -152,7 +152,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'return' => 'int' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Name.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Name.pm index 94476687c55..ec2b61fc315 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Name.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Name.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -173,7 +173,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'name' => 'int', 'snake_case' => 'int', 'property' => 'string', diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/NumberOnly.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/NumberOnly.pm index 09410c23dda..e02ff8f11d5 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/NumberOnly.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/NumberOnly.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -152,7 +152,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'just_number' => 'double' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Order.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Order.pm index a2f866693ea..3ce9a8542af 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Order.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Order.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -187,7 +187,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'id' => 'int', 'pet_id' => 'int', 'quantity' => 'int', diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/OuterComposite.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/OuterComposite.pm index 1fd876d3753..1d6d19287a1 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/OuterComposite.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/OuterComposite.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -166,7 +166,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'my_number' => 'double', 'my_string' => 'string', 'my_boolean' => 'boolean' diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/OuterEnum.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/OuterEnum.pm index ec9307625ce..bc3db9cb9a2 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/OuterEnum.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/OuterEnum.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -145,7 +145,7 @@ __PACKAGE__->class_documentation({description => '', __PACKAGE__->method_documentation({ }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Pet.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Pet.pm index c983cb53277..926a64d7f8f 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Pet.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Pet.pm @@ -63,7 +63,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -102,8 +102,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -189,7 +189,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'id' => 'int', 'category' => 'Category', 'name' => 'string', diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ReadOnlyFirst.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ReadOnlyFirst.pm index 4fac5f7eae2..cfe76277e97 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ReadOnlyFirst.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/ReadOnlyFirst.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -159,7 +159,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'bar' => 'string', 'baz' => 'string' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialModelName.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialModelName.pm index 552b93402bd..04a7e156cec 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialModelName.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/SpecialModelName.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -152,7 +152,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { '__special[property/name]' => 'int' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Tag.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Tag.pm index c78d1d48e17..835f6668a5f 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Tag.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/Tag.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -159,7 +159,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'id' => 'int', 'name' => 'string' } ); diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/User.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/User.pm index 9912de7cebf..fecadeff77f 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/User.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Object/User.pm @@ -61,7 +61,7 @@ Generated by: https://openapi-generator.tech # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); -__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); @@ -100,8 +100,8 @@ sub TO_JSON { sub from_hash { my ($self, $hash) = @_; - # loop through attributes and use swagger_types to deserialize the data - while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + # loop through attributes and use openapi_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); @@ -201,7 +201,7 @@ __PACKAGE__->method_documentation({ }, }); -__PACKAGE__->swagger_types( { +__PACKAGE__->openapi_types( { 'id' => 'int', 'username' => 'string', 'first_name' => 'string', diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Role.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Role.pm index b1d64b92736..c7a5ec41b09 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Role.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/Role.pm @@ -291,7 +291,7 @@ Your library files will be built under C. $ cd openapi-generator $ mvn package $ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \ - -i [URL or file path to JSON swagger API spec] \ + -i [URL or file path to JSON OpenAPI API spec] \ -l perl \ -c /path/to/config/file.json \ -o /path/to/output/folder @@ -320,7 +320,7 @@ namespace is used if you don't supply your own class. =head1 DOCUMENTATION FROM THE OpenAPI Spec -Additional documentation for each class and method may be provided by the Swagger +Additional documentation for each class and method may be provided by the OpenAPI spec. If so, this is available via the C and C methods on each generated object class, and the C method on the endpoint API classes: diff --git a/samples/server/petstore/flaskConnexion-python2/openapi_server/openapi/openapi.yaml b/samples/server/petstore/flaskConnexion-python2/openapi_server/openapi/openapi.yaml index 20174ed3ca1..cc02c545f9a 100644 --- a/samples/server/petstore/flaskConnexion-python2/openapi_server/openapi/openapi.yaml +++ b/samples/server/petstore/flaskConnexion-python2/openapi_server/openapi/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: title: OpenAPI Petstore description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. @@ -6,6 +6,9 @@ info: name: Apache-2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html version: 1.0.0 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io servers: - url: http://petstore.swagger.io/v2 tags: @@ -23,25 +26,14 @@ paths: summary: Update an existing pet operationId: update_pet requestBody: - description: Pet object that needs to be added to the store - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - required: true + $ref: '#/components/requestBodies/Pet' responses: 400: description: Invalid ID supplied - content: {} 404: description: Pet not found - content: {} 405: description: Validation exception - content: {} security: - petstore_auth: - write:pets @@ -53,19 +45,10 @@ paths: summary: Add a new pet to the store operationId: add_pet requestBody: - description: Pet object that needs to be added to the store - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - required: true + $ref: '#/components/requestBodies/Pet' responses: 405: description: Invalid input - content: {} security: - petstore_auth: - write:pets @@ -83,6 +66,7 @@ paths: in: query description: Status values that need to be considered for filter required: true + style: form explode: false schema: type: array @@ -109,7 +93,6 @@ paths: $ref: '#/components/schemas/Pet' 400: description: Invalid status value - content: {} security: - petstore_auth: - write:pets @@ -127,6 +110,7 @@ paths: in: query description: Tags to filter by required: true + style: form explode: false schema: type: array @@ -148,7 +132,6 @@ paths: $ref: '#/components/schemas/Pet' 400: description: Invalid tag value - content: {} deprecated: true security: - petstore_auth: @@ -167,6 +150,8 @@ paths: in: path description: ID of pet to return required: true + style: simple + explode: false schema: type: integer format: int64 @@ -182,10 +167,8 @@ paths: $ref: '#/components/schemas/Pet' 400: description: Invalid ID supplied - content: {} 404: description: Pet not found - content: {} security: - api_key: [] x-openapi-router-controller: openapi_server.controllers.pet_controller @@ -199,6 +182,8 @@ paths: in: path description: ID of pet that needs to be updated required: true + style: simple + explode: false schema: type: integer format: int64 @@ -206,17 +191,10 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - type: string - description: Updated name of the pet - status: - type: string - description: Updated status of the pet + $ref: '#/components/schemas/body' responses: 405: description: Invalid input - content: {} security: - petstore_auth: - write:pets @@ -230,19 +208,23 @@ paths: parameters: - name: api_key in: header + required: false + style: simple + explode: false schema: type: string - name: petId in: path description: Pet id to delete required: true + style: simple + explode: false schema: type: integer format: int64 responses: 400: description: Invalid pet value - content: {} security: - petstore_auth: - write:pets @@ -259,6 +241,8 @@ paths: in: path description: ID of pet to update required: true + style: simple + explode: false schema: type: integer format: int64 @@ -266,14 +250,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - type: string - description: Additional data to pass to server - file: - type: string - description: file to upload - format: binary + $ref: '#/components/schemas/body_1' responses: 200: description: successful operation @@ -315,7 +292,7 @@ paths: requestBody: description: order placed for purchasing the pet content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' required: true @@ -331,7 +308,6 @@ paths: $ref: '#/components/schemas/Order' 400: description: Invalid Order - content: {} x-openapi-router-controller: openapi_server.controllers.store_controller /store/order/{orderId}: get: @@ -345,6 +321,8 @@ paths: in: path description: ID of pet that needs to be fetched required: true + style: simple + explode: false schema: maximum: 5 minimum: 1 @@ -362,10 +340,8 @@ paths: $ref: '#/components/schemas/Order' 400: description: Invalid ID supplied - content: {} 404: description: Order not found - content: {} x-openapi-router-controller: openapi_server.controllers.store_controller delete: tags: @@ -378,15 +354,15 @@ paths: in: path description: ID of the order that needs to be deleted required: true + style: simple + explode: false schema: type: string responses: 400: description: Invalid ID supplied - content: {} 404: description: Order not found - content: {} x-openapi-router-controller: openapi_server.controllers.store_controller /user: post: @@ -398,14 +374,13 @@ paths: requestBody: description: Created user object content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' required: true responses: default: description: successful operation - content: {} x-openapi-router-controller: openapi_server.controllers.user_controller /user/createWithArray: post: @@ -414,18 +389,10 @@ paths: summary: Creates list of users with given input array operationId: create_users_with_array_input requestBody: - description: List of user object - content: - '*/*': - schema: - type: array - items: - $ref: '#/components/schemas/User' - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: description: successful operation - content: {} x-openapi-router-controller: openapi_server.controllers.user_controller /user/createWithList: post: @@ -434,18 +401,10 @@ paths: summary: Creates list of users with given input array operationId: create_users_with_list_input requestBody: - description: List of user object - content: - '*/*': - schema: - type: array - items: - $ref: '#/components/schemas/User' - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: description: successful operation - content: {} x-openapi-router-controller: openapi_server.controllers.user_controller /user/login: get: @@ -458,12 +417,16 @@ paths: in: query description: The user name for login required: true + style: form + explode: true schema: type: string - name: password in: query description: The password for login in clear text required: true + style: form + explode: true schema: type: string responses: @@ -472,11 +435,15 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + style: simple + explode: false schema: type: integer format: int32 X-Expires-After: description: date in UTC when toekn expires + style: simple + explode: false schema: type: string format: date-time @@ -489,7 +456,6 @@ paths: type: string 400: description: Invalid username/password supplied - content: {} x-openapi-router-controller: openapi_server.controllers.user_controller /user/logout: get: @@ -500,7 +466,6 @@ paths: responses: default: description: successful operation - content: {} x-openapi-router-controller: openapi_server.controllers.user_controller /user/{username}: get: @@ -513,6 +478,8 @@ paths: in: path description: The name that needs to be fetched. Use user1 for testing. required: true + style: simple + explode: false schema: type: string responses: @@ -527,10 +494,8 @@ paths: $ref: '#/components/schemas/User' 400: description: Invalid username supplied - content: {} 404: description: User not found - content: {} x-openapi-router-controller: openapi_server.controllers.user_controller put: tags: @@ -543,22 +508,22 @@ paths: in: path description: name that need to be deleted required: true + style: simple + explode: false schema: type: string requestBody: description: Updated user object content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' required: true responses: 400: description: Invalid user supplied - content: {} 404: description: User not found - content: {} x-openapi-router-controller: openapi_server.controllers.user_controller delete: tags: @@ -571,15 +536,15 @@ paths: in: path description: The name that needs to be deleted required: true + style: simple + explode: false schema: type: string responses: 400: description: Invalid username supplied - content: {} 404: description: User not found - content: {} x-openapi-router-controller: openapi_server.controllers.user_controller components: schemas: @@ -754,6 +719,45 @@ components: code: 0 type: type message: message + body: + type: object + properties: + name: + type: string + description: Updated name of the pet + status: + type: string + description: Updated status of the pet + body_1: + type: object + properties: + additionalMetadata: + type: string + description: Additional data to pass to server + file: + type: string + description: file to upload + format: binary + requestBodies: + UserArray: + description: List of user object + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + required: true + Pet: + description: Pet object that needs to be added to the store + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + required: true securitySchemes: petstore_auth: type: oauth2 diff --git a/samples/server/petstore/flaskConnexion/openapi_server/openapi/openapi.yaml b/samples/server/petstore/flaskConnexion/openapi_server/openapi/openapi.yaml index 20174ed3ca1..cc02c545f9a 100644 --- a/samples/server/petstore/flaskConnexion/openapi_server/openapi/openapi.yaml +++ b/samples/server/petstore/flaskConnexion/openapi_server/openapi/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: title: OpenAPI Petstore description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. @@ -6,6 +6,9 @@ info: name: Apache-2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html version: 1.0.0 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io servers: - url: http://petstore.swagger.io/v2 tags: @@ -23,25 +26,14 @@ paths: summary: Update an existing pet operationId: update_pet requestBody: - description: Pet object that needs to be added to the store - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - required: true + $ref: '#/components/requestBodies/Pet' responses: 400: description: Invalid ID supplied - content: {} 404: description: Pet not found - content: {} 405: description: Validation exception - content: {} security: - petstore_auth: - write:pets @@ -53,19 +45,10 @@ paths: summary: Add a new pet to the store operationId: add_pet requestBody: - description: Pet object that needs to be added to the store - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - required: true + $ref: '#/components/requestBodies/Pet' responses: 405: description: Invalid input - content: {} security: - petstore_auth: - write:pets @@ -83,6 +66,7 @@ paths: in: query description: Status values that need to be considered for filter required: true + style: form explode: false schema: type: array @@ -109,7 +93,6 @@ paths: $ref: '#/components/schemas/Pet' 400: description: Invalid status value - content: {} security: - petstore_auth: - write:pets @@ -127,6 +110,7 @@ paths: in: query description: Tags to filter by required: true + style: form explode: false schema: type: array @@ -148,7 +132,6 @@ paths: $ref: '#/components/schemas/Pet' 400: description: Invalid tag value - content: {} deprecated: true security: - petstore_auth: @@ -167,6 +150,8 @@ paths: in: path description: ID of pet to return required: true + style: simple + explode: false schema: type: integer format: int64 @@ -182,10 +167,8 @@ paths: $ref: '#/components/schemas/Pet' 400: description: Invalid ID supplied - content: {} 404: description: Pet not found - content: {} security: - api_key: [] x-openapi-router-controller: openapi_server.controllers.pet_controller @@ -199,6 +182,8 @@ paths: in: path description: ID of pet that needs to be updated required: true + style: simple + explode: false schema: type: integer format: int64 @@ -206,17 +191,10 @@ paths: content: application/x-www-form-urlencoded: schema: - properties: - name: - type: string - description: Updated name of the pet - status: - type: string - description: Updated status of the pet + $ref: '#/components/schemas/body' responses: 405: description: Invalid input - content: {} security: - petstore_auth: - write:pets @@ -230,19 +208,23 @@ paths: parameters: - name: api_key in: header + required: false + style: simple + explode: false schema: type: string - name: petId in: path description: Pet id to delete required: true + style: simple + explode: false schema: type: integer format: int64 responses: 400: description: Invalid pet value - content: {} security: - petstore_auth: - write:pets @@ -259,6 +241,8 @@ paths: in: path description: ID of pet to update required: true + style: simple + explode: false schema: type: integer format: int64 @@ -266,14 +250,7 @@ paths: content: multipart/form-data: schema: - properties: - additionalMetadata: - type: string - description: Additional data to pass to server - file: - type: string - description: file to upload - format: binary + $ref: '#/components/schemas/body_1' responses: 200: description: successful operation @@ -315,7 +292,7 @@ paths: requestBody: description: order placed for purchasing the pet content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' required: true @@ -331,7 +308,6 @@ paths: $ref: '#/components/schemas/Order' 400: description: Invalid Order - content: {} x-openapi-router-controller: openapi_server.controllers.store_controller /store/order/{orderId}: get: @@ -345,6 +321,8 @@ paths: in: path description: ID of pet that needs to be fetched required: true + style: simple + explode: false schema: maximum: 5 minimum: 1 @@ -362,10 +340,8 @@ paths: $ref: '#/components/schemas/Order' 400: description: Invalid ID supplied - content: {} 404: description: Order not found - content: {} x-openapi-router-controller: openapi_server.controllers.store_controller delete: tags: @@ -378,15 +354,15 @@ paths: in: path description: ID of the order that needs to be deleted required: true + style: simple + explode: false schema: type: string responses: 400: description: Invalid ID supplied - content: {} 404: description: Order not found - content: {} x-openapi-router-controller: openapi_server.controllers.store_controller /user: post: @@ -398,14 +374,13 @@ paths: requestBody: description: Created user object content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' required: true responses: default: description: successful operation - content: {} x-openapi-router-controller: openapi_server.controllers.user_controller /user/createWithArray: post: @@ -414,18 +389,10 @@ paths: summary: Creates list of users with given input array operationId: create_users_with_array_input requestBody: - description: List of user object - content: - '*/*': - schema: - type: array - items: - $ref: '#/components/schemas/User' - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: description: successful operation - content: {} x-openapi-router-controller: openapi_server.controllers.user_controller /user/createWithList: post: @@ -434,18 +401,10 @@ paths: summary: Creates list of users with given input array operationId: create_users_with_list_input requestBody: - description: List of user object - content: - '*/*': - schema: - type: array - items: - $ref: '#/components/schemas/User' - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: description: successful operation - content: {} x-openapi-router-controller: openapi_server.controllers.user_controller /user/login: get: @@ -458,12 +417,16 @@ paths: in: query description: The user name for login required: true + style: form + explode: true schema: type: string - name: password in: query description: The password for login in clear text required: true + style: form + explode: true schema: type: string responses: @@ -472,11 +435,15 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + style: simple + explode: false schema: type: integer format: int32 X-Expires-After: description: date in UTC when toekn expires + style: simple + explode: false schema: type: string format: date-time @@ -489,7 +456,6 @@ paths: type: string 400: description: Invalid username/password supplied - content: {} x-openapi-router-controller: openapi_server.controllers.user_controller /user/logout: get: @@ -500,7 +466,6 @@ paths: responses: default: description: successful operation - content: {} x-openapi-router-controller: openapi_server.controllers.user_controller /user/{username}: get: @@ -513,6 +478,8 @@ paths: in: path description: The name that needs to be fetched. Use user1 for testing. required: true + style: simple + explode: false schema: type: string responses: @@ -527,10 +494,8 @@ paths: $ref: '#/components/schemas/User' 400: description: Invalid username supplied - content: {} 404: description: User not found - content: {} x-openapi-router-controller: openapi_server.controllers.user_controller put: tags: @@ -543,22 +508,22 @@ paths: in: path description: name that need to be deleted required: true + style: simple + explode: false schema: type: string requestBody: description: Updated user object content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' required: true responses: 400: description: Invalid user supplied - content: {} 404: description: User not found - content: {} x-openapi-router-controller: openapi_server.controllers.user_controller delete: tags: @@ -571,15 +536,15 @@ paths: in: path description: The name that needs to be deleted required: true + style: simple + explode: false schema: type: string responses: 400: description: Invalid username supplied - content: {} 404: description: User not found - content: {} x-openapi-router-controller: openapi_server.controllers.user_controller components: schemas: @@ -754,6 +719,45 @@ components: code: 0 type: type message: message + body: + type: object + properties: + name: + type: string + description: Updated name of the pet + status: + type: string + description: Updated status of the pet + body_1: + type: object + properties: + additionalMetadata: + type: string + description: Additional data to pass to server + file: + type: string + description: file to upload + format: binary + requestBodies: + UserArray: + description: List of user object + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + required: true + Pet: + description: Pet object that needs to be added to the store + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + required: true securitySchemes: petstore_auth: type: oauth2