From e5635d236d429275777230d6d9d3d4cbc91083cb Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 16 Jun 2018 21:21:18 +0800 Subject: [PATCH 01/35] update brew readme (#330) --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 841fdd8da97..b78ffb4c5fd 100644 --- a/README.md +++ b/README.md @@ -179,13 +179,15 @@ If you don't have maven installed, you may directly use the included [maven wrap ### [1.5 - Homebrew](#table-of-contents) -To install, run `brew install openapi-generator` (the new brew formula is pending https://github.com/Homebrew/homebrew-core/pull/28584) +To install, run `brew install openapi-generator` Here is an example usage to generate a Ruby client: ```sh openapi-generator generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby -o /tmp/test/ ``` +To reinstall with the latest master, run `brew reinstall --HEAD openapi-generator` + ### [1.6 - Docker](#table-of-contents) #### Public Pre-built Docker images From 798bf61fde404f22db6da12460fcd0f36ce7f002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 16 Jun 2018 19:49:01 +0300 Subject: [PATCH 02/35] Grammar and spelling fixes (#329) --- bin/utils/ensure-up-to-date | 2 +- docs/3.0.0-release-note.md | 4 ++-- modules/openapi-generator-online/README.md | 4 ++-- .../org/openapitools/codegen/DefaultCodegen.java | 12 ++++++------ .../org/openapitools/codegen/DefaultGenerator.java | 2 +- .../codegen/languages/AbstractAdaCodegen.java | 2 +- .../codegen/languages/AbstractCSharpCodegen.java | 2 +- .../codegen/languages/KotlinServerCodegen.java | 2 +- .../org/openapitools/codegen/utils/URLPathUtils.java | 4 ++-- .../src/main/resources/Ada/README.mustache | 2 +- .../serialization/api_json_deserializer.mustache | 2 +- .../Java/libraries/okhttp-gson/ApiClient.mustache | 2 +- .../JavaSpring/libraries/spring-boot/README.mustache | 4 ++-- .../main/resources/cpprest/multipart-header.mustache | 2 +- .../src/main/resources/elixir/connection.ex.mustache | 2 +- .../src/main/resources/flash/ApiClientEvent.as | 4 ++-- .../src/main/resources/flash/build.xml | 6 +++--- .../src/main/resources/flaskConnexion/util.mustache | 2 +- .../src/main/resources/go/configuration.mustache | 2 +- .../src/main/resources/java-pkmst/readme.mustache | 8 ++++---- .../objc/DefaultConfiguration-header.mustache | 2 +- .../objc/ResponseDeserializer-header.mustache | 2 +- .../src/main/resources/php/ObjectSerializer.mustache | 2 +- .../src/main/resources/python/api_client.mustache | 2 +- .../src/main/resources/tizen/Doxyfile.mustache | 2 +- .../main/resources/typescript-fetch/README.mustache | 2 +- .../resources/typescript-inversify/README.mustache | 2 +- .../main/resources/typescript-jquery/README.mustache | 2 +- .../openapitools/codegen/csharp/CSharpModelTest.java | 2 +- .../org/openapitools/codegen/go/GoModelTest.java | 2 +- .../org/openapitools/codegen/java/JavaModelTest.java | 12 ++++++------ .../org/openapitools/codegen/objc/ObjcModelTest.java | 4 ++-- .../org/openapitools/codegen/php/PhpModelTest.java | 2 +- .../org/openapitools/codegen/python/PythonTest.java | 2 +- .../scalaakka/ScalaAkkaClientCodegenTest.java | 2 +- .../scalahttpclient/ScalaHttpClientModelTest.java | 2 +- .../openapitools/codegen/utils/ModelUtilsTest.java | 4 ++-- .../src/test/resources/2_0/swift4Test.json | 8 ++++---- .../additional-properties-expected/README.md | 4 ++-- .../typescript/array-and-object-expected/README.md | 4 ++-- .../typescript/petstore-expected/README.md | 4 ++-- shippable.yml | 2 +- 42 files changed, 70 insertions(+), 70 deletions(-) diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date index 69f52f0fed0..f8f84d393ef 100755 --- a/bin/utils/ensure-up-to-date +++ b/bin/utils/ensure-up-to-date @@ -1,6 +1,6 @@ #!/bin/bash # this bash script run the scripts for the 'mature' generators -# it ensures that all changes are commited into the 'samples/' folder +# it ensures that all changes are committed into the 'samples/' folder echo "# START SCRIPT: $0" diff --git a/docs/3.0.0-release-note.md b/docs/3.0.0-release-note.md index 1bb85e97de0..12a20c149e5 100644 --- a/docs/3.0.0-release-note.md +++ b/docs/3.0.0-release-note.md @@ -166,7 +166,7 @@ cf8d8d56f [PHP] Fix code example from README. Variable name was missing when usi 76907cacd [PHP] declare property headerSelector ### Python -7184f1ec6 [python] asyncio supports _preload_content; remove unsed imports (#107) +7184f1ec6 [python] asyncio supports _preload_content; remove unused imports (#107) d74d2ba03 fix: python clients 8e0a0ebd6 Fix python / tornado body handling b39c35c76 Fix inconsistency between model name and file name in python client @@ -250,7 +250,7 @@ ce930e7a6 [Jaxrs-cxf] Add bean-level cascaded beanvalidation for pojos (@Valid) ff1178ad7 [Java][Spring] fix missing optional query params 2103fadab Fix package declaration for play-framework 2c6380c84 fix inner item (list, map) for play framework -e33b350c8 Fix an issue in Play Framework generator where a CSV is empty and transfered to the controllerImp with an empty item. +e33b350c8 Fix an issue in Play Framework generator where a CSV is empty and transferred to the controllerImp with an empty item. 99fc27246 [JAX-RS][Spec] Removes throws Exception. fe2a44339 Fixes issue (SpringCodeGen dateLibrary "java8-localdatetime" option is ignored). d890d733f [JaxRS][Java] issue with implFolder on windows, and required fields generation for containers (#88) diff --git a/modules/openapi-generator-online/README.md b/modules/openapi-generator-online/README.md index a12a59c79ed..b6dde7e276c 100644 --- a/modules/openapi-generator-online/README.md +++ b/modules/openapi-generator-online/README.md @@ -10,6 +10,6 @@ This is an example of building a OpenAPI-enabled server in Java using the Spring The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) -Start your server as an simple java application +Start your server as a simple java application -Change default port value in application.properties \ No newline at end of file +Change default port value in application.properties 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 5901ea67760..7c37731bc63 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 @@ -210,7 +210,7 @@ public class DefaultCodegen implements CodegenConfig { for (String name : allModels.keySet()) { CodegenModel cm = allModels.get(name); CodegenModel parent = allModels.get(cm.getParent()); - // if a discriminator exists on the parent, don't add this child to the inheritance heirarchy + // if a discriminator exists on the parent, don't add this child to the inheritance hierarchy // TODO Determine what to do if the parent discriminator name == the grandparent discriminator name while (parent != null) { if (parent.getChildren() == null) { @@ -1201,7 +1201,7 @@ public class DefaultCodegen implements CodegenConfig { */ private static String getPrimitiveType(Schema schema) { if (schema == null) { - throw new RuntimeException("schema cannnot be null in getPrimitiveType"); + throw new RuntimeException("schema cannot be null in getPrimitiveType"); } else if (ModelUtils.isStringSchema(schema) && "number".equals(schema.getFormat())) { // special handle of type: string, format: number return "BigDecimal"; @@ -1300,7 +1300,7 @@ public class DefaultCodegen implements CodegenConfig { /** * Determine the type alias for the given type if it exists. This feature - * was original developed for Java because the language does not have a aliasing + * was originally developed for Java because the language does not have an aliasing * mechanism of its own but later extends to handle other languages * * @param name The type name. @@ -2055,7 +2055,7 @@ public class DefaultCodegen implements CodegenConfig { } if (operation == null) - throw new RuntimeException("operation cannnot be null in fromOperation"); + throw new RuntimeException("operation cannot be null in fromOperation"); // store the original operationId for plug-in op.operationIdOriginal = operation.getOperationId(); @@ -3853,7 +3853,7 @@ public class DefaultCodegen implements CodegenConfig { RequestBody requestBody = ModelUtils.getReferencedRequestBody(openAPI, operation.getRequestBody()); if (requestBody == null || requestBody.getContent() == null || requestBody.getContent().isEmpty()) { - return Collections.emptySet(); // return emtpy set + return Collections.emptySet(); // return empty set } return requestBody.getContent().keySet(); } @@ -4249,7 +4249,7 @@ public class DefaultCodegen implements CodegenConfig { if (schema.getAdditionalProperties() != null) {// http body is map LOGGER.error("Map should be supported. Please report to openapi-generator github repo about the issue."); } else if (codegenProperty != null) { - LOGGER.warn("The folowing schema has undefined (null) baseType. " + + LOGGER.warn("The following schema has undefined (null) baseType. " + "It could be due to form parameter defined in OpenAPI v2 spec with incorrect consumes. " + "A correct 'consumes' for form parameters should be " + "'application/x-www-form-urlencoded' or 'multipart/form-data'"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 3eb29c62dc8..228d1ac59be 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -1012,7 +1012,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { for (String key : definitions.keySet()) { Schema schema = definitions.get(key); if (schema == null) - throw new RuntimeException("schema cannnot be null in processMoels"); + throw new RuntimeException("schema cannot be null in processMoels"); CodegenModel cm = config.fromModel(key, schema, allDefinitions); Map mo = new HashMap(); mo.put("model", cm); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java index 12abb58094e..5a9a70bcff6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java @@ -378,7 +378,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg /** * Post process the media types (produces and consumes) for Ada code generator. *

- * For each media type, add a adaMediaType member that gives the Ada enum constant + * For each media type, add an adaMediaType member that gives the Ada enum constant * for the corresponding type. * * @param types the list of media types. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java index a385c4ddabb..4a6a827932b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java @@ -341,7 +341,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co .build(); if (objs.containsKey("lambda")) { - LOGGER.warn("An property named 'lambda' already exists. Mustache lambdas renamed from 'lambda' to '_lambda'. " + + LOGGER.warn("A property named 'lambda' already exists. Mustache lambdas renamed from 'lambda' to '_lambda'. " + "You'll likely need to use a custom template, " + "see https://github.com/swagger-api/swagger-codegen#modifying-the-client-library-format. "); objs.put("_lambda", lambdas); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java index 54295a75143..5da9953f636 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java @@ -229,7 +229,7 @@ public class KotlinServerCodegen extends AbstractKotlinCodegen { .build(); if (objs.containsKey("lambda")) { - LOGGER.warn("An property named 'lambda' already exists. Mustache lambdas renamed from 'lambda' to '_lambda'. " + + LOGGER.warn("A property named 'lambda' already exists. Mustache lambdas renamed from 'lambda' to '_lambda'. " + "You'll likely need to use a custom template, " + "see https://github.com/swagger-api/swagger-codegen#modifying-the-client-library-format. "); // TODO: update the URL objs.put("_lambda", lambdas); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java index 52c423f74cf..2a71b197c8a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java @@ -39,7 +39,7 @@ public class URLPathUtils { LOGGER.warn("Server information seems not defined in the spec. Default to {}.", LOCAL_HOST); return getDefaultUrl(); } - // TOOD need a way to obtain all server URLs + // TODO need a way to obtain all server URLs final Server server = servers.get(0); String url = sanitizeUrl(server.getUrl()); @@ -150,4 +150,4 @@ public class URLPathUtils { return null; } } -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/resources/Ada/README.mustache b/modules/openapi-generator/src/main/resources/Ada/README.mustache index d74b9c912f7..56361083343 100644 --- a/modules/openapi-generator/src/main/resources/Ada/README.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/README.mustache @@ -18,7 +18,7 @@ run the following command: gprbuild -p -P{{projectName}} ``` -After the build is successfull, you will get the server binary +After the build is successful, you will get the server binary in bin/{{packageName}}-server and you can start it as follows: ``` ./bin/{{packageName}}-server diff --git a/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/api_json_deserializer.mustache b/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/api_json_deserializer.mustache index 3423a142cb2..07afc39b4ea 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/api_json_deserializer.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/api_json_deserializer.mustache @@ -7,7 +7,7 @@ expanded class feature -- Access from_json (a_val:STRING; a_type: TYPE [detachable ANY] ): detachable ANY - -- Deserialize a a json representation `a_val' to an object + -- Deserialize a json representation `a_val' to an object -- of type `a_type' local conv_from: JSON_BASIC_REFLECTOR_DESERIALIZER diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index 0c7bbed5315..5af1e2285f9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -915,7 +915,7 @@ public class ApiClient { * @param Type * @param response Response * @param returnType Return type - * @throws ApiException If the response has a unsuccessful status code or + * @throws ApiException If the response has an unsuccessful status code or * fail to deserialize the response body * @return Type */ diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache index b10f3dca28a..f824f03035f 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache @@ -12,7 +12,7 @@ This is an example of building a OpenAPI-enabled server in Java using the Spring The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) {{/useSpringfox}} -Start your server as an simple java application +Start your server as a simple java application {{^reactive}} You can view the api documentation in swagger-ui by pointing to @@ -46,4 +46,4 @@ public interface PetClient extends PetApi { } ``` -{{/interfaceOnly}} \ No newline at end of file +{{/interfaceOnly}} diff --git a/modules/openapi-generator/src/main/resources/cpprest/multipart-header.mustache b/modules/openapi-generator/src/main/resources/cpprest/multipart-header.mustache index 17dba42a34a..c34109e989e 100644 --- a/modules/openapi-generator/src/main/resources/cpprest/multipart-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpprest/multipart-header.mustache @@ -2,7 +2,7 @@ /* * MultipartFormData.h * - * This class represents a container for building a application/x-multipart-formdata requests. + * This class represents a container for building application/x-multipart-formdata requests. */ #ifndef {{modelHeaderGuardPrefix}}_MultipartFormData_H_ diff --git a/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache b/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache index 9e10634e285..052a9d357e4 100644 --- a/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache @@ -58,7 +58,7 @@ defmodule {{moduleName}}.Connection do {{/isOAuth}} {{#isBasic}} @doc """ - Configure an client connection using Basic authentication. + Configure a client connection using Basic authentication. ## Parameters diff --git a/modules/openapi-generator/src/main/resources/flash/ApiClientEvent.as b/modules/openapi-generator/src/main/resources/flash/ApiClientEvent.as index 964dbc26d69..abb0fe121fb 100644 --- a/modules/openapi-generator/src/main/resources/flash/ApiClientEvent.as +++ b/modules/openapi-generator/src/main/resources/flash/ApiClientEvent.as @@ -11,7 +11,7 @@ import flash.events.Event; public class ApiClientEvent extends Event{ /** - * Event type to indicate a unsuccessful invocation + * Event type to indicate an unsuccessful invocation */ public static const FAILURE_EVENT:String = "unsuccesfulInvocation"; @@ -33,4 +33,4 @@ public class ApiClientEvent extends Event{ super(type, bubbles, cancelable); } } -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/resources/flash/build.xml b/modules/openapi-generator/src/main/resources/flash/build.xml index da3c67f8344..dedf7e03008 100644 --- a/modules/openapi-generator/src/main/resources/flash/build.xml +++ b/modules/openapi-generator/src/main/resources/flash/build.xml @@ -15,7 +15,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -189,4 +189,4 @@ - \ No newline at end of file + diff --git a/modules/openapi-generator/src/main/resources/flaskConnexion/util.mustache b/modules/openapi-generator/src/main/resources/flaskConnexion/util.mustache index 4321570d5a0..c7340cd0005 100644 --- a/modules/openapi-generator/src/main/resources/flaskConnexion/util.mustache +++ b/modules/openapi-generator/src/main/resources/flaskConnexion/util.mustache @@ -51,7 +51,7 @@ def _deserialize_primitive(data, klass): def _deserialize_object(value): - """Return a original value. + """Return an original value. :return: object. """ diff --git a/modules/openapi-generator/src/main/resources/go/configuration.mustache b/modules/openapi-generator/src/main/resources/go/configuration.mustache index ccea4ba3876..81d3a41b7bd 100644 --- a/modules/openapi-generator/src/main/resources/go/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/go/configuration.mustache @@ -16,7 +16,7 @@ func (c contextKey) String() string { } var ( - // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. + // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/readme.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/readme.mustache index d56055c1e0c..9867e11590b 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/readme.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/readme.mustache @@ -17,9 +17,9 @@ g)Allow you to integrate with tracing server (Example Zipkin) h)Allow you to capture log in your microservice and send to Log management server (Ex ELK or splunk) i)Allow you to configure Oauth2 security based authorization for your microservice - Additonal Features + Additional Features j)generate sample cucumber file and dependency to drive your Behaviour driven development. - k)generate gatling based perfromance test , which can be excuted via build pipeline like jenkins etc. + k)generate gatling based performance test, which can be excuted via build pipeline like jenkins etc. Working: @@ -136,7 +136,7 @@ HttpLogging filter is provided for logging in the request and response. Can be f Spring security is also provided to secure the resources. Please modify according to your needs. First run: -Import the project in to the eclipse. Run the app as an spring boot application.The project will run on http://localhost:8008 +Import the project in to the eclipse. Run the app as a spring boot application.The project will run on http://localhost:8008 Swagger ui available on: http://localhost:8008/swagger-ui.html If all the configurations have been enabled(depending on the port) below are some of the URls to access: @@ -152,4 +152,4 @@ Pkmst examples https://github.com/ProKarma-Inc/pkmst-getting-started-examples Pkmst Extensions -https://github.com/ProKarma-Inc/pkmst-extention \ No newline at end of file +https://github.com/ProKarma-Inc/pkmst-extention diff --git a/modules/openapi-generator/src/main/resources/objc/DefaultConfiguration-header.mustache b/modules/openapi-generator/src/main/resources/objc/DefaultConfiguration-header.mustache index 438ddb5b38c..f64bb5b0614 100644 --- a/modules/openapi-generator/src/main/resources/objc/DefaultConfiguration-header.mustache +++ b/modules/openapi-generator/src/main/resources/objc/DefaultConfiguration-header.mustache @@ -82,7 +82,7 @@ /** * Sets API key * - * To remove a apiKey for an identifier, just set the apiKey to nil. + * To remove an apiKey for an identifier, just set the apiKey to nil. * * @param apiKey API key or token. * @param identifier API key identifier (authentication schema). diff --git a/modules/openapi-generator/src/main/resources/objc/ResponseDeserializer-header.mustache b/modules/openapi-generator/src/main/resources/objc/ResponseDeserializer-header.mustache index 774fe1ee5af..3ee2ecbdb86 100644 --- a/modules/openapi-generator/src/main/resources/objc/ResponseDeserializer-header.mustache +++ b/modules/openapi-generator/src/main/resources/objc/ResponseDeserializer-header.mustache @@ -38,7 +38,7 @@ extern NSInteger const {{classPrefix}}UnknownResponseObjectErrorCode; @interface {{classPrefix}}ResponseDeserializer : NSObject <{{classPrefix}}ResponseDeserializer> /** - * If an null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored + * If a null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored * @default NO */ @property (nonatomic, assign) BOOL treatNullAsError; diff --git a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache index 6f22dd8ab40..3b526da5fec 100644 --- a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache @@ -213,7 +213,7 @@ class ObjectSerializer * @param string[] $httpHeaders HTTP headers * @param string $discriminator discriminator if polymorphism is used * - * @return object|array|null an single or an array of $class instances + * @return object|array|null a single or an array of $class instances */ public static function deserialize($data, $class, $httpHeaders = null) { diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index b0442298283..61807efaec7 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -552,7 +552,7 @@ class ApiClient(object): return data def __deserialize_object(self, value): - """Return a original value. + """Return an original value. :return: object. """ diff --git a/modules/openapi-generator/src/main/resources/tizen/Doxyfile.mustache b/modules/openapi-generator/src/main/resources/tizen/Doxyfile.mustache index f306cd7bcf6..a1bae5840c6 100644 --- a/modules/openapi-generator/src/main/resources/tizen/Doxyfile.mustache +++ b/modules/openapi-generator/src/main/resources/tizen/Doxyfile.mustache @@ -46,7 +46,7 @@ PROJECT_NUMBER = {{#openAPI}}{{#info}}{{version}}{{/info}}{{/openAPI}} PROJECT_BRIEF = "An SDK for creating client applications for {{#openAPI}}{{#info}}{{title}}{{/info}}{{/openAPI}} on Tizen Platform (http://tizen.org/)" -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# With the PROJECT_LOGO tag one can specify a logo or icon that is included in # the documentation. The maximum height of the logo should not exceed 55 pixels # and the maximum width should not exceed 200 pixels. Doxygen will copy the logo # to the output directory. diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/README.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/README.mustache index 0139231eaff..4cf502cb67a 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/README.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/README.mustache @@ -19,7 +19,7 @@ It can be used in both TypeScript and JavaScript. In TypeScript, the definition ### Building -To build an compile the typescript sources to javascript use: +To build and compile the typescript sources to javascript use: ``` npm install npm run build diff --git a/modules/openapi-generator/src/main/resources/typescript-inversify/README.mustache b/modules/openapi-generator/src/main/resources/typescript-inversify/README.mustache index 4da4e854d96..2156b184ba4 100644 --- a/modules/openapi-generator/src/main/resources/typescript-inversify/README.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-inversify/README.mustache @@ -2,7 +2,7 @@ ### Building -To build an compile the typescript sources to javascript use: +To build and compile the typescript sources to javascript use: ``` npm install npm run build diff --git a/modules/openapi-generator/src/main/resources/typescript-jquery/README.mustache b/modules/openapi-generator/src/main/resources/typescript-jquery/README.mustache index 31fe0fd5b00..ef14fdbbf33 100644 --- a/modules/openapi-generator/src/main/resources/typescript-jquery/README.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-jquery/README.mustache @@ -19,7 +19,7 @@ It can be used in both TypeScript and JavaScript. In TypeScript, the definition ### Building -To build an compile the typescript sources to javascript use: +To build and compile the typescript sources to javascript use: ``` npm install npm run build diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CSharpModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CSharpModelTest.java index 9aba711b9f4..0232ec3e7b5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CSharpModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CSharpModelTest.java @@ -322,7 +322,7 @@ public class CSharpModelTest { Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1); } - @Test(description = "convert an map model") + @Test(description = "convert a map model") public void mapModelTest() { final Schema schema = new Schema() .description("a map model") diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoModelTest.java index 5f67a83299a..55e71df8aef 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoModelTest.java @@ -238,7 +238,7 @@ public class GoModelTest { Assert.assertEquals(cm.imports.size(), 1); } - @Test(description = "convert an map model") + @Test(description = "convert a map model") public void mapModelTest() { final Schema model = new Schema() .additionalProperties(new Schema().$ref("#/definitions/Children")) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java index 96bc926f188..701d90fa0a7 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java @@ -384,17 +384,17 @@ public class JavaModelTest { Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("ApiModel", "List", "ArrayList", "Children")).size(), 4); } - @Test(description = "convert an map model") + @Test(description = "convert a map model") public void mapModelTest() { final Schema schema = new Schema() - .description("an map model") + .description("a map model") .additionalProperties(new Schema().$ref("#/components/schemas/Children")); final DefaultCodegen codegen = new JavaClientCodegen(); final CodegenModel cm = codegen.fromModel("sample", schema, Collections.singletonMap("sample", schema)); Assert.assertEquals(cm.name, "sample"); Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "an map model"); + Assert.assertEquals(cm.description, "a map model"); Assert.assertEquals(cm.vars.size(), 0); Assert.assertEquals(cm.parent, "HashMap"); Assert.assertEquals(cm.imports.size(), 4); @@ -1007,7 +1007,7 @@ public class JavaModelTest { Assert.assertTrue(co.imports.contains("Pet")); } - @Test(description = "convert an array schema in a ApiResponse") + @Test(description = "convert an array schema in an ApiResponse") public void arraySchemaTestInOperationResponse() { final Schema testSchema = new ArraySchema() .items(new Schema<>().$ref("#/components/schemas/Pet")); @@ -1029,7 +1029,7 @@ public class JavaModelTest { Assert.assertTrue(co.imports.contains("Pet")); } - @Test(description = "convert a array of array schema") + @Test(description = "convert an array of array schema") public void arrayOfArraySchemaTest() { final Schema testSchema = new ObjectSchema() .addProperties("pets", new ArraySchema() @@ -1087,7 +1087,7 @@ public class JavaModelTest { Assert.assertTrue(co.imports.contains("List")); } - @Test(description = "convert a array schema in a ApiResponse") + @Test(description = "convert an array schema in an ApiResponse") public void arrayOfArraySchemaTestInOperationResponse() { final Schema testSchema = new ArraySchema() .items(new ArraySchema() 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 4a4aac68d21..99279bd2f10 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 @@ -47,7 +47,7 @@ import java.util.Map; @SuppressWarnings("static-method") public class ObjcModelTest { - @Test(description = "convert a model with a advanced map property") + @Test(description = "convert a model with an advanced map property") public void advancedMapPropertyTest() { final Schema model = new Schema() .description("a sample model") @@ -282,7 +282,7 @@ public class ObjcModelTest { Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("OAIChildren")).size(), 1); } - @Test(description = "convert an map model") + @Test(description = "convert a map model") public void mapModelTest() { final Schema model = new Schema() .description("a map model for testing ObjC generator") diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpModelTest.java index 8e496e294a8..27f76bc236c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpModelTest.java @@ -255,7 +255,7 @@ public class PhpModelTest { // skip import test as import is not used by PHP codegen } - @Test(description = "convert an map model") + @Test(description = "convert a map model") public void mapModelTest() { final Schema model = new Schema() .description("a map model") diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonTest.java index 105eded56fc..655ed844b4d 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonTest.java @@ -272,7 +272,7 @@ public class PythonTest { } // should not start with 'null'. need help from the community to investigate further - @Test(description = "convert an map model") + @Test(description = "convert a map model") public void mapModelTest() { final Schema model = new Schema() .description("a map model") diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientCodegenTest.java index cd08c59cb5b..acc12cc6d4a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientCodegenTest.java @@ -251,7 +251,7 @@ public class ScalaAkkaClientCodegenTest { Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("ListBuffer", "Children")).size(), 2); } - @Test(description = "convert an map model") + @Test(description = "convert a map model") public void mapModelTest() { final Schema model = new Schema() .description("a map model") diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalahttpclient/ScalaHttpClientModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalahttpclient/ScalaHttpClientModelTest.java index 092e800b07b..db217b409ff 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalahttpclient/ScalaHttpClientModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalahttpclient/ScalaHttpClientModelTest.java @@ -250,7 +250,7 @@ public class ScalaHttpClientModelTest { Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("ListBuffer", "Children")).size(), 2); } - @Test(description = "convert an map model") + @Test(description = "convert a map model") public void mapModelTest() { final Schema model = new Schema() .description("a map model") diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/ModelUtilsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/ModelUtilsTest.java index 9927008ffd9..ac9648e0243 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/ModelUtilsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/ModelUtilsTest.java @@ -92,11 +92,11 @@ public class ModelUtilsTest { final OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/unusedSchemas.yaml", null, new ParseOptions()).getOpenAPI(); List unusedSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI); Assert.assertEquals(unusedSchemas.size(), 3); - //SomeObj2 is only used in a 'application/x-www-form-urlencoded' request + //SomeObj2 is only used in an 'application/x-www-form-urlencoded' request Assert.assertTrue(unusedSchemas.contains("SomeObj2"), "contains 'SomeObj2'"); //SomeObj3 is only used in a 'multipart/form-data' request Assert.assertTrue(unusedSchemas.contains("SomeObj3"), "contains 'SomeObj3'"); - //SomeObj7 is only used in a 'application/x-www-form-urlencoded' request (with referenced request body) + //SomeObj7 is only used in an 'application/x-www-form-urlencoded' request (with referenced request body) Assert.assertTrue(unusedSchemas.contains("SomeObj7"), "contains 'SomeObj7'"); } diff --git a/modules/openapi-generator/src/test/resources/2_0/swift4Test.json b/modules/openapi-generator/src/test/resources/2_0/swift4Test.json index c2f217bf84e..f5e60112f05 100644 --- a/modules/openapi-generator/src/test/resources/2_0/swift4Test.json +++ b/modules/openapi-generator/src/test/resources/2_0/swift4Test.json @@ -377,7 +377,7 @@ }, "SampleBase": { "type": "object", - "description": "This is an base class object from which other classes will derive.", + "description": "This is a base class object from which other classes will derive.", "properties": { "baseClassStringProp": { "type": "string" @@ -389,7 +389,7 @@ } }, "SampleSubClass": { - "description": "This is an subclass defived from the SampleBase class.", + "description": "This is a subclass defived from the SampleBase class.", "allOf": [ { "$ref": "#/definitions/SampleBase" @@ -423,7 +423,7 @@ } }, "PersonCard": { - "description": "This is an card object for a Person derived from BaseCard.", + "description": "This is a card object for a Person derived from BaseCard.", "x-unit-tests": ["B45"], "allOf": [ { @@ -443,7 +443,7 @@ ] }, "PlaceCard": { - "description": "This is an card object for a Person derived from BaseCard.", + "description": "This is a card object for a Person derived from BaseCard.", "x-unit-tests": ["B45"], "allOf": [ { diff --git a/modules/openapi-generator/src/test/resources/integrationtests/typescript/additional-properties-expected/README.md b/modules/openapi-generator/src/test/resources/integrationtests/typescript/additional-properties-expected/README.md index 654efaf000b..3ae010d2a43 100644 --- a/modules/openapi-generator/src/test/resources/integrationtests/typescript/additional-properties-expected/README.md +++ b/modules/openapi-generator/src/test/resources/integrationtests/typescript/additional-properties-expected/README.md @@ -2,7 +2,7 @@ ### Building -To build an compile the typescript sources to javascript use: +To build and compile the typescript sources to javascript use: ``` npm install npm run build @@ -41,4 +41,4 @@ import { BASE_PATH } from './path-to-swagger-gen-service/index'; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); -``` \ No newline at end of file +``` diff --git a/modules/openapi-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/README.md b/modules/openapi-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/README.md index fbcbf6e6dcd..0dead26a31e 100644 --- a/modules/openapi-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/README.md +++ b/modules/openapi-generator/src/test/resources/integrationtests/typescript/array-and-object-expected/README.md @@ -2,7 +2,7 @@ ### Building -To build an compile the typescript sources to javascript use: +To build and compile the typescript sources to javascript use: ``` npm install npm run build @@ -41,4 +41,4 @@ import { BASE_PATH } from './path-to-swagger-gen-service/index'; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); -``` \ No newline at end of file +``` diff --git a/modules/openapi-generator/src/test/resources/integrationtests/typescript/petstore-expected/README.md b/modules/openapi-generator/src/test/resources/integrationtests/typescript/petstore-expected/README.md index 3f1d74e23e8..25b7aaaf39a 100644 --- a/modules/openapi-generator/src/test/resources/integrationtests/typescript/petstore-expected/README.md +++ b/modules/openapi-generator/src/test/resources/integrationtests/typescript/petstore-expected/README.md @@ -2,7 +2,7 @@ ### Building -To build an compile the typescript sources to javascript use: +To build and compile the typescript sources to javascript use: ``` npm install npm run build @@ -41,4 +41,4 @@ import { BASE_PATH } from './path-to-swagger-gen-service/index'; bootstrap(AppComponent, [ { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, ]); -``` \ No newline at end of file +``` diff --git a/shippable.yml b/shippable.yml index 686b1ecc1ed..937c34b9ff3 100644 --- a/shippable.yml +++ b/shippable.yml @@ -13,7 +13,7 @@ build: - mvn --quiet clean install # ensure all modifications created by 'mature' generators are in the git repo - ./bin/utils/ensure-up-to-date - # prepare enviroment for tests + # prepare environment for tests - sudo apt-get update -qq # install stack - curl -sSL https://get.haskellstack.org/ | sh From 53d9878cf280caaa9285f109b231997ba6d43f6b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 17 Jun 2018 01:33:36 +0800 Subject: [PATCH 03/35] Update Petstore samples (#331) * Grammar and spelling fixes * update petstore samples --- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- .../petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php | 2 +- samples/server/petstore/springboot-beanvalidation/README.md | 2 +- samples/server/petstore/springboot-delegate-j8/README.md | 2 +- samples/server/petstore/springboot-delegate/README.md | 2 +- samples/server/petstore/springboot-implicitHeaders/README.md | 2 +- samples/server/petstore/springboot-reactive/README.md | 2 +- samples/server/petstore/springboot-useoptional/README.md | 2 +- samples/server/petstore/springboot/README.md | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java index b77423e8cac..86ce63c9b93 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java @@ -897,7 +897,7 @@ public class ApiClient { * @param Type * @param response Response * @param returnType Return type - * @throws ApiException If the response has a unsuccessful status code or + * @throws ApiException If the response has an unsuccessful status code or * fail to deserialize the response body * @return Type */ diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java index b77423e8cac..86ce63c9b93 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java @@ -897,7 +897,7 @@ public class ApiClient { * @param Type * @param response Response * @param returnType Return type - * @throws ApiException If the response has a unsuccessful status code or + * @throws ApiException If the response has an unsuccessful status code or * fail to deserialize the response body * @return Type */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 71906b46cd5..db5916b2808 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -223,7 +223,7 @@ class ObjectSerializer * @param string[] $httpHeaders HTTP headers * @param string $discriminator discriminator if polymorphism is used * - * @return object|array|null an single or an array of $class instances + * @return object|array|null a single or an array of $class instances */ public static function deserialize($data, $class, $httpHeaders = null) { diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 71906b46cd5..db5916b2808 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -223,7 +223,7 @@ class ObjectSerializer * @param string[] $httpHeaders HTTP headers * @param string $discriminator discriminator if polymorphism is used * - * @return object|array|null an single or an array of $class instances + * @return object|array|null a single or an array of $class instances */ public static function deserialize($data, $class, $httpHeaders = null) { diff --git a/samples/server/petstore/springboot-beanvalidation/README.md b/samples/server/petstore/springboot-beanvalidation/README.md index 44429ae9238..3ea6a97db1b 100644 --- a/samples/server/petstore/springboot-beanvalidation/README.md +++ b/samples/server/petstore/springboot-beanvalidation/README.md @@ -10,7 +10,7 @@ This is an example of building a OpenAPI-enabled server in Java using the Spring The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) -Start your server as an simple java application +Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to http://localhost:80/ diff --git a/samples/server/petstore/springboot-delegate-j8/README.md b/samples/server/petstore/springboot-delegate-j8/README.md index 44429ae9238..3ea6a97db1b 100644 --- a/samples/server/petstore/springboot-delegate-j8/README.md +++ b/samples/server/petstore/springboot-delegate-j8/README.md @@ -10,7 +10,7 @@ This is an example of building a OpenAPI-enabled server in Java using the Spring The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) -Start your server as an simple java application +Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to http://localhost:80/ diff --git a/samples/server/petstore/springboot-delegate/README.md b/samples/server/petstore/springboot-delegate/README.md index 44429ae9238..3ea6a97db1b 100644 --- a/samples/server/petstore/springboot-delegate/README.md +++ b/samples/server/petstore/springboot-delegate/README.md @@ -10,7 +10,7 @@ This is an example of building a OpenAPI-enabled server in Java using the Spring The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) -Start your server as an simple java application +Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to http://localhost:80/ diff --git a/samples/server/petstore/springboot-implicitHeaders/README.md b/samples/server/petstore/springboot-implicitHeaders/README.md index 44429ae9238..3ea6a97db1b 100644 --- a/samples/server/petstore/springboot-implicitHeaders/README.md +++ b/samples/server/petstore/springboot-implicitHeaders/README.md @@ -10,7 +10,7 @@ This is an example of building a OpenAPI-enabled server in Java using the Spring The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) -Start your server as an simple java application +Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to http://localhost:80/ diff --git a/samples/server/petstore/springboot-reactive/README.md b/samples/server/petstore/springboot-reactive/README.md index c24c6206ab1..04666708ae5 100644 --- a/samples/server/petstore/springboot-reactive/README.md +++ b/samples/server/petstore/springboot-reactive/README.md @@ -8,6 +8,6 @@ This server was generated by the [OpenAPI Generator](https://openapi-generator.t By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. -Start your server as an simple java application +Start your server as a simple java application Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-useoptional/README.md b/samples/server/petstore/springboot-useoptional/README.md index 44429ae9238..3ea6a97db1b 100644 --- a/samples/server/petstore/springboot-useoptional/README.md +++ b/samples/server/petstore/springboot-useoptional/README.md @@ -10,7 +10,7 @@ This is an example of building a OpenAPI-enabled server in Java using the Spring The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) -Start your server as an simple java application +Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to http://localhost:80/ diff --git a/samples/server/petstore/springboot/README.md b/samples/server/petstore/springboot/README.md index 44429ae9238..3ea6a97db1b 100644 --- a/samples/server/petstore/springboot/README.md +++ b/samples/server/petstore/springboot/README.md @@ -10,7 +10,7 @@ This is an example of building a OpenAPI-enabled server in Java using the Spring The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox) -Start your server as an simple java application +Start your server as a simple java application You can view the api documentation in swagger-ui by pointing to http://localhost:80/ From c607ea8b31d1aca7e5c5323f0aeb9e5dc6709970 Mon Sep 17 00:00:00 2001 From: delenius Date: Sat, 16 Jun 2018 10:59:23 -0700 Subject: [PATCH 04/35] Add fixes for es6 generator (#180) Various fixes for JS (ES6) generator --- .../languages/JavascriptClientCodegen.java | 5 + .../main/resources/Javascript/api.mustache | 2 +- .../Javascript/es6/ApiClient.mustache | 77 ++-- .../resources/Javascript/es6/api.mustache | 2 +- .../resources/Javascript/es6/model.mustache | 7 +- .../es6/partial_model_enum_class.mustache | 2 +- .../es6/partial_model_generic.mustache | 161 ++++--- .../es6/partial_model_inner_enum.mustache | 28 +- pom.xml | 39 ++ .../client/petstore/javascript-es6/pom.xml | 45 ++ .../petstore/javascript-es6/src/ApiClient.js | 77 ++-- .../javascript-es6/src/api/FakeApi.js | 6 +- .../src/api/Fake_classname_tags123Api.js | 82 ---- .../javascript-es6/src/api/StoreApi.js | 2 +- .../javascript-es6/src/api/UserApi.js | 2 +- .../src/model/AdditionalPropertiesClass.js | 88 ++-- .../javascript-es6/src/model/Animal.js | 93 ++--- .../javascript-es6/src/model/AnimalFarm.js | 70 ++-- .../javascript-es6/src/model/ApiResponse.js | 97 ++--- .../src/model/ArrayOfArrayOfNumberOnly.js | 79 ++-- .../src/model/ArrayOfNumberOnly.js | 79 ++-- .../javascript-es6/src/model/ArrayTest.js | 97 ++--- .../src/model/Capitalization.js | 126 +++--- .../petstore/javascript-es6/src/model/Cat.js | 107 +++-- .../javascript-es6/src/model/Category.js | 88 ++-- .../javascript-es6/src/model/ClassModel.js | 81 ++-- .../javascript-es6/src/model/Client.js | 79 ++-- .../petstore/javascript-es6/src/model/Dog.js | 107 +++-- .../javascript-es6/src/model/EnumArrays.js | 170 ++++---- .../javascript-es6/src/model/EnumClass.js | 10 +- .../javascript-es6/src/model/EnumTest.js | 306 +++++++------- .../javascript-es6/src/model/FormatTest.js | 199 ++++----- .../src/model/HasOnlyReadOnly.js | 88 ++-- .../petstore/javascript-es6/src/model/List.js | 79 ++-- .../javascript-es6/src/model/MapTest.js | 129 +++--- ...dPropertiesAndAdditionalPropertiesClass.js | 97 ++--- .../src/model/Model200Response.js | 90 ++-- .../javascript-es6/src/model/ModelReturn.js | 81 ++-- .../petstore/javascript-es6/src/model/Name.js | 111 +++-- .../javascript-es6/src/model/NumberOnly.js | 79 ++-- .../javascript-es6/src/model/Order.js | 181 ++++---- .../javascript-es6/src/model/OuterBoolean.js | 73 ---- .../src/model/OuterComposite.js | 97 ++--- .../javascript-es6/src/model/OuterEnum.js | 10 +- .../javascript-es6/src/model/OuterNumber.js | 73 ---- .../javascript-es6/src/model/OuterString.js | 73 ---- .../petstore/javascript-es6/src/model/Pet.js | 185 ++++----- .../javascript-es6/src/model/ReadOnlyFirst.js | 88 ++-- .../src/model/SpecialModelName.js | 79 ++-- .../petstore/javascript-es6/src/model/Tag.js | 88 ++-- .../petstore/javascript-es6/src/model/User.js | 144 ++++--- .../javascript-es6/src/test/ApiClientTest.js | 393 ++++++++++++++++++ .../src/test/api/AnotherFakeApi.spec.js | 63 +++ .../src/test/api/FakeApi.spec.js | 123 ++++++ .../test/api/FakeClassnameTags123Api.spec.js | 63 +++ .../src/test/api/PetApi.spec.js | 133 ++++++ .../src/test/api/StoreApi.spec.js | 93 +++++ .../src/test/api/UserApi.spec.js | 133 ++++++ .../model/AdditionalPropertiesClass.spec.js | 71 ++++ .../src/test/model/Animal.spec.js | 71 ++++ .../src/test/model/AnimalFarm.spec.js | 59 +++ .../src/test/model/ApiResponse.spec.js | 77 ++++ .../model/ArrayOfArrayOfNumberOnly.spec.js | 65 +++ .../src/test/model/ArrayOfNumberOnly.spec.js | 65 +++ .../src/test/model/ArrayTest.spec.js | 77 ++++ .../src/test/model/Capitalization.spec.js | 95 +++++ .../javascript-es6/src/test/model/Cat.spec.js | 65 +++ .../src/test/model/Category.spec.js | 71 ++++ .../src/test/model/ClassModel.spec.js | 65 +++ .../src/test/model/Client.spec.js | 65 +++ .../javascript-es6/src/test/model/Dog.spec.js | 65 +++ .../src/test/model/EnumArrays.spec.js | 71 ++++ .../src/test/model/EnumClass.spec.js | 58 +++ .../src/test/model/EnumTest.spec.js | 83 ++++ .../src/test/model/FormatTest.spec.js | 137 ++++++ .../src/test/model/HasOnlyReadOnly.spec.js | 71 ++++ .../src/test/model/List.spec.js | 65 +++ .../src/test/model/MapTest.spec.js | 71 ++++ ...ertiesAndAdditionalPropertiesClass.spec.js | 77 ++++ .../src/test/model/Model200Response.spec.js | 71 ++++ .../src/test/model/ModelReturn.spec.js | 65 +++ .../src/test/model/Name.spec.js | 83 ++++ .../src/test/model/NumberOnly.spec.js | 65 +++ .../src/test/model/Order.spec.js | 95 +++++ .../src/test/model/OuterBoolean.spec.js | 60 +++ .../src/test/model/OuterComposite.spec.js | 77 ++++ .../src/test/model/OuterEnum.spec.js | 58 +++ .../src/test/model/OuterNumber.spec.js | 60 +++ .../src/test/model/OuterString.spec.js | 60 +++ .../javascript-es6/src/test/model/Pet.spec.js | 95 +++++ .../src/test/model/ReadOnlyFirst.spec.js | 71 ++++ .../src/test/model/SpecialModelName.spec.js | 65 +++ .../javascript-es6/src/test/model/Tag.spec.js | 71 ++++ .../src/test/model/User.spec.js | 107 +++++ .../javascript-es6/test/ApiClientTest.js | 393 ++++++++++++++++++ .../test/api/AnotherFakeApi.spec.js | 14 +- .../javascript-es6/test/api/FakeApi.spec.js | 44 +- .../test/api/FakeClassnameTags123Api.spec.js | 14 +- .../javascript-es6/test/api/PetApi.spec.js | 14 +- .../javascript-es6/test/api/StoreApi.spec.js | 14 +- .../javascript-es6/test/api/UserApi.spec.js | 14 +- .../model/AdditionalPropertiesClass.spec.js | 22 +- .../javascript-es6/test/model/Animal.spec.js | 22 +- .../test/model/AnimalFarm.spec.js | 18 +- .../test/model/ApiResponse.spec.js | 24 +- .../model/ArrayOfArrayOfNumberOnly.spec.js | 20 +- .../test/model/ArrayOfNumberOnly.spec.js | 20 +- .../test/model/ArrayTest.spec.js | 24 +- .../test/model/Capitalization.spec.js | 30 +- .../javascript-es6/test/model/Cat.spec.js | 20 +- .../test/model/Category.spec.js | 22 +- .../test/model/ClassModel.spec.js | 20 +- .../javascript-es6/test/model/Client.spec.js | 20 +- .../javascript-es6/test/model/Dog.spec.js | 20 +- .../test/model/EnumArrays.spec.js | 22 +- .../test/model/EnumClass.spec.js | 16 +- .../test/model/EnumTest.spec.js | 32 +- .../test/model/FormatTest.spec.js | 44 +- .../test/model/HasOnlyReadOnly.spec.js | 22 +- .../javascript-es6/test/model/List.spec.js | 24 +- .../javascript-es6/test/model/MapTest.spec.js | 22 +- ...ertiesAndAdditionalPropertiesClass.spec.js | 24 +- .../test/model/Model200Response.spec.js | 22 +- .../test/model/ModelReturn.spec.js | 20 +- .../javascript-es6/test/model/Name.spec.js | 30 +- .../test/model/NumberOnly.spec.js | 20 +- .../javascript-es6/test/model/Order.spec.js | 30 +- .../test/model/OuterBoolean.spec.js | 3 +- .../test/model/OuterComposite.spec.js | 24 +- .../test/model/OuterEnum.spec.js | 16 +- .../test/model/OuterNumber.spec.js | 3 +- .../test/model/OuterString.spec.js | 3 +- .../javascript-es6/test/model/Pet.spec.js | 30 +- .../test/model/ReadOnlyFirst.spec.js | 22 +- .../test/model/SpecialModelName.spec.js | 20 +- .../javascript-es6/test/model/Tag.spec.js | 22 +- .../javascript-es6/test/model/User.spec.js | 34 +- .../petstore/javascript-promise-es6/pom.xml | 6 +- .../javascript-promise-es6/src/ApiClient.js | 77 ++-- .../javascript-promise-es6/src/api/FakeApi.js | 6 +- .../src/api/Fake_classname_tags123Api.js | 86 ---- .../src/api/StoreApi.js | 2 +- .../javascript-promise-es6/src/api/UserApi.js | 2 +- .../src/model/AdditionalPropertiesClass.js | 88 ++-- .../src/model/Animal.js | 93 ++--- .../src/model/AnimalFarm.js | 70 ++-- .../src/model/ApiResponse.js | 97 ++--- .../src/model/ArrayOfArrayOfNumberOnly.js | 79 ++-- .../src/model/ArrayOfNumberOnly.js | 79 ++-- .../src/model/ArrayTest.js | 97 ++--- .../src/model/Capitalization.js | 126 +++--- .../javascript-promise-es6/src/model/Cat.js | 107 +++-- .../src/model/Category.js | 88 ++-- .../src/model/ClassModel.js | 81 ++-- .../src/model/Client.js | 79 ++-- .../javascript-promise-es6/src/model/Dog.js | 107 +++-- .../src/model/EnumArrays.js | 170 ++++---- .../src/model/EnumClass.js | 10 +- .../src/model/EnumTest.js | 306 +++++++------- .../src/model/FormatTest.js | 199 ++++----- .../src/model/HasOnlyReadOnly.js | 88 ++-- .../javascript-promise-es6/src/model/List.js | 79 ++-- .../src/model/MapTest.js | 129 +++--- ...dPropertiesAndAdditionalPropertiesClass.js | 97 ++--- .../src/model/Model200Response.js | 90 ++-- .../src/model/ModelReturn.js | 81 ++-- .../javascript-promise-es6/src/model/Name.js | 111 +++-- .../src/model/NumberOnly.js | 79 ++-- .../javascript-promise-es6/src/model/Order.js | 181 ++++---- .../src/model/OuterBoolean.js | 73 ---- .../src/model/OuterComposite.js | 97 ++--- .../src/model/OuterEnum.js | 10 +- .../src/model/OuterNumber.js | 73 ---- .../src/model/OuterString.js | 73 ---- .../javascript-promise-es6/src/model/Pet.js | 185 ++++----- .../src/model/ReadOnlyFirst.js | 88 ++-- .../src/model/SpecialModelName.js | 79 ++-- .../javascript-promise-es6/src/model/Tag.js | 88 ++-- .../javascript-promise-es6/src/model/User.js | 144 ++++--- .../test/ApiClientTest.js | 393 ++++++++++++++++++ .../test/model/OuterBoolean.spec.js | 3 +- .../test/model/OuterNumber.spec.js | 3 +- .../test/model/OuterString.spec.js | 3 +- .../petstore/javascript-promise/pom.xml | 6 +- .../javascript-promise/src/api/FakeApi.js | 6 +- .../javascript-promise/src/api/StoreApi.js | 2 +- .../javascript-promise/src/api/UserApi.js | 2 +- .../javascript-promise/test/ApiClientTest.js | 3 +- .../test/model/OuterBoolean.spec.js | 3 +- .../test/model/OuterNumber.spec.js | 3 +- .../test/model/OuterString.spec.js | 3 +- .../petstore/javascript/src/api/FakeApi.js | 6 +- .../petstore/javascript/src/api/StoreApi.js | 2 +- .../petstore/javascript/src/api/UserApi.js | 2 +- 194 files changed, 8532 insertions(+), 5008 deletions(-) create mode 100644 samples/client/petstore/javascript-es6/pom.xml delete mode 100644 samples/client/petstore/javascript-es6/src/api/Fake_classname_tags123Api.js delete mode 100644 samples/client/petstore/javascript-es6/src/model/OuterBoolean.js delete mode 100644 samples/client/petstore/javascript-es6/src/model/OuterNumber.js delete mode 100644 samples/client/petstore/javascript-es6/src/model/OuterString.js create mode 100644 samples/client/petstore/javascript-es6/src/test/ApiClientTest.js create mode 100644 samples/client/petstore/javascript-es6/src/test/api/AnotherFakeApi.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/api/FakeApi.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/api/FakeClassnameTags123Api.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/api/PetApi.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/api/StoreApi.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/api/UserApi.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/AdditionalPropertiesClass.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Animal.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/AnimalFarm.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/ApiResponse.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/ArrayOfArrayOfNumberOnly.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/ArrayOfNumberOnly.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/ArrayTest.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Capitalization.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Cat.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Category.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/ClassModel.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Client.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Dog.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/EnumArrays.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/EnumClass.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/EnumTest.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/FormatTest.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/HasOnlyReadOnly.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/List.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/MapTest.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/MixedPropertiesAndAdditionalPropertiesClass.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Model200Response.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/ModelReturn.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Name.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/NumberOnly.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Order.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/OuterBoolean.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/OuterComposite.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/OuterEnum.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/OuterNumber.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/OuterString.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Pet.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/ReadOnlyFirst.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/SpecialModelName.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/Tag.spec.js create mode 100644 samples/client/petstore/javascript-es6/src/test/model/User.spec.js create mode 100644 samples/client/petstore/javascript-es6/test/ApiClientTest.js delete mode 100644 samples/client/petstore/javascript-promise-es6/src/api/Fake_classname_tags123Api.js delete mode 100644 samples/client/petstore/javascript-promise-es6/src/model/OuterBoolean.js delete mode 100644 samples/client/petstore/javascript-promise-es6/src/model/OuterNumber.js delete mode 100644 samples/client/petstore/javascript-promise-es6/src/model/OuterString.js create mode 100644 samples/client/petstore/javascript-promise-es6/test/ApiClientTest.js diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java index 75b07b266ff..198a9bff546 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java @@ -986,6 +986,11 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo } String jsdocType = getJSDocType(operation); operation.vendorExtensions.put("x-jsdoc-type", jsdocType); + + // Format the return type correctly + if (operation.returnType != null) { + operation.vendorExtensions.put("x-return-type", normalizeType(operation.returnType)); + } } } return objs; diff --git a/modules/openapi-generator/src/main/resources/Javascript/api.mustache b/modules/openapi-generator/src/main/resources/Javascript/api.mustache index fedb65f421b..089ae3b3283 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/api.mustache @@ -84,7 +84,7 @@ var authNames = [<#authMethods>''<#hasMore>, ]; var contentTypes = [<#consumes>'<& mediaType>'<#hasMore>, ]; var accepts = [<#produces>'<& mediaType>'<#hasMore>, ]; - var returnType = <#returnType><&returnType><^returnType>null; + var returnType = <#vendorExtensions.x-return-type><&vendorExtensions.x-return-type><^vendorExtensions.x-return-type>null; return this.apiClient.callApi( '<&path>', '', diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache index c3caec29101..7ba837e183d 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache @@ -15,7 +15,7 @@ import querystring from "querystring"; * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient * @class */{{/emitJSDoc}} -export default class ApiClient { +class ApiClient { constructor() { {{#emitJSDoc}}/** * The base URL against which to resolve every API call's (relative) path. @@ -221,43 +221,6 @@ export default class ApiClient { return newParams; } - {{#emitJSDoc}}/** - * Enumeration of collection format separator strategies. - * @enum {String} - * @readonly - */{{/emitJSDoc}} - static CollectionFormatEnum = { - {{#emitJSDoc}}/** - * Comma-separated values. Value: csv - * @const - */{{/emitJSDoc}} - CSV: ',', - - {{#emitJSDoc}}/** - * Space-separated values. Value: ssv - * @const - */{{/emitJSDoc}} - SSV: ' ', - - {{#emitJSDoc}}/** - * Tab-separated values. Value: tsv - * @const - */{{/emitJSDoc}} - TSV: '\t', - - {{#emitJSDoc}}/** - * Pipe(|)-separated values. Value: pipes - * @const - */{{/emitJSDoc}} - PIPES: '|', - - {{#emitJSDoc}}/** - * Native array. Value: multi - * @const - */{{/emitJSDoc}} - MULTI: 'multi' - }; - {{#emitJSDoc}}/** * Builds a string representation of an array-type actual parameter, according to the given collection format. * @param {Array} param An array parameter. @@ -597,8 +560,46 @@ export default class ApiClient { }; } +{{#emitJSDoc}}/** + * Enumeration of collection format separator strategies. + * @enum {String} + * @readonly + */{{/emitJSDoc}} +ApiClient.CollectionFormatEnum = { + {{#emitJSDoc}}/** + * Comma-separated values. Value: csv + * @const + */{{/emitJSDoc}} + CSV: ',', + + {{#emitJSDoc}}/** + * Space-separated values. Value: ssv + * @const + */{{/emitJSDoc}} + SSV: ' ', + + {{#emitJSDoc}}/** + * Tab-separated values. Value: tsv + * @const + */{{/emitJSDoc}} + TSV: '\t', + + {{#emitJSDoc}}/** + * Pipe(|)-separated values. Value: pipes + * @const + */{{/emitJSDoc}} + PIPES: '|', + + {{#emitJSDoc}}/** + * Native array. Value: multi + * @const + */{{/emitJSDoc}} + MULTI: 'multi' +}; + {{#emitJSDoc}}/** * The default API client implementation. * @type {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient} */{{/emitJSDoc}} ApiClient.instance = new ApiClient(); +export default ApiClient; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/api.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/api.mustache index 0615a0461d4..a6b7b0379cf 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/api.mustache @@ -69,7 +69,7 @@ export default class { let authNames = [<#authMethods>''<#hasMore>, ]; let contentTypes = [<#consumes>'<& mediaType>'<#hasMore>, ]; let accepts = [<#produces>'<& mediaType>'<#hasMore>, ]; - let returnType = <#returnType><&returnType><^returnType>null; + let returnType = <#vendorExtensions.x-return-type><&vendorExtensions.x-return-type><^vendorExtensions.x-return-type>null; return this.apiClient.callApi( '<&path>', '', diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/model.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/model.mustache index d45b6e9b673..3ddf83730f5 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/model.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/model.mustache @@ -1,9 +1,4 @@ {{>licenseInfo}} - import ApiClient from '../ApiClient'; {{#imports}}import {{import}} from './{{import}}'; -{{/imports}} - -{{#models}}{{#model}} -{{#isEnum}}{{>partial_model_enum_class}}{{/isEnum}}{{^isEnum}}{{>partial_model_generic}}{{/isEnum}} -{{/model}}{{/models}} +{{/imports}}{{#models}}{{#model}}{{#isEnum}}{{>partial_model_enum_class}}{{/isEnum}}{{^isEnum}}{{>partial_model_generic}}{{/isEnum}}{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_enum_class.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_enum_class.mustache index 5503ab886af..e88ddd9cfb5 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_enum_class.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_enum_class.mustache @@ -9,7 +9,7 @@ export default class {{classname}} { * value: {{{value}}} * @const */{{/emitJSDoc}} - {{name}} = {{{value}}}; + "{{name}}" = {{{value}}}; {{/enumVars}}{{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_generic.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_generic.mustache index bcfb59dbfdb..3b60625bd80 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_generic.mustache @@ -1,54 +1,49 @@ -{{#models}}{{#model}} - -{{#emitJSDoc}}/** -* The {{classname}} model module. -* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} -* @version {{projectVersion}} -*/{{/emitJSDoc}} -export default class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}}extends Array {{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}{ +{{#models}}{{#model}}{{#emitJSDoc}}/** + * The {{classname}} model module. + * @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} + * @version {{projectVersion}} + */{{/emitJSDoc}} +class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}}extends Array {{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}{ {{#emitJSDoc}}/** - * Constructs a new {{classname}}.{{#description}} - * {{description}}{{/description}} - * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} - * @class{{#useInheritance}}{{#parent}} - * @extends {{#parentModel}}module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-isArray}}Array{{/vendorExtensions.x-isArray}}{{#vendorExtensions.x-isMap}}Object{{/vendorExtensions.x-isMap}}{{/parentModel}}{{/parent}}{{#interfaces}} - * @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} - * @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{#description}}{{{description}}}{{/description}}{{/vendorExtensions.x-all-required}} - */{{/emitJSDoc}} - - constructor({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) { - {{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}} + * Constructs a new {{classname}}.{{#description}} + * {{description}}{{/description}} + * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{#useInheritance}}{{#parent}} + * @extends {{#parentModel}}module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-isArray}}Array{{/vendorExtensions.x-isArray}}{{#vendorExtensions.x-isMap}}Object{{/vendorExtensions.x-isMap}}{{/parentModel}}{{/parent}}{{#interfaces}} + * @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} + * @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{#description}}{{{description}}}{{/description}}{{/vendorExtensions.x-all-required}} + */{{/emitJSDoc}} + constructor({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) { {{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}} super(); - {{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}} - - {{#useInheritance}} - {{#parentModel}}{{classname}}.call(this{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}});{{/parentModel}} - {{#interfaceModels}}{{classname}}.call(this{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}});{{/interfaceModels}} - {{/useInheritance}} - - {{#vars}}{{#required}}this['{{baseName}}'] = {{name}};{{/required}}{{/vars}} - - {{#parent}}{{^parentModel}}return this;{{/parentModel}}{{/parent}} + {{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}{{#useInheritance}} + {{#interfaceModels}}{{classname}}.initialize(this{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}});{{/interfaceModels}}{{/useInheritance}} + {{classname}}.initialize(this{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}}); } {{#emitJSDoc}}/** - * Constructs a {{classname}} from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {{=< >=}}{module:<#invokerPackage>/<#modelPackage>/}<={{ }}=> obj Optional instance to populate. - * @return {{=< >=}}{module:<#invokerPackage>/<#modelPackage>/}<={{ }}=> The populated {{classname}} instance. - */{{/emitJSDoc}} + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */{{/emitJSDoc}} + static initialize(obj{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}}) { {{#vars}}{{#required}} + obj['{{baseName}}'] = {{name}};{{/required}}{{/vars}} + } + + {{#emitJSDoc}}/** + * Constructs a {{classname}} from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {{=< >=}}{module:<#invokerPackage>/<#modelPackage>/}<={{ }}=> obj Optional instance to populate. + * @return {{=< >=}}{module:<#invokerPackage>/<#modelPackage>/}<={{ }}=> The populated {{classname}} instance. + */{{/emitJSDoc}} static constructFromObject(data, obj) { if (data){{! TODO: support polymorphism: discriminator property on data determines class to instantiate.}} { - obj = obj || new {{classname}}(); + obj = obj || new {{classname}}();{{#parent}}{{^parentModel}} - {{#parent}}{{^parentModel}}ApiClient.constructFromObject(data, obj, '{{vendorExtensions.x-itemType}}');{{/parentModel}} - {{/parent}} - - {{#useInheritance}}{{#parentModel}}{{classname}}.constructFromObject(data, obj);{{/parentModel}} - {{#interfaces}}{{.}}.constructFromObject(data, obj);{{/interfaces}} - {{/useInheritance}} + ApiClient.constructFromObject(data, obj, '{{vendorExtensions.x-itemType}}'); + {{/parentModel}}{{/parent}}{{#useInheritance}}{{#parentModel}} + {{classname}}.constructFromObject(data, obj);{{/parentModel}}{{#interfaces}} + {{.}}.constructFromObject(data, obj);{{/interfaces}}{{/useInheritance}} {{#vars}} if (data.hasOwnProperty('{{baseName}}')) { @@ -59,61 +54,49 @@ export default class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtension return obj; } -{{#vars}} - {{#emitJSDoc}}/**{{#description}} - * {{{description}}}{{/description}} - * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}} - * @default {{{defaultValue}}}{{/defaultValue}} - */{{/emitJSDoc}} - {{baseName}} = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; -{{/vars}} - -{{#useInheritance}}{{#interfaceModels}} - // Implement {{classname}} interface: - {{#allVars}}{{#emitJSDoc}}/**{{#description}} - * {{{description}}}{{/description}} - * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}} - * @default {{{defaultValue}}}{{/defaultValue}} - */{{/emitJSDoc}} - {{baseName}} = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; - {{/allVars}} -{{/interfaceModels}}{{/useInheritance}} - - -{{#emitModelMethods}}{{#vars}} - {{#emitJSDoc}}/**{{#description}} - * Returns {{{description}}}{{/description}}{{#minimum}} - * minimum: {{minimum}}{{/minimum}}{{#maximum}} - * maximum: {{maximum}}{{/maximum}} - * @return {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> - */{{/emitJSDoc}} +{{#emitModelMethods}}{{#vars}}{{#emitJSDoc}}/**{{#description}} + * Returns {{{description}}}{{/description}}{{#minimum}} + * minimum: {{minimum}}{{/minimum}}{{#maximum}} + * maximum: {{maximum}}{{/maximum}} + * @return {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> + */{{/emitJSDoc}} {{getter}}() { return this.{{baseName}}; } {{#emitJSDoc}}/**{{#description}} - * Sets {{{description}}}{{/description}} - * @param {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{name}}{{#description}} {{{description}}}{{/description}} - */{{/emitJSDoc}} + * Sets {{{description}}}{{/description}} + * @param {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{name}}{{#description}} {{{description}}}{{/description}} + */{{/emitJSDoc}} {{setter}}({{name}}) { this['{{baseName}}'] = {{name}}; } -{{/vars}}{{/emitModelMethods}} +{{/vars}}{{/emitModelMethods}}{{/model}} +} + +{{#vars}}{{#emitJSDoc}}/**{{#description}} + * {{{description}}}{{/description}} + * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}} + * @default {{{defaultValue}}}{{/defaultValue}} + */{{/emitJSDoc}} +{{classname}}.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; -{{#vars}} -{{#isEnum}} -{{^isContainer}} -{{>partial_model_inner_enum}} -{{/isContainer}} -{{/isEnum}} -{{#items.isEnum}} -{{#items}} -{{^isContainer}} -{{>partial_model_inner_enum}} -{{/isContainer}} -{{/items}} -{{/items.isEnum}} {{/vars}} -{{/model}}{{/models}} -} +{{#useInheritance}}{{#interfaceModels}}// Implement {{classname}} interface: +{{#allVars}}{{#emitJSDoc}}/**{{#description}} + * {{{description}}}{{/description}} + * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}} + * @default {{{defaultValue}}}{{/defaultValue}} + */{{/emitJSDoc}} +{{classname}}.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; +{{/allVars}}{{/interfaceModels}}{{/useInheritance}} + +{{#vars}}{{#isEnum}}{{^isContainer}} +{{>partial_model_inner_enum}} +{{/isContainer}}{{/isEnum}}{{#items.isEnum}}{{#items}}{{^isContainer}} +{{>partial_model_inner_enum}} +{{/isContainer}}{{/items}}{{/items.isEnum}}{{/vars}} + +export default {{classname}}; +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_inner_enum.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_inner_enum.mustache index 521e497ba0c..17cea4407d5 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_inner_enum.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_inner_enum.mustache @@ -1,15 +1,15 @@ +{{#emitJSDoc}}/** + * Allowed values for the {{baseName}} property. + * @enum {{=<% %>=}}{<%datatype%>}<%={{ }}=%> + * @readonly + */{{/emitJSDoc}} +{{classname}}['{{datatypeWithEnum}}'] = { +{{#allowableValues}}{{#enumVars}} {{#emitJSDoc}}/** - * Allowed values for the {{baseName}} property. - * @enum {{=<% %>=}}{<%datatype%>}<%={{ }}=%> - * @readonly - */{{/emitJSDoc}} - static {{datatypeWithEnum}} = { - {{#allowableValues}}{{#enumVars}} - {{#emitJSDoc}}/** - * value: {{{value}}} - * @const - */{{/emitJSDoc}} - "{{name}}": {{{value}}}{{^-last}}, - {{/-last}} - {{/enumVars}}{{/allowableValues}} - }; + * value: {{{value}}} + * @const + */{{/emitJSDoc}} + "{{name}}": {{{value}}}{{^-last}}, + {{/-last}} +{{/enumVars}}{{/allowableValues}} +}; diff --git a/pom.xml b/pom.xml index 24acb59feb5..e52007824c9 100644 --- a/pom.xml +++ b/pom.xml @@ -571,6 +571,42 @@ samples/client/petstore/javascript + + javascript-client-es6 + + + env + javascript + + + + samples/client/petstore/javascript-es6 + + + + javascript-client-promise + + + env + javascript + + + + samples/client/petstore/javascript-promise + + + + javascript-client-promise-es6 + + + env + javascript + + + + samples/client/petstore/javascript-promise-es6 + + scala-client @@ -904,6 +940,9 @@ samples/client/petstore/scala samples/client/petstore/akka-scala samples/client/petstore/javascript + samples/client/petstore/javascript-es6 + samples/client/petstore/javascript-promise + samples/client/petstore/javascript-promise-es6 samples/client/petstore/python samples/client/petstore/python-tornado samples/client/petstore/python-asyncio diff --git a/samples/client/petstore/javascript-es6/pom.xml b/samples/client/petstore/javascript-es6/pom.xml new file mode 100644 index 00000000000..66f75f962f9 --- /dev/null +++ b/samples/client/petstore/javascript-es6/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + org.openapitools + openapi-petstore-javascript-es6 + pom + 1.0-SNAPSHOT + OpenAPI Petstore JS Client (ES6) + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + npm-install + pre-integration-test + + exec + + + npm + + install + + + + + mocha + integration-test + + exec + + + npm + + test + + + + + + + + diff --git a/samples/client/petstore/javascript-es6/src/ApiClient.js b/samples/client/petstore/javascript-es6/src/ApiClient.js index 50a32ae9d6e..85db2a42984 100644 --- a/samples/client/petstore/javascript-es6/src/ApiClient.js +++ b/samples/client/petstore/javascript-es6/src/ApiClient.js @@ -27,7 +27,7 @@ import querystring from "querystring"; * @alias module:ApiClient * @class */ -export default class ApiClient { +class ApiClient { constructor() { /** * The base URL against which to resolve every API call's (relative) path. @@ -225,43 +225,6 @@ export default class ApiClient { return newParams; } - /** - * Enumeration of collection format separator strategies. - * @enum {String} - * @readonly - */ - static CollectionFormatEnum = { - /** - * Comma-separated values. Value: csv - * @const - */ - CSV: ',', - - /** - * Space-separated values. Value: ssv - * @const - */ - SSV: ' ', - - /** - * Tab-separated values. Value: tsv - * @const - */ - TSV: '\t', - - /** - * Pipe(|)-separated values. Value: pipes - * @const - */ - PIPES: '|', - - /** - * Native array. Value: multi - * @const - */ - MULTI: 'multi' - }; - /** * Builds a string representation of an array-type actual parameter, according to the given collection format. * @param {Array} param An array parameter. @@ -581,8 +544,46 @@ export default class ApiClient { }; } +/** + * Enumeration of collection format separator strategies. + * @enum {String} + * @readonly + */ +ApiClient.CollectionFormatEnum = { + /** + * Comma-separated values. Value: csv + * @const + */ + CSV: ',', + + /** + * Space-separated values. Value: ssv + * @const + */ + SSV: ' ', + + /** + * Tab-separated values. Value: tsv + * @const + */ + TSV: '\t', + + /** + * Pipe(|)-separated values. Value: pipes + * @const + */ + PIPES: '|', + + /** + * Native array. Value: multi + * @const + */ + MULTI: 'multi' +}; + /** * The default API client implementation. * @type {module:ApiClient} */ ApiClient.instance = new ApiClient(); +export default ApiClient; \ No newline at end of file diff --git a/samples/client/petstore/javascript-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-es6/src/api/FakeApi.js index a05dd72606c..725872e0996 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeApi.js @@ -68,7 +68,7 @@ export default class FakeApi { let authNames = []; let contentTypes = []; let accepts = ['*/*']; - let returnType = Boolean; + let returnType = 'Boolean'; return this.apiClient.callApi( '/fake/outer/boolean', 'POST', @@ -150,7 +150,7 @@ export default class FakeApi { let authNames = []; let contentTypes = []; let accepts = ['*/*']; - let returnType = Number; + let returnType = 'Number'; return this.apiClient.callApi( '/fake/outer/number', 'POST', @@ -191,7 +191,7 @@ export default class FakeApi { let authNames = []; let contentTypes = []; let accepts = ['*/*']; - let returnType = String; + let returnType = 'String'; return this.apiClient.callApi( '/fake/outer/string', 'POST', diff --git a/samples/client/petstore/javascript-es6/src/api/Fake_classname_tags123Api.js b/samples/client/petstore/javascript-es6/src/api/Fake_classname_tags123Api.js deleted file mode 100644 index 1240fbf42c1..00000000000 --- a/samples/client/petstore/javascript-es6/src/api/Fake_classname_tags123Api.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - */ - - -import ApiClient from "../ApiClient"; -import Client from '../model/Client'; - -/** -* Fake_classname_tags123 service. -* @module api/Fake_classname_tags123Api -* @version 1.0.0 -*/ -export default class Fake_classname_tags123Api { - - /** - * Constructs a new Fake_classname_tags123Api. - * @alias module:api/Fake_classname_tags123Api - * @class - * @param {module:ApiClient} [apiClient] Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - constructor(apiClient) { - this.apiClient = apiClient || ApiClient.instance; - } - - - /** - * Callback function to receive the result of the testClassname operation. - * @callback module:api/Fake_classname_tags123Api~testClassnameCallback - * @param {String} error Error message, if any. - * @param {module:model/Client} data The data returned by the service call. - * @param {String} response The complete HTTP response. - */ - - /** - * To test class name in snake case - * @param {module:model/Client} body client model - * @param {module:api/Fake_classname_tags123Api~testClassnameCallback} callback The callback function, accepting three arguments: error, data, response - * data is of type: {@link module:model/Client} - */ - testClassname(body, callback) { - let postBody = body; - - // verify the required parameter 'body' is set - if (body === undefined || body === null) { - throw new Error("Missing the required parameter 'body' when calling testClassname"); - } - - - let pathParams = { - }; - let queryParams = { - }; - let headerParams = { - }; - let formParams = { - }; - - let authNames = ['api_key_query']; - let contentTypes = ['application/json']; - let accepts = ['application/json']; - let returnType = Client; - - return this.apiClient.callApi( - '/fake_classname_test', 'PATCH', - pathParams, queryParams, headerParams, formParams, postBody, - authNames, contentTypes, accepts, returnType, callback - ); - } - - -} diff --git a/samples/client/petstore/javascript-es6/src/api/StoreApi.js b/samples/client/petstore/javascript-es6/src/api/StoreApi.js index 33029258885..9c719f5ad22 100644 --- a/samples/client/petstore/javascript-es6/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-es6/src/api/StoreApi.js @@ -109,7 +109,7 @@ export default class StoreApi { let authNames = ['api_key']; let contentTypes = []; let accepts = ['application/json']; - let returnType = {String: Number}; + let returnType = {'String': 'Number'}; return this.apiClient.callApi( '/store/inventory', 'GET', diff --git a/samples/client/petstore/javascript-es6/src/api/UserApi.js b/samples/client/petstore/javascript-es6/src/api/UserApi.js index 314e8db8f99..c3e574b9588 100644 --- a/samples/client/petstore/javascript-es6/src/api/UserApi.js +++ b/samples/client/petstore/javascript-es6/src/api/UserApi.js @@ -297,7 +297,7 @@ export default class UserApi { let authNames = []; let contentTypes = []; let accepts = ['application/xml', 'application/json']; - let returnType = String; + let returnType = 'String'; return this.apiClient.callApi( '/user/login', 'GET', diff --git a/samples/client/petstore/javascript-es6/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript-es6/src/model/AdditionalPropertiesClass.js index 227fb797557..d6e898a5ab0 100644 --- a/samples/client/petstore/javascript-es6/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-es6/src/model/AdditionalPropertiesClass.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The AdditionalPropertiesClass model module. -* @module model/AdditionalPropertiesClass -* @version 1.0.0 -*/ -export default class AdditionalPropertiesClass { + * The AdditionalPropertiesClass model module. + * @module model/AdditionalPropertiesClass + * @version 1.0.0 + */ +class AdditionalPropertiesClass { /** - * Constructs a new AdditionalPropertiesClass. - * @alias module:model/AdditionalPropertiesClass - * @class - */ - - constructor() { - - - - - - - + * Constructs a new AdditionalPropertiesClass. + * @alias module:model/AdditionalPropertiesClass + */ + constructor() { + AdditionalPropertiesClass.initialize(this); } /** - * Constructs a AdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/AdditionalPropertiesClass} obj Optional instance to populate. - * @return {module:model/AdditionalPropertiesClass} The populated AdditionalPropertiesClass instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a AdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/AdditionalPropertiesClass} obj Optional instance to populate. + * @return {module:model/AdditionalPropertiesClass} The populated AdditionalPropertiesClass instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new AdditionalPropertiesClass(); - - - - if (data.hasOwnProperty('map_property')) { obj['map_property'] = ApiClient.convertToType(data['map_property'], {'String': 'String'}); } @@ -66,22 +57,23 @@ export default class AdditionalPropertiesClass { return obj; } - /** - * @member {Object.} map_property - */ - map_property = undefined; - /** - * @member {Object.>} map_of_map_property - */ - map_of_map_property = undefined; - - - - - - - } +/** + * @member {Object.} map_property + */ +AdditionalPropertiesClass.prototype['map_property'] = undefined; + +/** + * @member {Object.>} map_of_map_property + */ +AdditionalPropertiesClass.prototype['map_of_map_property'] = undefined; + + + + + + +export default AdditionalPropertiesClass; diff --git a/samples/client/petstore/javascript-es6/src/model/Animal.js b/samples/client/petstore/javascript-es6/src/model/Animal.js index dce658d7016..c55d0c758f0 100644 --- a/samples/client/petstore/javascript-es6/src/model/Animal.js +++ b/samples/client/petstore/javascript-es6/src/model/Animal.js @@ -11,52 +11,44 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Animal model module. -* @module model/Animal -* @version 1.0.0 -*/ -export default class Animal { + * The Animal model module. + * @module model/Animal + * @version 1.0.0 + */ +class Animal { /** - * Constructs a new Animal. - * @alias module:model/Animal - * @class - * @param className {String} - */ - - constructor(className) { - - - - - - this['className'] = className; - + * Constructs a new Animal. + * @alias module:model/Animal + * @param className {String} + */ + constructor(className) { + Animal.initialize(this, className); } /** - * Constructs a Animal from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Animal} obj Optional instance to populate. - * @return {module:model/Animal} The populated Animal instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, className) { + obj['className'] = className; + } + + /** + * Constructs a Animal from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Animal} obj Optional instance to populate. + * @return {module:model/Animal} The populated Animal instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Animal(); - - - - if (data.hasOwnProperty('className')) { obj['className'] = ApiClient.convertToType(data['className'], 'String'); } @@ -67,23 +59,24 @@ export default class Animal { return obj; } - /** - * @member {String} className - */ - className = undefined; - /** - * @member {String} color - * @default 'red' - */ - color = 'red'; - - - - - - - } +/** + * @member {String} className + */ +Animal.prototype['className'] = undefined; + +/** + * @member {String} color + * @default 'red' + */ +Animal.prototype['color'] = 'red'; + + + + + + +export default Animal; diff --git a/samples/client/petstore/javascript-es6/src/model/AnimalFarm.js b/samples/client/petstore/javascript-es6/src/model/AnimalFarm.js index c0663cd1fa6..3b9cc01f03d 100644 --- a/samples/client/petstore/javascript-es6/src/model/AnimalFarm.js +++ b/samples/client/petstore/javascript-es6/src/model/AnimalFarm.js @@ -11,54 +11,47 @@ * */ - import ApiClient from '../ApiClient'; import Animal from './Animal'; - - - - /** -* The AnimalFarm model module. -* @module model/AnimalFarm -* @version 1.0.0 -*/ -export default class AnimalFarm extends Array { + * The AnimalFarm model module. + * @module model/AnimalFarm + * @version 1.0.0 + */ +class AnimalFarm extends Array { /** - * Constructs a new AnimalFarm. - * @alias module:model/AnimalFarm - * @class - * @extends Array - */ - - constructor() { - + * Constructs a new AnimalFarm. + * @alias module:model/AnimalFarm + * @extends Array + */ + constructor() { super(); - - - - - - return this; + AnimalFarm.initialize(this); } /** - * Constructs a AnimalFarm from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/AnimalFarm} obj Optional instance to populate. - * @return {module:model/AnimalFarm} The populated AnimalFarm instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a AnimalFarm from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/AnimalFarm} obj Optional instance to populate. + * @return {module:model/AnimalFarm} The populated AnimalFarm instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new AnimalFarm(); ApiClient.constructFromObject(data, obj, 'Animal'); - - } @@ -66,13 +59,12 @@ export default class AnimalFarm extends Array { } - - - - - - - } + + + + +export default AnimalFarm; + diff --git a/samples/client/petstore/javascript-es6/src/model/ApiResponse.js b/samples/client/petstore/javascript-es6/src/model/ApiResponse.js index 48142ded09d..4f5fb55291c 100644 --- a/samples/client/petstore/javascript-es6/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript-es6/src/model/ApiResponse.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ApiResponse model module. -* @module model/ApiResponse -* @version 1.0.0 -*/ -export default class ApiResponse { + * The ApiResponse model module. + * @module model/ApiResponse + * @version 1.0.0 + */ +class ApiResponse { /** - * Constructs a new ApiResponse. - * @alias module:model/ApiResponse - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ApiResponse. + * @alias module:model/ApiResponse + */ + constructor() { + ApiResponse.initialize(this); } /** - * Constructs a ApiResponse from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ApiResponse} obj Optional instance to populate. - * @return {module:model/ApiResponse} The populated ApiResponse instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ApiResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ApiResponse} obj Optional instance to populate. + * @return {module:model/ApiResponse} The populated ApiResponse instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ApiResponse(); - - - - if (data.hasOwnProperty('code')) { obj['code'] = ApiClient.convertToType(data['code'], 'Number'); } @@ -69,26 +60,28 @@ export default class ApiResponse { return obj; } - /** - * @member {Number} code - */ - code = undefined; - /** - * @member {String} type - */ - type = undefined; - /** - * @member {String} message - */ - message = undefined; - - - - - - - } +/** + * @member {Number} code + */ +ApiResponse.prototype['code'] = undefined; + +/** + * @member {String} type + */ +ApiResponse.prototype['type'] = undefined; + +/** + * @member {String} message + */ +ApiResponse.prototype['message'] = undefined; + + + + + + +export default ApiResponse; diff --git a/samples/client/petstore/javascript-es6/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript-es6/src/model/ArrayOfArrayOfNumberOnly.js index acfac49ce0d..e8d959f3689 100644 --- a/samples/client/petstore/javascript-es6/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-es6/src/model/ArrayOfArrayOfNumberOnly.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ArrayOfArrayOfNumberOnly model module. -* @module model/ArrayOfArrayOfNumberOnly -* @version 1.0.0 -*/ -export default class ArrayOfArrayOfNumberOnly { + * The ArrayOfArrayOfNumberOnly model module. + * @module model/ArrayOfArrayOfNumberOnly + * @version 1.0.0 + */ +class ArrayOfArrayOfNumberOnly { /** - * Constructs a new ArrayOfArrayOfNumberOnly. - * @alias module:model/ArrayOfArrayOfNumberOnly - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ArrayOfArrayOfNumberOnly. + * @alias module:model/ArrayOfArrayOfNumberOnly + */ + constructor() { + ArrayOfArrayOfNumberOnly.initialize(this); } /** - * Constructs a ArrayOfArrayOfNumberOnly from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ArrayOfArrayOfNumberOnly} obj Optional instance to populate. - * @return {module:model/ArrayOfArrayOfNumberOnly} The populated ArrayOfArrayOfNumberOnly instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ArrayOfArrayOfNumberOnly from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ArrayOfArrayOfNumberOnly} obj Optional instance to populate. + * @return {module:model/ArrayOfArrayOfNumberOnly} The populated ArrayOfArrayOfNumberOnly instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ArrayOfArrayOfNumberOnly(); - - - - if (data.hasOwnProperty('ArrayArrayNumber')) { obj['ArrayArrayNumber'] = ApiClient.convertToType(data['ArrayArrayNumber'], [['Number']]); } @@ -63,18 +54,18 @@ export default class ArrayOfArrayOfNumberOnly { return obj; } - /** - * @member {Array.>} ArrayArrayNumber - */ - ArrayArrayNumber = undefined; - - - - - - - } +/** + * @member {Array.>} ArrayArrayNumber + */ +ArrayOfArrayOfNumberOnly.prototype['ArrayArrayNumber'] = undefined; + + + + + + +export default ArrayOfArrayOfNumberOnly; diff --git a/samples/client/petstore/javascript-es6/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript-es6/src/model/ArrayOfNumberOnly.js index 28a47d0bb7a..4fb72e435e6 100644 --- a/samples/client/petstore/javascript-es6/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-es6/src/model/ArrayOfNumberOnly.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ArrayOfNumberOnly model module. -* @module model/ArrayOfNumberOnly -* @version 1.0.0 -*/ -export default class ArrayOfNumberOnly { + * The ArrayOfNumberOnly model module. + * @module model/ArrayOfNumberOnly + * @version 1.0.0 + */ +class ArrayOfNumberOnly { /** - * Constructs a new ArrayOfNumberOnly. - * @alias module:model/ArrayOfNumberOnly - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ArrayOfNumberOnly. + * @alias module:model/ArrayOfNumberOnly + */ + constructor() { + ArrayOfNumberOnly.initialize(this); } /** - * Constructs a ArrayOfNumberOnly from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ArrayOfNumberOnly} obj Optional instance to populate. - * @return {module:model/ArrayOfNumberOnly} The populated ArrayOfNumberOnly instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ArrayOfNumberOnly from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ArrayOfNumberOnly} obj Optional instance to populate. + * @return {module:model/ArrayOfNumberOnly} The populated ArrayOfNumberOnly instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ArrayOfNumberOnly(); - - - - if (data.hasOwnProperty('ArrayNumber')) { obj['ArrayNumber'] = ApiClient.convertToType(data['ArrayNumber'], ['Number']); } @@ -63,18 +54,18 @@ export default class ArrayOfNumberOnly { return obj; } - /** - * @member {Array.} ArrayNumber - */ - ArrayNumber = undefined; - - - - - - - } +/** + * @member {Array.} ArrayNumber + */ +ArrayOfNumberOnly.prototype['ArrayNumber'] = undefined; + + + + + + +export default ArrayOfNumberOnly; diff --git a/samples/client/petstore/javascript-es6/src/model/ArrayTest.js b/samples/client/petstore/javascript-es6/src/model/ArrayTest.js index eff8b23dd82..8096c2c4f7f 100644 --- a/samples/client/petstore/javascript-es6/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript-es6/src/model/ArrayTest.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; import ReadOnlyFirst from './ReadOnlyFirst'; - - - - /** -* The ArrayTest model module. -* @module model/ArrayTest -* @version 1.0.0 -*/ -export default class ArrayTest { + * The ArrayTest model module. + * @module model/ArrayTest + * @version 1.0.0 + */ +class ArrayTest { /** - * Constructs a new ArrayTest. - * @alias module:model/ArrayTest - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ArrayTest. + * @alias module:model/ArrayTest + */ + constructor() { + ArrayTest.initialize(this); } /** - * Constructs a ArrayTest from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ArrayTest} obj Optional instance to populate. - * @return {module:model/ArrayTest} The populated ArrayTest instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ArrayTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ArrayTest} obj Optional instance to populate. + * @return {module:model/ArrayTest} The populated ArrayTest instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ArrayTest(); - - - - if (data.hasOwnProperty('array_of_string')) { obj['array_of_string'] = ApiClient.convertToType(data['array_of_string'], ['String']); } @@ -70,26 +61,28 @@ export default class ArrayTest { return obj; } - /** - * @member {Array.} array_of_string - */ - array_of_string = undefined; - /** - * @member {Array.>} array_array_of_integer - */ - array_array_of_integer = undefined; - /** - * @member {Array.>} array_array_of_model - */ - array_array_of_model = undefined; - - - - - - - } +/** + * @member {Array.} array_of_string + */ +ArrayTest.prototype['array_of_string'] = undefined; + +/** + * @member {Array.>} array_array_of_integer + */ +ArrayTest.prototype['array_array_of_integer'] = undefined; + +/** + * @member {Array.>} array_array_of_model + */ +ArrayTest.prototype['array_array_of_model'] = undefined; + + + + + + +export default ArrayTest; diff --git a/samples/client/petstore/javascript-es6/src/model/Capitalization.js b/samples/client/petstore/javascript-es6/src/model/Capitalization.js index 41c6ff9af30..bc1cdefb71b 100644 --- a/samples/client/petstore/javascript-es6/src/model/Capitalization.js +++ b/samples/client/petstore/javascript-es6/src/model/Capitalization.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Capitalization model module. -* @module model/Capitalization -* @version 1.0.0 -*/ -export default class Capitalization { + * The Capitalization model module. + * @module model/Capitalization + * @version 1.0.0 + */ +class Capitalization { /** - * Constructs a new Capitalization. - * @alias module:model/Capitalization - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Capitalization. + * @alias module:model/Capitalization + */ + constructor() { + Capitalization.initialize(this); } /** - * Constructs a Capitalization from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Capitalization} obj Optional instance to populate. - * @return {module:model/Capitalization} The populated Capitalization instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Capitalization from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Capitalization} obj Optional instance to populate. + * @return {module:model/Capitalization} The populated Capitalization instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Capitalization(); - - - - if (data.hasOwnProperty('smallCamel')) { obj['smallCamel'] = ApiClient.convertToType(data['smallCamel'], 'String'); } @@ -78,39 +69,44 @@ export default class Capitalization { return obj; } - /** - * @member {String} smallCamel - */ - smallCamel = undefined; - /** - * @member {String} CapitalCamel - */ - CapitalCamel = undefined; - /** - * @member {String} small_Snake - */ - small_Snake = undefined; - /** - * @member {String} Capital_Snake - */ - Capital_Snake = undefined; - /** - * @member {String} SCA_ETH_Flow_Points - */ - SCA_ETH_Flow_Points = undefined; - /** - * Name of the pet - * @member {String} ATT_NAME - */ - ATT_NAME = undefined; - - - - - - - } +/** + * @member {String} smallCamel + */ +Capitalization.prototype['smallCamel'] = undefined; + +/** + * @member {String} CapitalCamel + */ +Capitalization.prototype['CapitalCamel'] = undefined; + +/** + * @member {String} small_Snake + */ +Capitalization.prototype['small_Snake'] = undefined; + +/** + * @member {String} Capital_Snake + */ +Capitalization.prototype['Capital_Snake'] = undefined; + +/** + * @member {String} SCA_ETH_Flow_Points + */ +Capitalization.prototype['SCA_ETH_Flow_Points'] = undefined; + +/** + * Name of the pet + * @member {String} ATT_NAME + */ +Capitalization.prototype['ATT_NAME'] = undefined; + + + + + + +export default Capitalization; diff --git a/samples/client/petstore/javascript-es6/src/model/Cat.js b/samples/client/petstore/javascript-es6/src/model/Cat.js index cc759099886..5ad5fb40286 100644 --- a/samples/client/petstore/javascript-es6/src/model/Cat.js +++ b/samples/client/petstore/javascript-es6/src/model/Cat.js @@ -11,53 +11,45 @@ * */ - import ApiClient from '../ApiClient'; import Animal from './Animal'; - - - - /** -* The Cat model module. -* @module model/Cat -* @version 1.0.0 -*/ -export default class Cat { + * The Cat model module. + * @module model/Cat + * @version 1.0.0 + */ +class Cat { /** - * Constructs a new Cat. - * @alias module:model/Cat - * @class - * @extends module:model/Animal - * @implements module:model/Animal - * @param className {} - */ - - constructor(className) { - - - Animal.call(this, className); - Animal.call(this, className); - - - - + * Constructs a new Cat. + * @alias module:model/Cat + * @extends module:model/Animal + * @implements module:model/Animal + * @param className {} + */ + constructor(className) { + Animal.initialize(this, className); + Cat.initialize(this, className); } /** - * Constructs a Cat from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Cat} obj Optional instance to populate. - * @return {module:model/Cat} The populated Cat instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, className) { + } + + /** + * Constructs a Cat from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Cat} obj Optional instance to populate. + * @return {module:model/Cat} The populated Cat instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Cat(); - - - Animal.constructFromObject(data, obj); Animal.constructFromObject(data, obj); @@ -68,29 +60,28 @@ export default class Cat { return obj; } - /** - * @member {Boolean} declawed - */ - declawed = undefined; - - - // Implement Animal interface: - /** - * @member {String} className - */ - className = undefined; -/** - * @member {String} color - * @default 'red' - */ - color = 'red'; - - - - - - } +/** + * @member {Boolean} declawed + */ +Cat.prototype['declawed'] = undefined; + + +// Implement Animal interface: +/** + * @member {String} className + */ +Animal.prototype['className'] = undefined; +/** + * @member {String} color + * @default 'red' + */ +Animal.prototype['color'] = 'red'; + + + + +export default Cat; diff --git a/samples/client/petstore/javascript-es6/src/model/Category.js b/samples/client/petstore/javascript-es6/src/model/Category.js index cdd487022d0..fd0bf79dafb 100644 --- a/samples/client/petstore/javascript-es6/src/model/Category.js +++ b/samples/client/petstore/javascript-es6/src/model/Category.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Category model module. -* @module model/Category -* @version 1.0.0 -*/ -export default class Category { + * The Category model module. + * @module model/Category + * @version 1.0.0 + */ +class Category { /** - * Constructs a new Category. - * @alias module:model/Category - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Category. + * @alias module:model/Category + */ + constructor() { + Category.initialize(this); } /** - * Constructs a Category from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Category} obj Optional instance to populate. - * @return {module:model/Category} The populated Category instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Category from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Category} obj Optional instance to populate. + * @return {module:model/Category} The populated Category instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Category(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -66,22 +57,23 @@ export default class Category { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {String} name - */ - name = undefined; - - - - - - - } +/** + * @member {Number} id + */ +Category.prototype['id'] = undefined; + +/** + * @member {String} name + */ +Category.prototype['name'] = undefined; + + + + + + +export default Category; diff --git a/samples/client/petstore/javascript-es6/src/model/ClassModel.js b/samples/client/petstore/javascript-es6/src/model/ClassModel.js index c9c39c22fff..2e55c2a6342 100644 --- a/samples/client/petstore/javascript-es6/src/model/ClassModel.js +++ b/samples/client/petstore/javascript-es6/src/model/ClassModel.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ClassModel model module. -* @module model/ClassModel -* @version 1.0.0 -*/ -export default class ClassModel { + * The ClassModel model module. + * @module model/ClassModel + * @version 1.0.0 + */ +class ClassModel { /** - * Constructs a new ClassModel. - * Model for testing model with \"_class\" property - * @alias module:model/ClassModel - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ClassModel. + * Model for testing model with \"_class\" property + * @alias module:model/ClassModel + */ + constructor() { + ClassModel.initialize(this); } /** - * Constructs a ClassModel from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ClassModel} obj Optional instance to populate. - * @return {module:model/ClassModel} The populated ClassModel instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ClassModel from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ClassModel} obj Optional instance to populate. + * @return {module:model/ClassModel} The populated ClassModel instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ClassModel(); - - - - if (data.hasOwnProperty('_class')) { obj['_class'] = ApiClient.convertToType(data['_class'], 'String'); } @@ -64,18 +55,18 @@ export default class ClassModel { return obj; } - /** - * @member {String} _class - */ - _class = undefined; - - - - - - - } +/** + * @member {String} _class + */ +ClassModel.prototype['_class'] = undefined; + + + + + + +export default ClassModel; diff --git a/samples/client/petstore/javascript-es6/src/model/Client.js b/samples/client/petstore/javascript-es6/src/model/Client.js index 82dca1732b3..c506d2fa174 100644 --- a/samples/client/petstore/javascript-es6/src/model/Client.js +++ b/samples/client/petstore/javascript-es6/src/model/Client.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Client model module. -* @module model/Client -* @version 1.0.0 -*/ -export default class Client { + * The Client model module. + * @module model/Client + * @version 1.0.0 + */ +class Client { /** - * Constructs a new Client. - * @alias module:model/Client - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Client. + * @alias module:model/Client + */ + constructor() { + Client.initialize(this); } /** - * Constructs a Client from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Client} obj Optional instance to populate. - * @return {module:model/Client} The populated Client instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Client from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Client} obj Optional instance to populate. + * @return {module:model/Client} The populated Client instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Client(); - - - - if (data.hasOwnProperty('client')) { obj['client'] = ApiClient.convertToType(data['client'], 'String'); } @@ -63,18 +54,18 @@ export default class Client { return obj; } - /** - * @member {String} client - */ - client = undefined; - - - - - - - } +/** + * @member {String} client + */ +Client.prototype['client'] = undefined; + + + + + + +export default Client; diff --git a/samples/client/petstore/javascript-es6/src/model/Dog.js b/samples/client/petstore/javascript-es6/src/model/Dog.js index 92168904822..ba225630e93 100644 --- a/samples/client/petstore/javascript-es6/src/model/Dog.js +++ b/samples/client/petstore/javascript-es6/src/model/Dog.js @@ -11,53 +11,45 @@ * */ - import ApiClient from '../ApiClient'; import Animal from './Animal'; - - - - /** -* The Dog model module. -* @module model/Dog -* @version 1.0.0 -*/ -export default class Dog { + * The Dog model module. + * @module model/Dog + * @version 1.0.0 + */ +class Dog { /** - * Constructs a new Dog. - * @alias module:model/Dog - * @class - * @extends module:model/Animal - * @implements module:model/Animal - * @param className {} - */ - - constructor(className) { - - - Animal.call(this, className); - Animal.call(this, className); - - - - + * Constructs a new Dog. + * @alias module:model/Dog + * @extends module:model/Animal + * @implements module:model/Animal + * @param className {} + */ + constructor(className) { + Animal.initialize(this, className); + Dog.initialize(this, className); } /** - * Constructs a Dog from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Dog} obj Optional instance to populate. - * @return {module:model/Dog} The populated Dog instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, className) { + } + + /** + * Constructs a Dog from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Dog} obj Optional instance to populate. + * @return {module:model/Dog} The populated Dog instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Dog(); - - - Animal.constructFromObject(data, obj); Animal.constructFromObject(data, obj); @@ -68,29 +60,28 @@ export default class Dog { return obj; } - /** - * @member {String} breed - */ - breed = undefined; - - - // Implement Animal interface: - /** - * @member {String} className - */ - className = undefined; -/** - * @member {String} color - * @default 'red' - */ - color = 'red'; - - - - - - } +/** + * @member {String} breed + */ +Dog.prototype['breed'] = undefined; + + +// Implement Animal interface: +/** + * @member {String} className + */ +Animal.prototype['className'] = undefined; +/** + * @member {String} color + * @default 'red' + */ +Animal.prototype['color'] = 'red'; + + + + +export default Dog; diff --git a/samples/client/petstore/javascript-es6/src/model/EnumArrays.js b/samples/client/petstore/javascript-es6/src/model/EnumArrays.js index f017d9a5396..9426d4735ac 100644 --- a/samples/client/petstore/javascript-es6/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript-es6/src/model/EnumArrays.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The EnumArrays model module. -* @module model/EnumArrays -* @version 1.0.0 -*/ -export default class EnumArrays { + * The EnumArrays model module. + * @module model/EnumArrays + * @version 1.0.0 + */ +class EnumArrays { /** - * Constructs a new EnumArrays. - * @alias module:model/EnumArrays - * @class - */ - - constructor() { - - - - - - - + * Constructs a new EnumArrays. + * @alias module:model/EnumArrays + */ + constructor() { + EnumArrays.initialize(this); } /** - * Constructs a EnumArrays from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/EnumArrays} obj Optional instance to populate. - * @return {module:model/EnumArrays} The populated EnumArrays instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a EnumArrays from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/EnumArrays} obj Optional instance to populate. + * @return {module:model/EnumArrays} The populated EnumArrays instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new EnumArrays(); - - - - if (data.hasOwnProperty('just_symbol')) { obj['just_symbol'] = ApiClient.convertToType(data['just_symbol'], 'String'); } @@ -66,62 +57,65 @@ export default class EnumArrays { return obj; } - /** - * @member {module:model/EnumArrays.JustSymbolEnum} just_symbol - */ - just_symbol = undefined; - /** - * @member {Array.} array_enum - */ - array_enum = undefined; - - - - - - - /** - * Allowed values for the just_symbol property. - * @enum {String} - * @readonly - */ - static JustSymbolEnum = { - - /** - * value: ">=" - * @const - */ - "GREATER_THAN_OR_EQUAL_TO": ">=", - - /** - * value: "$" - * @const - */ - "DOLLAR": "$" - }; - - /** - * Allowed values for the arrayEnum property. - * @enum {String} - * @readonly - */ - static ArrayEnumEnum = { - - /** - * value: "fish" - * @const - */ - "fish": "fish", - - /** - * value: "crab" - * @const - */ - "crab": "crab" - }; - - } +/** + * @member {module:model/EnumArrays.JustSymbolEnum} just_symbol + */ +EnumArrays.prototype['just_symbol'] = undefined; + +/** + * @member {Array.} array_enum + */ +EnumArrays.prototype['array_enum'] = undefined; + + + + + +/** + * Allowed values for the just_symbol property. + * @enum {String} + * @readonly + */ +EnumArrays['JustSymbolEnum'] = { + + /** + * value: ">=" + * @const + */ + "GREATER_THAN_OR_EQUAL_TO": ">=", + + /** + * value: "$" + * @const + */ + "DOLLAR": "$" +}; + + +/** + * Allowed values for the arrayEnum property. + * @enum {String} + * @readonly + */ +EnumArrays['ArrayEnumEnum'] = { + + /** + * value: "fish" + * @const + */ + "fish": "fish", + + /** + * value: "crab" + * @const + */ + "crab": "crab" +}; + + + +export default EnumArrays; diff --git a/samples/client/petstore/javascript-es6/src/model/EnumClass.js b/samples/client/petstore/javascript-es6/src/model/EnumClass.js index feb022bc831..65ac9f1f1bc 100644 --- a/samples/client/petstore/javascript-es6/src/model/EnumClass.js +++ b/samples/client/petstore/javascript-es6/src/model/EnumClass.js @@ -11,10 +11,7 @@ * */ - import ApiClient from '../ApiClient'; - - /** * Enum class EnumClass. * @enum {} @@ -26,21 +23,21 @@ export default class EnumClass { * value: "_abc" * @const */ - _abc = "_abc"; + "_abc" = "_abc"; /** * value: "-efg" * @const */ - -efg = "-efg"; + "-efg" = "-efg"; /** * value: "(xyz)" * @const */ - (xyz) = "(xyz)"; + "(xyz)" = "(xyz)"; @@ -54,4 +51,3 @@ export default class EnumClass { } } - diff --git a/samples/client/petstore/javascript-es6/src/model/EnumTest.js b/samples/client/petstore/javascript-es6/src/model/EnumTest.js index eaf874922b5..08828485c18 100644 --- a/samples/client/petstore/javascript-es6/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-es6/src/model/EnumTest.js @@ -11,53 +11,45 @@ * */ - import ApiClient from '../ApiClient'; import OuterEnum from './OuterEnum'; - - - - /** -* The EnumTest model module. -* @module model/EnumTest -* @version 1.0.0 -*/ -export default class EnumTest { + * The EnumTest model module. + * @module model/EnumTest + * @version 1.0.0 + */ +class EnumTest { /** - * Constructs a new EnumTest. - * @alias module:model/EnumTest - * @class - * @param enumStringRequired {module:model/EnumTest.EnumStringRequiredEnum} - */ - - constructor(enumStringRequired) { - - - - - - this['enum_string_required'] = enumStringRequired; - + * Constructs a new EnumTest. + * @alias module:model/EnumTest + * @param enumStringRequired {module:model/EnumTest.EnumStringRequiredEnum} + */ + constructor(enumStringRequired) { + EnumTest.initialize(this, enumStringRequired); } /** - * Constructs a EnumTest from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/EnumTest} obj Optional instance to populate. - * @return {module:model/EnumTest} The populated EnumTest instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, enumStringRequired) { + obj['enum_string_required'] = enumStringRequired; + } + + /** + * Constructs a EnumTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/EnumTest} obj Optional instance to populate. + * @return {module:model/EnumTest} The populated EnumTest instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new EnumTest(); - - - - if (data.hasOwnProperty('enum_string')) { obj['enum_string'] = ApiClient.convertToType(data['enum_string'], 'String'); } @@ -77,126 +69,134 @@ export default class EnumTest { return obj; } - /** - * @member {module:model/EnumTest.EnumStringEnum} enum_string - */ - enum_string = undefined; - /** - * @member {module:model/EnumTest.EnumStringRequiredEnum} enum_string_required - */ - enum_string_required = undefined; - /** - * @member {module:model/EnumTest.EnumIntegerEnum} enum_integer - */ - enum_integer = undefined; - /** - * @member {module:model/EnumTest.EnumNumberEnum} enum_number - */ - enum_number = undefined; - /** - * @member {module:model/OuterEnum} outerEnum - */ - outerEnum = undefined; - - - - - - - /** - * Allowed values for the enum_string property. - * @enum {String} - * @readonly - */ - static EnumStringEnum = { - - /** - * value: "UPPER" - * @const - */ - "UPPER": "UPPER", - - /** - * value: "lower" - * @const - */ - "lower": "lower", - - /** - * value: "" - * @const - */ - "empty": "" - }; - - /** - * Allowed values for the enum_string_required property. - * @enum {String} - * @readonly - */ - static EnumStringRequiredEnum = { - - /** - * value: "UPPER" - * @const - */ - "UPPER": "UPPER", - - /** - * value: "lower" - * @const - */ - "lower": "lower", - - /** - * value: "" - * @const - */ - "empty": "" - }; - - /** - * Allowed values for the enum_integer property. - * @enum {Number} - * @readonly - */ - static EnumIntegerEnum = { - - /** - * value: 1 - * @const - */ - "1": 1, - - /** - * value: -1 - * @const - */ - "-1": -1 - }; - - /** - * Allowed values for the enum_number property. - * @enum {Number} - * @readonly - */ - static EnumNumberEnum = { - - /** - * value: 1.1 - * @const - */ - "1.1": 1.1, - - /** - * value: -1.2 - * @const - */ - "-1.2": -1.2 - }; - - } +/** + * @member {module:model/EnumTest.EnumStringEnum} enum_string + */ +EnumTest.prototype['enum_string'] = undefined; + +/** + * @member {module:model/EnumTest.EnumStringRequiredEnum} enum_string_required + */ +EnumTest.prototype['enum_string_required'] = undefined; + +/** + * @member {module:model/EnumTest.EnumIntegerEnum} enum_integer + */ +EnumTest.prototype['enum_integer'] = undefined; + +/** + * @member {module:model/EnumTest.EnumNumberEnum} enum_number + */ +EnumTest.prototype['enum_number'] = undefined; + +/** + * @member {module:model/OuterEnum} outerEnum + */ +EnumTest.prototype['outerEnum'] = undefined; + + + + + +/** + * Allowed values for the enum_string property. + * @enum {String} + * @readonly + */ +EnumTest['EnumStringEnum'] = { + + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + + /** + * value: "lower" + * @const + */ + "lower": "lower", + + /** + * value: "" + * @const + */ + "empty": "" +}; + + +/** + * Allowed values for the enum_string_required property. + * @enum {String} + * @readonly + */ +EnumTest['EnumStringRequiredEnum'] = { + + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + + /** + * value: "lower" + * @const + */ + "lower": "lower", + + /** + * value: "" + * @const + */ + "empty": "" +}; + + +/** + * Allowed values for the enum_integer property. + * @enum {Number} + * @readonly + */ +EnumTest['EnumIntegerEnum'] = { + + /** + * value: 1 + * @const + */ + "1": 1, + + /** + * value: -1 + * @const + */ + "-1": -1 +}; + + +/** + * Allowed values for the enum_number property. + * @enum {Number} + * @readonly + */ +EnumTest['EnumNumberEnum'] = { + + /** + * value: 1.1 + * @const + */ + "1.1": 1.1, + + /** + * value: -1.2 + * @const + */ + "-1.2": -1.2 +}; + + + +export default EnumTest; diff --git a/samples/client/petstore/javascript-es6/src/model/FormatTest.js b/samples/client/petstore/javascript-es6/src/model/FormatTest.js index 7d04ffd26d3..87fa2afe86b 100644 --- a/samples/client/petstore/javascript-es6/src/model/FormatTest.js +++ b/samples/client/petstore/javascript-es6/src/model/FormatTest.js @@ -11,55 +11,50 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The FormatTest model module. -* @module model/FormatTest -* @version 1.0.0 -*/ -export default class FormatTest { + * The FormatTest model module. + * @module model/FormatTest + * @version 1.0.0 + */ +class FormatTest { /** - * Constructs a new FormatTest. - * @alias module:model/FormatTest - * @class - * @param _number {Number} - * @param _byte {Blob} - * @param _date {Date} - * @param password {String} - */ - - constructor(_number, _byte, _date, password) { - - - - - - this['number'] = _number;this['byte'] = _byte;this['date'] = _date;this['password'] = password; - + * Constructs a new FormatTest. + * @alias module:model/FormatTest + * @param _number {Number} + * @param _byte {Blob} + * @param _date {Date} + * @param password {String} + */ + constructor(_number, _byte, _date, password) { + FormatTest.initialize(this, _number, _byte, _date, password); } /** - * Constructs a FormatTest from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/FormatTest} obj Optional instance to populate. - * @return {module:model/FormatTest} The populated FormatTest instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, _number, _byte, _date, password) { + obj['number'] = _number; + obj['byte'] = _byte; + obj['date'] = _date; + obj['password'] = password; + } + + /** + * Constructs a FormatTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/FormatTest} obj Optional instance to populate. + * @return {module:model/FormatTest} The populated FormatTest instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new FormatTest(); - - - - if (data.hasOwnProperty('integer')) { obj['integer'] = ApiClient.convertToType(data['integer'], 'Number'); } @@ -103,66 +98,78 @@ export default class FormatTest { return obj; } - /** - * @member {Number} integer - */ - integer = undefined; - /** - * @member {Number} int32 - */ - int32 = undefined; - /** - * @member {Number} int64 - */ - int64 = undefined; - /** - * @member {Number} number - */ - number = undefined; - /** - * @member {Number} float - */ - float = undefined; - /** - * @member {Number} double - */ - double = undefined; - /** - * @member {String} string - */ - string = undefined; - /** - * @member {Blob} byte - */ - byte = undefined; - /** - * @member {File} binary - */ - binary = undefined; - /** - * @member {Date} date - */ - date = undefined; - /** - * @member {Date} dateTime - */ - dateTime = undefined; - /** - * @member {String} uuid - */ - uuid = undefined; - /** - * @member {String} password - */ - password = undefined; - - - - - - - } +/** + * @member {Number} integer + */ +FormatTest.prototype['integer'] = undefined; + +/** + * @member {Number} int32 + */ +FormatTest.prototype['int32'] = undefined; + +/** + * @member {Number} int64 + */ +FormatTest.prototype['int64'] = undefined; + +/** + * @member {Number} number + */ +FormatTest.prototype['number'] = undefined; + +/** + * @member {Number} float + */ +FormatTest.prototype['float'] = undefined; + +/** + * @member {Number} double + */ +FormatTest.prototype['double'] = undefined; + +/** + * @member {String} string + */ +FormatTest.prototype['string'] = undefined; + +/** + * @member {Blob} byte + */ +FormatTest.prototype['byte'] = undefined; + +/** + * @member {File} binary + */ +FormatTest.prototype['binary'] = undefined; + +/** + * @member {Date} date + */ +FormatTest.prototype['date'] = undefined; + +/** + * @member {Date} dateTime + */ +FormatTest.prototype['dateTime'] = undefined; + +/** + * @member {String} uuid + */ +FormatTest.prototype['uuid'] = undefined; + +/** + * @member {String} password + */ +FormatTest.prototype['password'] = undefined; + + + + + + +export default FormatTest; diff --git a/samples/client/petstore/javascript-es6/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript-es6/src/model/HasOnlyReadOnly.js index e5f746c32ba..9c11ae559c9 100644 --- a/samples/client/petstore/javascript-es6/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript-es6/src/model/HasOnlyReadOnly.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The HasOnlyReadOnly model module. -* @module model/HasOnlyReadOnly -* @version 1.0.0 -*/ -export default class HasOnlyReadOnly { + * The HasOnlyReadOnly model module. + * @module model/HasOnlyReadOnly + * @version 1.0.0 + */ +class HasOnlyReadOnly { /** - * Constructs a new HasOnlyReadOnly. - * @alias module:model/HasOnlyReadOnly - * @class - */ - - constructor() { - - - - - - - + * Constructs a new HasOnlyReadOnly. + * @alias module:model/HasOnlyReadOnly + */ + constructor() { + HasOnlyReadOnly.initialize(this); } /** - * Constructs a HasOnlyReadOnly from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/HasOnlyReadOnly} obj Optional instance to populate. - * @return {module:model/HasOnlyReadOnly} The populated HasOnlyReadOnly instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a HasOnlyReadOnly from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/HasOnlyReadOnly} obj Optional instance to populate. + * @return {module:model/HasOnlyReadOnly} The populated HasOnlyReadOnly instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new HasOnlyReadOnly(); - - - - if (data.hasOwnProperty('bar')) { obj['bar'] = ApiClient.convertToType(data['bar'], 'String'); } @@ -66,22 +57,23 @@ export default class HasOnlyReadOnly { return obj; } - /** - * @member {String} bar - */ - bar = undefined; - /** - * @member {String} foo - */ - foo = undefined; - - - - - - - } +/** + * @member {String} bar + */ +HasOnlyReadOnly.prototype['bar'] = undefined; + +/** + * @member {String} foo + */ +HasOnlyReadOnly.prototype['foo'] = undefined; + + + + + + +export default HasOnlyReadOnly; diff --git a/samples/client/petstore/javascript-es6/src/model/List.js b/samples/client/petstore/javascript-es6/src/model/List.js index 67d6d9ef144..d4d342319e7 100644 --- a/samples/client/petstore/javascript-es6/src/model/List.js +++ b/samples/client/petstore/javascript-es6/src/model/List.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The List model module. -* @module model/List -* @version 1.0.0 -*/ -export default class List { + * The List model module. + * @module model/List + * @version 1.0.0 + */ +class List { /** - * Constructs a new List. - * @alias module:model/List - * @class - */ - - constructor() { - - - - - - - + * Constructs a new List. + * @alias module:model/List + */ + constructor() { + List.initialize(this); } /** - * Constructs a List from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/List} obj Optional instance to populate. - * @return {module:model/List} The populated List instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a List from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/List} obj Optional instance to populate. + * @return {module:model/List} The populated List instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new List(); - - - - if (data.hasOwnProperty('123-list')) { obj['123-list'] = ApiClient.convertToType(data['123-list'], 'String'); } @@ -63,18 +54,18 @@ export default class List { return obj; } - /** - * @member {String} 123-list - */ - 123-list = undefined; - - - - - - - } +/** + * @member {String} 123-list + */ +List.prototype['123-list'] = undefined; + + + + + + +export default List; diff --git a/samples/client/petstore/javascript-es6/src/model/MapTest.js b/samples/client/petstore/javascript-es6/src/model/MapTest.js index e4be468e253..8cc6640c9d4 100644 --- a/samples/client/petstore/javascript-es6/src/model/MapTest.js +++ b/samples/client/petstore/javascript-es6/src/model/MapTest.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The MapTest model module. -* @module model/MapTest -* @version 1.0.0 -*/ -export default class MapTest { + * The MapTest model module. + * @module model/MapTest + * @version 1.0.0 + */ +class MapTest { /** - * Constructs a new MapTest. - * @alias module:model/MapTest - * @class - */ - - constructor() { - - - - - - - + * Constructs a new MapTest. + * @alias module:model/MapTest + */ + constructor() { + MapTest.initialize(this); } /** - * Constructs a MapTest from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/MapTest} obj Optional instance to populate. - * @return {module:model/MapTest} The populated MapTest instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a MapTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/MapTest} obj Optional instance to populate. + * @return {module:model/MapTest} The populated MapTest instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new MapTest(); - - - - if (data.hasOwnProperty('map_map_of_string')) { obj['map_map_of_string'] = ApiClient.convertToType(data['map_map_of_string'], {'String': {'String': 'String'}}); } @@ -66,42 +57,44 @@ export default class MapTest { return obj; } - /** - * @member {Object.>} map_map_of_string - */ - map_map_of_string = undefined; - /** - * @member {Object.} map_of_enum_string - */ - map_of_enum_string = undefined; - - - - - - - /** - * Allowed values for the inner property. - * @enum {String} - * @readonly - */ - static InnerEnum = { - - /** - * value: "UPPER" - * @const - */ - "UPPER": "UPPER", - - /** - * value: "lower" - * @const - */ - "lower": "lower" - }; - - } +/** + * @member {Object.>} map_map_of_string + */ +MapTest.prototype['map_map_of_string'] = undefined; + +/** + * @member {Object.} map_of_enum_string + */ +MapTest.prototype['map_of_enum_string'] = undefined; + + + + + +/** + * Allowed values for the inner property. + * @enum {String} + * @readonly + */ +MapTest['InnerEnum'] = { + + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + + /** + * value: "lower" + * @const + */ + "lower": "lower" +}; + + + +export default MapTest; diff --git a/samples/client/petstore/javascript-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index 17ea09bd69a..5568d3a6e96 100644 --- a/samples/client/petstore/javascript-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; import Animal from './Animal'; - - - - /** -* The MixedPropertiesAndAdditionalPropertiesClass model module. -* @module model/MixedPropertiesAndAdditionalPropertiesClass -* @version 1.0.0 -*/ -export default class MixedPropertiesAndAdditionalPropertiesClass { + * The MixedPropertiesAndAdditionalPropertiesClass model module. + * @module model/MixedPropertiesAndAdditionalPropertiesClass + * @version 1.0.0 + */ +class MixedPropertiesAndAdditionalPropertiesClass { /** - * Constructs a new MixedPropertiesAndAdditionalPropertiesClass. - * @alias module:model/MixedPropertiesAndAdditionalPropertiesClass - * @class - */ - - constructor() { - - - - - - - + * Constructs a new MixedPropertiesAndAdditionalPropertiesClass. + * @alias module:model/MixedPropertiesAndAdditionalPropertiesClass + */ + constructor() { + MixedPropertiesAndAdditionalPropertiesClass.initialize(this); } /** - * Constructs a MixedPropertiesAndAdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/MixedPropertiesAndAdditionalPropertiesClass} obj Optional instance to populate. - * @return {module:model/MixedPropertiesAndAdditionalPropertiesClass} The populated MixedPropertiesAndAdditionalPropertiesClass instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a MixedPropertiesAndAdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/MixedPropertiesAndAdditionalPropertiesClass} obj Optional instance to populate. + * @return {module:model/MixedPropertiesAndAdditionalPropertiesClass} The populated MixedPropertiesAndAdditionalPropertiesClass instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new MixedPropertiesAndAdditionalPropertiesClass(); - - - - if (data.hasOwnProperty('uuid')) { obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String'); } @@ -70,26 +61,28 @@ export default class MixedPropertiesAndAdditionalPropertiesClass { return obj; } - /** - * @member {String} uuid - */ - uuid = undefined; - /** - * @member {Date} dateTime - */ - dateTime = undefined; - /** - * @member {Object.} map - */ - map = undefined; - - - - - - - } +/** + * @member {String} uuid + */ +MixedPropertiesAndAdditionalPropertiesClass.prototype['uuid'] = undefined; + +/** + * @member {Date} dateTime + */ +MixedPropertiesAndAdditionalPropertiesClass.prototype['dateTime'] = undefined; + +/** + * @member {Object.} map + */ +MixedPropertiesAndAdditionalPropertiesClass.prototype['map'] = undefined; + + + + + + +export default MixedPropertiesAndAdditionalPropertiesClass; diff --git a/samples/client/petstore/javascript-es6/src/model/Model200Response.js b/samples/client/petstore/javascript-es6/src/model/Model200Response.js index 3dbecac1336..629b0f0c75a 100644 --- a/samples/client/petstore/javascript-es6/src/model/Model200Response.js +++ b/samples/client/petstore/javascript-es6/src/model/Model200Response.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Model200Response model module. -* @module model/Model200Response -* @version 1.0.0 -*/ -export default class Model200Response { + * The Model200Response model module. + * @module model/Model200Response + * @version 1.0.0 + */ +class Model200Response { /** - * Constructs a new Model200Response. - * Model for testing model name starting with number - * @alias module:model/Model200Response - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Model200Response. + * Model for testing model name starting with number + * @alias module:model/Model200Response + */ + constructor() { + Model200Response.initialize(this); } /** - * Constructs a Model200Response from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Model200Response} obj Optional instance to populate. - * @return {module:model/Model200Response} The populated Model200Response instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Model200Response from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Model200Response} obj Optional instance to populate. + * @return {module:model/Model200Response} The populated Model200Response instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Model200Response(); - - - - if (data.hasOwnProperty('name')) { obj['name'] = ApiClient.convertToType(data['name'], 'Number'); } @@ -67,22 +58,23 @@ export default class Model200Response { return obj; } - /** - * @member {Number} name - */ - name = undefined; - /** - * @member {String} class - */ - class = undefined; - - - - - - - } +/** + * @member {Number} name + */ +Model200Response.prototype['name'] = undefined; + +/** + * @member {String} class + */ +Model200Response.prototype['class'] = undefined; + + + + + + +export default Model200Response; diff --git a/samples/client/petstore/javascript-es6/src/model/ModelReturn.js b/samples/client/petstore/javascript-es6/src/model/ModelReturn.js index 0f287b72281..9ad0c11befc 100644 --- a/samples/client/petstore/javascript-es6/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript-es6/src/model/ModelReturn.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ModelReturn model module. -* @module model/ModelReturn -* @version 1.0.0 -*/ -export default class ModelReturn { + * The ModelReturn model module. + * @module model/ModelReturn + * @version 1.0.0 + */ +class ModelReturn { /** - * Constructs a new ModelReturn. - * Model for testing reserved words - * @alias module:model/ModelReturn - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ModelReturn. + * Model for testing reserved words + * @alias module:model/ModelReturn + */ + constructor() { + ModelReturn.initialize(this); } /** - * Constructs a ModelReturn from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ModelReturn} obj Optional instance to populate. - * @return {module:model/ModelReturn} The populated ModelReturn instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ModelReturn from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ModelReturn} obj Optional instance to populate. + * @return {module:model/ModelReturn} The populated ModelReturn instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ModelReturn(); - - - - if (data.hasOwnProperty('return')) { obj['return'] = ApiClient.convertToType(data['return'], 'Number'); } @@ -64,18 +55,18 @@ export default class ModelReturn { return obj; } - /** - * @member {Number} return - */ - return = undefined; - - - - - - - } +/** + * @member {Number} return + */ +ModelReturn.prototype['return'] = undefined; + + + + + + +export default ModelReturn; diff --git a/samples/client/petstore/javascript-es6/src/model/Name.js b/samples/client/petstore/javascript-es6/src/model/Name.js index 0da2f21ca4c..63e7d52e5ff 100644 --- a/samples/client/petstore/javascript-es6/src/model/Name.js +++ b/samples/client/petstore/javascript-es6/src/model/Name.js @@ -11,53 +11,45 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Name model module. -* @module model/Name -* @version 1.0.0 -*/ -export default class Name { + * The Name model module. + * @module model/Name + * @version 1.0.0 + */ +class Name { /** - * Constructs a new Name. - * Model for testing model name same as property name - * @alias module:model/Name - * @class - * @param name {Number} - */ - - constructor(name) { - - - - - - this['name'] = name; - + * Constructs a new Name. + * Model for testing model name same as property name + * @alias module:model/Name + * @param name {Number} + */ + constructor(name) { + Name.initialize(this, name); } /** - * Constructs a Name from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Name} obj Optional instance to populate. - * @return {module:model/Name} The populated Name instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, name) { + obj['name'] = name; + } + + /** + * Constructs a Name from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Name} obj Optional instance to populate. + * @return {module:model/Name} The populated Name instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Name(); - - - - if (data.hasOwnProperty('name')) { obj['name'] = ApiClient.convertToType(data['name'], 'Number'); } @@ -74,30 +66,33 @@ export default class Name { return obj; } - /** - * @member {Number} name - */ - name = undefined; - /** - * @member {Number} snake_case - */ - snake_case = undefined; - /** - * @member {String} property - */ - property = undefined; - /** - * @member {Number} 123Number - */ - 123Number = undefined; - - - - - - - } +/** + * @member {Number} name + */ +Name.prototype['name'] = undefined; + +/** + * @member {Number} snake_case + */ +Name.prototype['snake_case'] = undefined; + +/** + * @member {String} property + */ +Name.prototype['property'] = undefined; + +/** + * @member {Number} 123Number + */ +Name.prototype['123Number'] = undefined; + + + + + + +export default Name; diff --git a/samples/client/petstore/javascript-es6/src/model/NumberOnly.js b/samples/client/petstore/javascript-es6/src/model/NumberOnly.js index e1f7978f7f6..ec5ad812b40 100644 --- a/samples/client/petstore/javascript-es6/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript-es6/src/model/NumberOnly.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The NumberOnly model module. -* @module model/NumberOnly -* @version 1.0.0 -*/ -export default class NumberOnly { + * The NumberOnly model module. + * @module model/NumberOnly + * @version 1.0.0 + */ +class NumberOnly { /** - * Constructs a new NumberOnly. - * @alias module:model/NumberOnly - * @class - */ - - constructor() { - - - - - - - + * Constructs a new NumberOnly. + * @alias module:model/NumberOnly + */ + constructor() { + NumberOnly.initialize(this); } /** - * Constructs a NumberOnly from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/NumberOnly} obj Optional instance to populate. - * @return {module:model/NumberOnly} The populated NumberOnly instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a NumberOnly from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/NumberOnly} obj Optional instance to populate. + * @return {module:model/NumberOnly} The populated NumberOnly instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new NumberOnly(); - - - - if (data.hasOwnProperty('JustNumber')) { obj['JustNumber'] = ApiClient.convertToType(data['JustNumber'], 'Number'); } @@ -63,18 +54,18 @@ export default class NumberOnly { return obj; } - /** - * @member {Number} JustNumber - */ - JustNumber = undefined; - - - - - - - } +/** + * @member {Number} JustNumber + */ +NumberOnly.prototype['JustNumber'] = undefined; + + + + + + +export default NumberOnly; diff --git a/samples/client/petstore/javascript-es6/src/model/Order.js b/samples/client/petstore/javascript-es6/src/model/Order.js index fb8bdd4ab9f..8c07a5cd0f3 100644 --- a/samples/client/petstore/javascript-es6/src/model/Order.js +++ b/samples/client/petstore/javascript-es6/src/model/Order.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Order model module. -* @module model/Order -* @version 1.0.0 -*/ -export default class Order { + * The Order model module. + * @module model/Order + * @version 1.0.0 + */ +class Order { /** - * Constructs a new Order. - * @alias module:model/Order - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Order. + * @alias module:model/Order + */ + constructor() { + Order.initialize(this); } /** - * Constructs a Order from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Order} obj Optional instance to populate. - * @return {module:model/Order} The populated Order instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Order from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Order} obj Optional instance to populate. + * @return {module:model/Order} The populated Order instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Order(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -78,66 +69,72 @@ export default class Order { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {Number} petId - */ - petId = undefined; - /** - * @member {Number} quantity - */ - quantity = undefined; - /** - * @member {Date} shipDate - */ - shipDate = undefined; - /** - * Order Status - * @member {module:model/Order.StatusEnum} status - */ - status = undefined; - /** - * @member {Boolean} complete - * @default false - */ - complete = false; - - - - - - - /** - * Allowed values for the status property. - * @enum {String} - * @readonly - */ - static StatusEnum = { - - /** - * value: "placed" - * @const - */ - "placed": "placed", - - /** - * value: "approved" - * @const - */ - "approved": "approved", - - /** - * value: "delivered" - * @const - */ - "delivered": "delivered" - }; - - } +/** + * @member {Number} id + */ +Order.prototype['id'] = undefined; + +/** + * @member {Number} petId + */ +Order.prototype['petId'] = undefined; + +/** + * @member {Number} quantity + */ +Order.prototype['quantity'] = undefined; + +/** + * @member {Date} shipDate + */ +Order.prototype['shipDate'] = undefined; + +/** + * Order Status + * @member {module:model/Order.StatusEnum} status + */ +Order.prototype['status'] = undefined; + +/** + * @member {Boolean} complete + * @default false + */ +Order.prototype['complete'] = false; + + + + + +/** + * Allowed values for the status property. + * @enum {String} + * @readonly + */ +Order['StatusEnum'] = { + + /** + * value: "placed" + * @const + */ + "placed": "placed", + + /** + * value: "approved" + * @const + */ + "approved": "approved", + + /** + * value: "delivered" + * @const + */ + "delivered": "delivered" +}; + + + +export default Order; diff --git a/samples/client/petstore/javascript-es6/src/model/OuterBoolean.js b/samples/client/petstore/javascript-es6/src/model/OuterBoolean.js deleted file mode 100644 index 592a0b69864..00000000000 --- a/samples/client/petstore/javascript-es6/src/model/OuterBoolean.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - */ - - -import ApiClient from '../ApiClient'; - - - - - -/** -* The OuterBoolean model module. -* @module model/OuterBoolean -* @version 1.0.0 -*/ -export default class OuterBoolean { - /** - * Constructs a new OuterBoolean. - * @alias module:model/OuterBoolean - * @class - */ - - constructor() { - - - - - - - - - } - - /** - * Constructs a OuterBoolean from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/OuterBoolean} obj Optional instance to populate. - * @return {module:model/OuterBoolean} The populated OuterBoolean instance. - */ - static constructFromObject(data, obj) { - if (data) { - obj = obj || new OuterBoolean(); - - - - - - } - return obj; - } - - - - - - - - - -} - - diff --git a/samples/client/petstore/javascript-es6/src/model/OuterComposite.js b/samples/client/petstore/javascript-es6/src/model/OuterComposite.js index ebacb2837d8..8b61cb8f654 100644 --- a/samples/client/petstore/javascript-es6/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript-es6/src/model/OuterComposite.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The OuterComposite model module. -* @module model/OuterComposite -* @version 1.0.0 -*/ -export default class OuterComposite { + * The OuterComposite model module. + * @module model/OuterComposite + * @version 1.0.0 + */ +class OuterComposite { /** - * Constructs a new OuterComposite. - * @alias module:model/OuterComposite - * @class - */ - - constructor() { - - - - - - - + * Constructs a new OuterComposite. + * @alias module:model/OuterComposite + */ + constructor() { + OuterComposite.initialize(this); } /** - * Constructs a OuterComposite from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/OuterComposite} obj Optional instance to populate. - * @return {module:model/OuterComposite} The populated OuterComposite instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a OuterComposite from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OuterComposite} obj Optional instance to populate. + * @return {module:model/OuterComposite} The populated OuterComposite instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new OuterComposite(); - - - - if (data.hasOwnProperty('my_number')) { obj['my_number'] = 'Number'.constructFromObject(data['my_number']); } @@ -69,26 +60,28 @@ export default class OuterComposite { return obj; } - /** - * @member {Number} my_number - */ - my_number = undefined; - /** - * @member {String} my_string - */ - my_string = undefined; - /** - * @member {Boolean} my_boolean - */ - my_boolean = undefined; - - - - - - - } +/** + * @member {Number} my_number + */ +OuterComposite.prototype['my_number'] = undefined; + +/** + * @member {String} my_string + */ +OuterComposite.prototype['my_string'] = undefined; + +/** + * @member {Boolean} my_boolean + */ +OuterComposite.prototype['my_boolean'] = undefined; + + + + + + +export default OuterComposite; diff --git a/samples/client/petstore/javascript-es6/src/model/OuterEnum.js b/samples/client/petstore/javascript-es6/src/model/OuterEnum.js index a31e00b729d..0404b03b061 100644 --- a/samples/client/petstore/javascript-es6/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript-es6/src/model/OuterEnum.js @@ -11,10 +11,7 @@ * */ - import ApiClient from '../ApiClient'; - - /** * Enum class OuterEnum. * @enum {} @@ -26,21 +23,21 @@ export default class OuterEnum { * value: "placed" * @const */ - placed = "placed"; + "placed" = "placed"; /** * value: "approved" * @const */ - approved = "approved"; + "approved" = "approved"; /** * value: "delivered" * @const */ - delivered = "delivered"; + "delivered" = "delivered"; @@ -54,4 +51,3 @@ export default class OuterEnum { } } - diff --git a/samples/client/petstore/javascript-es6/src/model/OuterNumber.js b/samples/client/petstore/javascript-es6/src/model/OuterNumber.js deleted file mode 100644 index ff65b1588b7..00000000000 --- a/samples/client/petstore/javascript-es6/src/model/OuterNumber.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - */ - - -import ApiClient from '../ApiClient'; - - - - - -/** -* The OuterNumber model module. -* @module model/OuterNumber -* @version 1.0.0 -*/ -export default class OuterNumber { - /** - * Constructs a new OuterNumber. - * @alias module:model/OuterNumber - * @class - */ - - constructor() { - - - - - - - - - } - - /** - * Constructs a OuterNumber from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/OuterNumber} obj Optional instance to populate. - * @return {module:model/OuterNumber} The populated OuterNumber instance. - */ - static constructFromObject(data, obj) { - if (data) { - obj = obj || new OuterNumber(); - - - - - - } - return obj; - } - - - - - - - - - -} - - diff --git a/samples/client/petstore/javascript-es6/src/model/OuterString.js b/samples/client/petstore/javascript-es6/src/model/OuterString.js deleted file mode 100644 index 6921029ede1..00000000000 --- a/samples/client/petstore/javascript-es6/src/model/OuterString.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - */ - - -import ApiClient from '../ApiClient'; - - - - - -/** -* The OuterString model module. -* @module model/OuterString -* @version 1.0.0 -*/ -export default class OuterString { - /** - * Constructs a new OuterString. - * @alias module:model/OuterString - * @class - */ - - constructor() { - - - - - - - - - } - - /** - * Constructs a OuterString from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/OuterString} obj Optional instance to populate. - * @return {module:model/OuterString} The populated OuterString instance. - */ - static constructFromObject(data, obj) { - if (data) { - obj = obj || new OuterString(); - - - - - - } - return obj; - } - - - - - - - - - -} - - diff --git a/samples/client/petstore/javascript-es6/src/model/Pet.js b/samples/client/petstore/javascript-es6/src/model/Pet.js index 4edbd6e3d75..37b987fdf81 100644 --- a/samples/client/petstore/javascript-es6/src/model/Pet.js +++ b/samples/client/petstore/javascript-es6/src/model/Pet.js @@ -11,55 +11,48 @@ * */ - import ApiClient from '../ApiClient'; import Category from './Category'; import Tag from './Tag'; - - - - /** -* The Pet model module. -* @module model/Pet -* @version 1.0.0 -*/ -export default class Pet { + * The Pet model module. + * @module model/Pet + * @version 1.0.0 + */ +class Pet { /** - * Constructs a new Pet. - * @alias module:model/Pet - * @class - * @param name {String} - * @param photoUrls {Array.} - */ - - constructor(name, photoUrls) { - - - - - - this['name'] = name;this['photoUrls'] = photoUrls; - + * Constructs a new Pet. + * @alias module:model/Pet + * @param name {String} + * @param photoUrls {Array.} + */ + constructor(name, photoUrls) { + Pet.initialize(this, name, photoUrls); } /** - * Constructs a Pet from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Pet} obj Optional instance to populate. - * @return {module:model/Pet} The populated Pet instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, name, photoUrls) { + obj['name'] = name; + obj['photoUrls'] = photoUrls; + } + + /** + * Constructs a Pet from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Pet} obj Optional instance to populate. + * @return {module:model/Pet} The populated Pet instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Pet(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -82,65 +75,71 @@ export default class Pet { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {module:model/Category} category - */ - category = undefined; - /** - * @member {String} name - */ - name = undefined; - /** - * @member {Array.} photoUrls - */ - photoUrls = undefined; - /** - * @member {Array.} tags - */ - tags = undefined; - /** - * pet status in the store - * @member {module:model/Pet.StatusEnum} status - */ - status = undefined; - - - - - - - /** - * Allowed values for the status property. - * @enum {String} - * @readonly - */ - static StatusEnum = { - - /** - * value: "available" - * @const - */ - "available": "available", - - /** - * value: "pending" - * @const - */ - "pending": "pending", - - /** - * value: "sold" - * @const - */ - "sold": "sold" - }; - - } +/** + * @member {Number} id + */ +Pet.prototype['id'] = undefined; + +/** + * @member {module:model/Category} category + */ +Pet.prototype['category'] = undefined; + +/** + * @member {String} name + */ +Pet.prototype['name'] = undefined; + +/** + * @member {Array.} photoUrls + */ +Pet.prototype['photoUrls'] = undefined; + +/** + * @member {Array.} tags + */ +Pet.prototype['tags'] = undefined; + +/** + * pet status in the store + * @member {module:model/Pet.StatusEnum} status + */ +Pet.prototype['status'] = undefined; + + + + + +/** + * Allowed values for the status property. + * @enum {String} + * @readonly + */ +Pet['StatusEnum'] = { + + /** + * value: "available" + * @const + */ + "available": "available", + + /** + * value: "pending" + * @const + */ + "pending": "pending", + + /** + * value: "sold" + * @const + */ + "sold": "sold" +}; + + + +export default Pet; diff --git a/samples/client/petstore/javascript-es6/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript-es6/src/model/ReadOnlyFirst.js index 5aee0fce320..289277c191d 100644 --- a/samples/client/petstore/javascript-es6/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript-es6/src/model/ReadOnlyFirst.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ReadOnlyFirst model module. -* @module model/ReadOnlyFirst -* @version 1.0.0 -*/ -export default class ReadOnlyFirst { + * The ReadOnlyFirst model module. + * @module model/ReadOnlyFirst + * @version 1.0.0 + */ +class ReadOnlyFirst { /** - * Constructs a new ReadOnlyFirst. - * @alias module:model/ReadOnlyFirst - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ReadOnlyFirst. + * @alias module:model/ReadOnlyFirst + */ + constructor() { + ReadOnlyFirst.initialize(this); } /** - * Constructs a ReadOnlyFirst from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ReadOnlyFirst} obj Optional instance to populate. - * @return {module:model/ReadOnlyFirst} The populated ReadOnlyFirst instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ReadOnlyFirst from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ReadOnlyFirst} obj Optional instance to populate. + * @return {module:model/ReadOnlyFirst} The populated ReadOnlyFirst instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ReadOnlyFirst(); - - - - if (data.hasOwnProperty('bar')) { obj['bar'] = ApiClient.convertToType(data['bar'], 'String'); } @@ -66,22 +57,23 @@ export default class ReadOnlyFirst { return obj; } - /** - * @member {String} bar - */ - bar = undefined; - /** - * @member {String} baz - */ - baz = undefined; - - - - - - - } +/** + * @member {String} bar + */ +ReadOnlyFirst.prototype['bar'] = undefined; + +/** + * @member {String} baz + */ +ReadOnlyFirst.prototype['baz'] = undefined; + + + + + + +export default ReadOnlyFirst; diff --git a/samples/client/petstore/javascript-es6/src/model/SpecialModelName.js b/samples/client/petstore/javascript-es6/src/model/SpecialModelName.js index c00da7303e9..be9f36a855f 100644 --- a/samples/client/petstore/javascript-es6/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript-es6/src/model/SpecialModelName.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The SpecialModelName model module. -* @module model/SpecialModelName -* @version 1.0.0 -*/ -export default class SpecialModelName { + * The SpecialModelName model module. + * @module model/SpecialModelName + * @version 1.0.0 + */ +class SpecialModelName { /** - * Constructs a new SpecialModelName. - * @alias module:model/SpecialModelName - * @class - */ - - constructor() { - - - - - - - + * Constructs a new SpecialModelName. + * @alias module:model/SpecialModelName + */ + constructor() { + SpecialModelName.initialize(this); } /** - * Constructs a SpecialModelName from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/SpecialModelName} obj Optional instance to populate. - * @return {module:model/SpecialModelName} The populated SpecialModelName instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a SpecialModelName from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/SpecialModelName} obj Optional instance to populate. + * @return {module:model/SpecialModelName} The populated SpecialModelName instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new SpecialModelName(); - - - - if (data.hasOwnProperty('$special[property.name]')) { obj['$special[property.name]'] = ApiClient.convertToType(data['$special[property.name]'], 'Number'); } @@ -63,18 +54,18 @@ export default class SpecialModelName { return obj; } - /** - * @member {Number} $special[property.name] - */ - $special[property.name] = undefined; - - - - - - - } +/** + * @member {Number} $special[property.name] + */ +SpecialModelName.prototype['$special[property.name]'] = undefined; + + + + + + +export default SpecialModelName; diff --git a/samples/client/petstore/javascript-es6/src/model/Tag.js b/samples/client/petstore/javascript-es6/src/model/Tag.js index 994da23e2a7..0d39a36833a 100644 --- a/samples/client/petstore/javascript-es6/src/model/Tag.js +++ b/samples/client/petstore/javascript-es6/src/model/Tag.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Tag model module. -* @module model/Tag -* @version 1.0.0 -*/ -export default class Tag { + * The Tag model module. + * @module model/Tag + * @version 1.0.0 + */ +class Tag { /** - * Constructs a new Tag. - * @alias module:model/Tag - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Tag. + * @alias module:model/Tag + */ + constructor() { + Tag.initialize(this); } /** - * Constructs a Tag from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Tag} obj Optional instance to populate. - * @return {module:model/Tag} The populated Tag instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Tag from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Tag} obj Optional instance to populate. + * @return {module:model/Tag} The populated Tag instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Tag(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -66,22 +57,23 @@ export default class Tag { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {String} name - */ - name = undefined; - - - - - - - } +/** + * @member {Number} id + */ +Tag.prototype['id'] = undefined; + +/** + * @member {String} name + */ +Tag.prototype['name'] = undefined; + + + + + + +export default Tag; diff --git a/samples/client/petstore/javascript-es6/src/model/User.js b/samples/client/petstore/javascript-es6/src/model/User.js index c0f5ef56e6f..7f8e2848e18 100644 --- a/samples/client/petstore/javascript-es6/src/model/User.js +++ b/samples/client/petstore/javascript-es6/src/model/User.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The User model module. -* @module model/User -* @version 1.0.0 -*/ -export default class User { + * The User model module. + * @module model/User + * @version 1.0.0 + */ +class User { /** - * Constructs a new User. - * @alias module:model/User - * @class - */ - - constructor() { - - - - - - - + * Constructs a new User. + * @alias module:model/User + */ + constructor() { + User.initialize(this); } /** - * Constructs a User from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/User} obj Optional instance to populate. - * @return {module:model/User} The populated User instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a User from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/User} obj Optional instance to populate. + * @return {module:model/User} The populated User instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new User(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -84,47 +75,54 @@ export default class User { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {String} username - */ - username = undefined; - /** - * @member {String} firstName - */ - firstName = undefined; - /** - * @member {String} lastName - */ - lastName = undefined; - /** - * @member {String} email - */ - email = undefined; - /** - * @member {String} password - */ - password = undefined; - /** - * @member {String} phone - */ - phone = undefined; - /** - * User Status - * @member {Number} userStatus - */ - userStatus = undefined; - - - - - - - } +/** + * @member {Number} id + */ +User.prototype['id'] = undefined; + +/** + * @member {String} username + */ +User.prototype['username'] = undefined; + +/** + * @member {String} firstName + */ +User.prototype['firstName'] = undefined; + +/** + * @member {String} lastName + */ +User.prototype['lastName'] = undefined; + +/** + * @member {String} email + */ +User.prototype['email'] = undefined; + +/** + * @member {String} password + */ +User.prototype['password'] = undefined; + +/** + * @member {String} phone + */ +User.prototype['phone'] = undefined; + +/** + * User Status + * @member {Number} userStatus + */ +User.prototype['userStatus'] = undefined; + + + + + + +export default User; diff --git a/samples/client/petstore/javascript-es6/src/test/ApiClientTest.js b/samples/client/petstore/javascript-es6/src/test/ApiClientTest.js new file mode 100644 index 00000000000..5e98b685a91 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/ApiClientTest.js @@ -0,0 +1,393 @@ +if (typeof module === 'object' && module.exports) { + var expect = require('expect.js'); + var SwaggerPetstore = require('../src/index'); + var sinon = require('sinon'); +} + +var apiClient = SwaggerPetstore.ApiClient.instance; + +describe('ApiClient', function() { + describe('defaults', function() { + it('should have correct default values with the default API client', function() { + expect(apiClient).to.be.ok(); + expect(apiClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(apiClient.authentications).to.eql({ + petstore_auth: {type: 'oauth2'}, + http_basic_test: {type: 'basic'}, + api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'}, + api_key_query: {type: 'apiKey', 'in': 'query', name: 'api_key_query'}, + /* comment out the following as these fake security def (testing purpose) + * are removed from the spec, we'll add these back after updating the + * petstore server + * + test_http_basic: {type: 'basic'}, + test_api_client_id: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_id' + }, + test_api_client_secret: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_secret' + }, + test_api_key_query: { + type: 'apiKey', + 'in': 'query', + name: 'test_api_key_query' + }, + test_api_key_header: { + type: 'apiKey', + 'in': 'header', + name: 'test_api_key_header' + }*/ + }); + }); + + it('should have correct default values with new API client and can customize it', function() { + var newClient = new SwaggerPetstore.ApiClient; + expect(newClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(newClient.buildUrl('/abc', {})).to.be('http://petstore.swagger.io:80/v2/abc'); + + newClient.basePath = 'http://example.com'; + expect(newClient.basePath).to.be('http://example.com'); + expect(newClient.buildUrl('/abc', {})).to.be('http://example.com/abc'); + }); + }); + + describe('#paramToString', function() { + it('should return empty string for null and undefined', function() { + expect(apiClient.paramToString(null)).to.be(''); + expect(apiClient.paramToString(undefined)).to.be(''); + }); + + it('should return string', function() { + expect(apiClient.paramToString('')).to.be(''); + expect(apiClient.paramToString('abc')).to.be('abc'); + expect(apiClient.paramToString(123)).to.be('123'); + }); + }); + + describe('#buildCollectionParam', function() { + var param; + + beforeEach(function() { + param = ['aa', 'bb', 123]; + }); + + it('works for csv', function() { + expect(apiClient.buildCollectionParam(param, 'csv')).to.be('aa,bb,123'); + }); + + it('works for ssv', function() { + expect(apiClient.buildCollectionParam(param, 'ssv')).to.be('aa bb 123'); + }); + + it('works for tsv', function() { + expect(apiClient.buildCollectionParam(param, 'tsv')).to.be('aa\tbb\t123'); + }); + + it('works for pipes', function() { + expect(apiClient.buildCollectionParam(param, 'pipes')).to.be('aa|bb|123'); + }); + + it('works for multi', function() { + expect(apiClient.buildCollectionParam(param, 'multi')).to.eql(['aa', 'bb', '123']); + }); + + it('fails for invalid collection format', function() { + expect(function() { apiClient.buildCollectionParam(param, 'INVALID'); }).to.throwError(); + }); + }); + + describe('#buildUrl', function() { + it('should work without path parameters in the path', function() { + expect(apiClient.buildUrl('/abc', {})).to + .be('http://petstore.swagger.io:80/v2/abc'); + expect(apiClient.buildUrl('/abc/def?ok', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/abc/def?ok'); + }); + + it('should work with path parameters in the path', function() { + expect(apiClient.buildUrl('/{id}', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/123'); + expect(apiClient.buildUrl('/abc/{id}/{name}?ok', {id: 456, name: 'a b'})).to. + be('http://petstore.swagger.io:80/v2/abc/456/a%20b?ok'); + }); + }); + + describe('#isJsonMime', function() { + it('should return true for JSON MIME', function() { + expect(apiClient.isJsonMime('application/json')).to.be(true); + expect(apiClient.isJsonMime('application/json; charset=UTF8')).to.be(true); + expect(apiClient.isJsonMime('APPLICATION/JSON')).to.be(true); + }); + + it('should return false for non-JSON MIME', function() { + expect(apiClient.isJsonMime('')).to.be(false); + expect(apiClient.isJsonMime('text/plain')).to.be(false); + expect(apiClient.isJsonMime('application/xml')).to.be(false); + expect(apiClient.isJsonMime('application/jsonp')).to.be(false); + }); + }); + + describe('#applyAuthToRequest', function() { + var req, newClient; + + beforeEach(function() { + req = { + auth: function() {}, + set: function() {}, + query: function() {} + }; + sinon.stub(req, 'auth'); + sinon.stub(req, 'set'); + sinon.stub(req, 'query'); + newClient = new SwaggerPetstore.ApiClient(); + }); + + describe('basic', function() { + var authName = 'testBasicAuth'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'basic'}; + auth = newClient.authentications[authName]; + }); + + it('sets auth header with username and password set', function() { + auth.username = 'user'; + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjpwYXNz' is base64-encoded string of 'user:pass' + sinon.assert.calledWithMatch(req.auth, 'user', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only username set', function() { + auth.username = 'user'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjo=' is base64-encoded string of 'user:' + sinon.assert.calledWithMatch(req.auth, 'user', ''); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only password set', function() { + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'OnBhc3M=' is base64-encoded string of ':pass' + sinon.assert.calledWithMatch(req.auth, '', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('does not set header when username and password are not set', function() { + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + }); + + describe('apiKey', function() { + var authName = 'testApiKey'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'apiKey', name: 'api_key'}; + auth = newClient.authentications[authName]; + }); + + it('sets api key in header', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('sets api key in query', function() { + auth.in = 'query'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + + it('sets api key in header with prefix', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + auth.apiKeyPrefix = 'Key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'Key my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when api key is not set', function() { + auth.in = 'query'; + auth.apiKey = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('oauth2', function() { + var authName = 'testOAuth2'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'oauth2'}; + auth = newClient.authentications[authName]; + }); + + it('sets access token in header', function() { + auth.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when access token is not set', function() { + auth.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('apiKey and oauth2', function() { + var apiKeyAuthName = 'testApiKey'; + var oauth2Name = 'testOAuth2'; + var authNames = [apiKeyAuthName, oauth2Name]; + var apiKeyAuth, oauth2; + + beforeEach(function() { + newClient.authentications[apiKeyAuthName] = {type: 'apiKey', name: 'api_key', 'in': 'query'}; + newClient.authentications[oauth2Name] = {type: 'oauth2'}; + apiKeyAuth = newClient.authentications[apiKeyAuthName]; + oauth2 = newClient.authentications[oauth2Name]; + }); + + it('works when setting both api key and access token', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + }); + + it('works when setting only api key', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + }); + + it('works when neither api key nor access token is set', function() { + apiKeyAuth.apiKey = null; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('unknown type', function() { + var authName = 'unknown'; + var authNames = [authName]; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'UNKNOWN'}; + }); + + it('throws error for unknown auth type', function() { + expect(function() { + newClient.applyAuthToRequest(req, authNames); + }).to.throwError(); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + }); + }); + + /* + describe('#defaultHeaders', function() { + it('should initialize default headers to be an empty object', function() { + expect(apiClient.defaultHeaders).to.eql({}); + }); + + it('should put default headers in request', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var expected = {'Content-Type': 'text/plain', 'api_key': 'special-key'}; + expect(newClient.defaultHeaders).to.eql(expected); + var req = makeDumbRequest(newClient); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + + it('should override default headers with provided header params', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var headerParams = {'Content-Type': 'application/json', 'Authorization': 'Bearer test-token'} + var expected = { + 'Content-Type': 'application/json', + 'api_key': 'special-key', + 'Authorization': 'Bearer test-token' + }; + var req = makeDumbRequest(newClient, {headerParams: headerParams}); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + }); +*/ + +}); + +function makeDumbRequest(apiClient, opts) { + opts = opts || {}; + var path = opts.path || '/store/inventory'; + var httpMethod = opts.httpMethod || 'GET'; + var pathParams = opts.pathParams || {}; + var queryParams = opts.queryParams || {}; + var headerParams = opts.headerParams || {}; + var formParams = opts.formParams || {}; + var bodyParam = opts.bodyParam; + var authNames = []; + var contentTypes = opts.contentTypes || []; + var accepts = opts.accepts || []; + var callback = opts.callback; + return apiClient.callApi(path, httpMethod, pathParams, queryParams, + headerParams, formParams, bodyParam, authNames, contentTypes, accepts); +} diff --git a/samples/client/petstore/javascript-es6/src/test/api/AnotherFakeApi.spec.js b/samples/client/petstore/javascript-es6/src/test/api/AnotherFakeApi.spec.js new file mode 100644 index 00000000000..f55538a53e7 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/api/AnotherFakeApi.spec.js @@ -0,0 +1,63 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.AnotherFakeApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AnotherFakeApi', function() { + describe('testSpecialTags', function() { + it('should call testSpecialTags successfully', function(done) { + //uncomment below and update the code to test testSpecialTags + //instance.testSpecialTags(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/api/FakeApi.spec.js b/samples/client/petstore/javascript-es6/src/test/api/FakeApi.spec.js new file mode 100644 index 00000000000..f2903d6612c --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/api/FakeApi.spec.js @@ -0,0 +1,123 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.FakeApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('FakeApi', function() { + describe('fakeOuterBooleanSerialize', function() { + it('should call fakeOuterBooleanSerialize successfully', function(done) { + //uncomment below and update the code to test fakeOuterBooleanSerialize + //instance.fakeOuterBooleanSerialize(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('fakeOuterCompositeSerialize', function() { + it('should call fakeOuterCompositeSerialize successfully', function(done) { + //uncomment below and update the code to test fakeOuterCompositeSerialize + //instance.fakeOuterCompositeSerialize(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('fakeOuterNumberSerialize', function() { + it('should call fakeOuterNumberSerialize successfully', function(done) { + //uncomment below and update the code to test fakeOuterNumberSerialize + //instance.fakeOuterNumberSerialize(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('fakeOuterStringSerialize', function() { + it('should call fakeOuterStringSerialize successfully', function(done) { + //uncomment below and update the code to test fakeOuterStringSerialize + //instance.fakeOuterStringSerialize(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('testClientModel', function() { + it('should call testClientModel successfully', function(done) { + //uncomment below and update the code to test testClientModel + //instance.testClientModel(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('testEndpointParameters', function() { + it('should call testEndpointParameters successfully', function(done) { + //uncomment below and update the code to test testEndpointParameters + //instance.testEndpointParameters(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('testEnumParameters', function() { + it('should call testEnumParameters successfully', function(done) { + //uncomment below and update the code to test testEnumParameters + //instance.testEnumParameters(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/api/FakeClassnameTags123Api.spec.js b/samples/client/petstore/javascript-es6/src/test/api/FakeClassnameTags123Api.spec.js new file mode 100644 index 00000000000..10e20e7778a --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/api/FakeClassnameTags123Api.spec.js @@ -0,0 +1,63 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.FakeClassnameTags123Api(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('FakeClassnameTags123Api', function() { + describe('testClassname', function() { + it('should call testClassname successfully', function(done) { + //uncomment below and update the code to test testClassname + //instance.testClassname(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/api/PetApi.spec.js b/samples/client/petstore/javascript-es6/src/test/api/PetApi.spec.js new file mode 100644 index 00000000000..5259a2c6665 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/api/PetApi.spec.js @@ -0,0 +1,133 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.PetApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('PetApi', function() { + describe('addPet', function() { + it('should call addPet successfully', function(done) { + //uncomment below and update the code to test addPet + //instance.addPet(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('deletePet', function() { + it('should call deletePet successfully', function(done) { + //uncomment below and update the code to test deletePet + //instance.deletePet(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('findPetsByStatus', function() { + it('should call findPetsByStatus successfully', function(done) { + //uncomment below and update the code to test findPetsByStatus + //instance.findPetsByStatus(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('findPetsByTags', function() { + it('should call findPetsByTags successfully', function(done) { + //uncomment below and update the code to test findPetsByTags + //instance.findPetsByTags(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getPetById', function() { + it('should call getPetById successfully', function(done) { + //uncomment below and update the code to test getPetById + //instance.getPetById(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('updatePet', function() { + it('should call updatePet successfully', function(done) { + //uncomment below and update the code to test updatePet + //instance.updatePet(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('updatePetWithForm', function() { + it('should call updatePetWithForm successfully', function(done) { + //uncomment below and update the code to test updatePetWithForm + //instance.updatePetWithForm(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('uploadFile', function() { + it('should call uploadFile successfully', function(done) { + //uncomment below and update the code to test uploadFile + //instance.uploadFile(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/api/StoreApi.spec.js b/samples/client/petstore/javascript-es6/src/test/api/StoreApi.spec.js new file mode 100644 index 00000000000..d19da2f28d8 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/api/StoreApi.spec.js @@ -0,0 +1,93 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.StoreApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('StoreApi', function() { + describe('deleteOrder', function() { + it('should call deleteOrder successfully', function(done) { + //uncomment below and update the code to test deleteOrder + //instance.deleteOrder(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getInventory', function() { + it('should call getInventory successfully', function(done) { + //uncomment below and update the code to test getInventory + //instance.getInventory(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getOrderById', function() { + it('should call getOrderById successfully', function(done) { + //uncomment below and update the code to test getOrderById + //instance.getOrderById(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('placeOrder', function() { + it('should call placeOrder successfully', function(done) { + //uncomment below and update the code to test placeOrder + //instance.placeOrder(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/api/UserApi.spec.js b/samples/client/petstore/javascript-es6/src/test/api/UserApi.spec.js new file mode 100644 index 00000000000..55c8967f13b --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/api/UserApi.spec.js @@ -0,0 +1,133 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.UserApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('UserApi', function() { + describe('createUser', function() { + it('should call createUser successfully', function(done) { + //uncomment below and update the code to test createUser + //instance.createUser(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('createUsersWithArrayInput', function() { + it('should call createUsersWithArrayInput successfully', function(done) { + //uncomment below and update the code to test createUsersWithArrayInput + //instance.createUsersWithArrayInput(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('createUsersWithListInput', function() { + it('should call createUsersWithListInput successfully', function(done) { + //uncomment below and update the code to test createUsersWithListInput + //instance.createUsersWithListInput(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('deleteUser', function() { + it('should call deleteUser successfully', function(done) { + //uncomment below and update the code to test deleteUser + //instance.deleteUser(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getUserByName', function() { + it('should call getUserByName successfully', function(done) { + //uncomment below and update the code to test getUserByName + //instance.getUserByName(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('loginUser', function() { + it('should call loginUser successfully', function(done) { + //uncomment below and update the code to test loginUser + //instance.loginUser(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('logoutUser', function() { + it('should call logoutUser successfully', function(done) { + //uncomment below and update the code to test logoutUser + //instance.logoutUser(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('updateUser', function() { + it('should call updateUser successfully', function(done) { + //uncomment below and update the code to test updateUser + //instance.updateUser(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/AdditionalPropertiesClass.spec.js b/samples/client/petstore/javascript-es6/src/test/model/AdditionalPropertiesClass.spec.js new file mode 100644 index 00000000000..887052c0109 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/AdditionalPropertiesClass.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.AdditionalPropertiesClass(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AdditionalPropertiesClass', function() { + it('should create an instance of AdditionalPropertiesClass', function() { + // uncomment below and update the code to test AdditionalPropertiesClass + //var instane = new SwaggerPetstore.AdditionalPropertiesClass(); + //expect(instance).to.be.a(SwaggerPetstore.AdditionalPropertiesClass); + }); + + it('should have the property mapProperty (base name: "map_property")', function() { + // uncomment below and update the code to test the property mapProperty + //var instane = new SwaggerPetstore.AdditionalPropertiesClass(); + //expect(instance).to.be(); + }); + + it('should have the property mapOfMapProperty (base name: "map_of_map_property")', function() { + // uncomment below and update the code to test the property mapOfMapProperty + //var instane = new SwaggerPetstore.AdditionalPropertiesClass(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Animal.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Animal.spec.js new file mode 100644 index 00000000000..4270461cc5e --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Animal.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Animal(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Animal', function() { + it('should create an instance of Animal', function() { + // uncomment below and update the code to test Animal + //var instane = new SwaggerPetstore.Animal(); + //expect(instance).to.be.a(SwaggerPetstore.Animal); + }); + + it('should have the property className (base name: "className")', function() { + // uncomment below and update the code to test the property className + //var instane = new SwaggerPetstore.Animal(); + //expect(instance).to.be(); + }); + + it('should have the property color (base name: "color")', function() { + // uncomment below and update the code to test the property color + //var instane = new SwaggerPetstore.Animal(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/AnimalFarm.spec.js b/samples/client/petstore/javascript-es6/src/test/model/AnimalFarm.spec.js new file mode 100644 index 00000000000..ffc54a3c381 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/AnimalFarm.spec.js @@ -0,0 +1,59 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.AnimalFarm(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AnimalFarm', function() { + it('should create an instance of AnimalFarm', function() { + // uncomment below and update the code to test AnimalFarm + //var instane = new SwaggerPetstore.AnimalFarm(); + //expect(instance).to.be.a(SwaggerPetstore.AnimalFarm); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/ApiResponse.spec.js b/samples/client/petstore/javascript-es6/src/test/model/ApiResponse.spec.js new file mode 100644 index 00000000000..1070013e367 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/ApiResponse.spec.js @@ -0,0 +1,77 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.ApiResponse(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ApiResponse', function() { + it('should create an instance of ApiResponse', function() { + // uncomment below and update the code to test ApiResponse + //var instane = new SwaggerPetstore.ApiResponse(); + //expect(instance).to.be.a(SwaggerPetstore.ApiResponse); + }); + + it('should have the property code (base name: "code")', function() { + // uncomment below and update the code to test the property code + //var instane = new SwaggerPetstore.ApiResponse(); + //expect(instance).to.be(); + }); + + it('should have the property type (base name: "type")', function() { + // uncomment below and update the code to test the property type + //var instane = new SwaggerPetstore.ApiResponse(); + //expect(instance).to.be(); + }); + + it('should have the property message (base name: "message")', function() { + // uncomment below and update the code to test the property message + //var instane = new SwaggerPetstore.ApiResponse(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/ArrayOfArrayOfNumberOnly.spec.js b/samples/client/petstore/javascript-es6/src/test/model/ArrayOfArrayOfNumberOnly.spec.js new file mode 100644 index 00000000000..9fcd218fbb3 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/ArrayOfArrayOfNumberOnly.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.ArrayOfArrayOfNumberOnly(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ArrayOfArrayOfNumberOnly', function() { + it('should create an instance of ArrayOfArrayOfNumberOnly', function() { + // uncomment below and update the code to test ArrayOfArrayOfNumberOnly + //var instane = new SwaggerPetstore.ArrayOfArrayOfNumberOnly(); + //expect(instance).to.be.a(SwaggerPetstore.ArrayOfArrayOfNumberOnly); + }); + + it('should have the property arrayArrayNumber (base name: "ArrayArrayNumber")', function() { + // uncomment below and update the code to test the property arrayArrayNumber + //var instane = new SwaggerPetstore.ArrayOfArrayOfNumberOnly(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/ArrayOfNumberOnly.spec.js b/samples/client/petstore/javascript-es6/src/test/model/ArrayOfNumberOnly.spec.js new file mode 100644 index 00000000000..32d5f98586a --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/ArrayOfNumberOnly.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.ArrayOfNumberOnly(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ArrayOfNumberOnly', function() { + it('should create an instance of ArrayOfNumberOnly', function() { + // uncomment below and update the code to test ArrayOfNumberOnly + //var instane = new SwaggerPetstore.ArrayOfNumberOnly(); + //expect(instance).to.be.a(SwaggerPetstore.ArrayOfNumberOnly); + }); + + it('should have the property arrayNumber (base name: "ArrayNumber")', function() { + // uncomment below and update the code to test the property arrayNumber + //var instane = new SwaggerPetstore.ArrayOfNumberOnly(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/ArrayTest.spec.js b/samples/client/petstore/javascript-es6/src/test/model/ArrayTest.spec.js new file mode 100644 index 00000000000..1d93d897a9d --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/ArrayTest.spec.js @@ -0,0 +1,77 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.ArrayTest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ArrayTest', function() { + it('should create an instance of ArrayTest', function() { + // uncomment below and update the code to test ArrayTest + //var instane = new SwaggerPetstore.ArrayTest(); + //expect(instance).to.be.a(SwaggerPetstore.ArrayTest); + }); + + it('should have the property arrayOfString (base name: "array_of_string")', function() { + // uncomment below and update the code to test the property arrayOfString + //var instane = new SwaggerPetstore.ArrayTest(); + //expect(instance).to.be(); + }); + + it('should have the property arrayArrayOfInteger (base name: "array_array_of_integer")', function() { + // uncomment below and update the code to test the property arrayArrayOfInteger + //var instane = new SwaggerPetstore.ArrayTest(); + //expect(instance).to.be(); + }); + + it('should have the property arrayArrayOfModel (base name: "array_array_of_model")', function() { + // uncomment below and update the code to test the property arrayArrayOfModel + //var instane = new SwaggerPetstore.ArrayTest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Capitalization.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Capitalization.spec.js new file mode 100644 index 00000000000..f1aa695c3fd --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Capitalization.spec.js @@ -0,0 +1,95 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Capitalization(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Capitalization', function() { + it('should create an instance of Capitalization', function() { + // uncomment below and update the code to test Capitalization + //var instane = new SwaggerPetstore.Capitalization(); + //expect(instance).to.be.a(SwaggerPetstore.Capitalization); + }); + + it('should have the property smallCamel (base name: "smallCamel")', function() { + // uncomment below and update the code to test the property smallCamel + //var instane = new SwaggerPetstore.Capitalization(); + //expect(instance).to.be(); + }); + + it('should have the property capitalCamel (base name: "CapitalCamel")', function() { + // uncomment below and update the code to test the property capitalCamel + //var instane = new SwaggerPetstore.Capitalization(); + //expect(instance).to.be(); + }); + + it('should have the property smallSnake (base name: "small_Snake")', function() { + // uncomment below and update the code to test the property smallSnake + //var instane = new SwaggerPetstore.Capitalization(); + //expect(instance).to.be(); + }); + + it('should have the property capitalSnake (base name: "Capital_Snake")', function() { + // uncomment below and update the code to test the property capitalSnake + //var instane = new SwaggerPetstore.Capitalization(); + //expect(instance).to.be(); + }); + + it('should have the property sCAETHFlowPoints (base name: "SCA_ETH_Flow_Points")', function() { + // uncomment below and update the code to test the property sCAETHFlowPoints + //var instane = new SwaggerPetstore.Capitalization(); + //expect(instance).to.be(); + }); + + it('should have the property ATT_NAME (base name: "ATT_NAME")', function() { + // uncomment below and update the code to test the property ATT_NAME + //var instane = new SwaggerPetstore.Capitalization(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Cat.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Cat.spec.js new file mode 100644 index 00000000000..f0d5476b268 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Cat.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Cat(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Cat', function() { + it('should create an instance of Cat', function() { + // uncomment below and update the code to test Cat + //var instane = new SwaggerPetstore.Cat(); + //expect(instance).to.be.a(SwaggerPetstore.Cat); + }); + + it('should have the property declawed (base name: "declawed")', function() { + // uncomment below and update the code to test the property declawed + //var instane = new SwaggerPetstore.Cat(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Category.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Category.spec.js new file mode 100644 index 00000000000..561eaf8373e --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Category.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Category(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Category', function() { + it('should create an instance of Category', function() { + // uncomment below and update the code to test Category + //var instane = new SwaggerPetstore.Category(); + //expect(instance).to.be.a(SwaggerPetstore.Category); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new SwaggerPetstore.Category(); + //expect(instance).to.be(); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new SwaggerPetstore.Category(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/ClassModel.spec.js b/samples/client/petstore/javascript-es6/src/test/model/ClassModel.spec.js new file mode 100644 index 00000000000..5ee2e49a0de --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/ClassModel.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.ClassModel(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ClassModel', function() { + it('should create an instance of ClassModel', function() { + // uncomment below and update the code to test ClassModel + //var instane = new SwaggerPetstore.ClassModel(); + //expect(instance).to.be.a(SwaggerPetstore.ClassModel); + }); + + it('should have the property _class (base name: "_class")', function() { + // uncomment below and update the code to test the property _class + //var instane = new SwaggerPetstore.ClassModel(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Client.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Client.spec.js new file mode 100644 index 00000000000..03af5ef730e --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Client.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Client(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Client', function() { + it('should create an instance of Client', function() { + // uncomment below and update the code to test Client + //var instane = new SwaggerPetstore.Client(); + //expect(instance).to.be.a(SwaggerPetstore.Client); + }); + + it('should have the property client (base name: "client")', function() { + // uncomment below and update the code to test the property client + //var instane = new SwaggerPetstore.Client(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Dog.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Dog.spec.js new file mode 100644 index 00000000000..6421a501134 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Dog.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Dog(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Dog', function() { + it('should create an instance of Dog', function() { + // uncomment below and update the code to test Dog + //var instane = new SwaggerPetstore.Dog(); + //expect(instance).to.be.a(SwaggerPetstore.Dog); + }); + + it('should have the property breed (base name: "breed")', function() { + // uncomment below and update the code to test the property breed + //var instane = new SwaggerPetstore.Dog(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/EnumArrays.spec.js b/samples/client/petstore/javascript-es6/src/test/model/EnumArrays.spec.js new file mode 100644 index 00000000000..45c8d595bb6 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/EnumArrays.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.EnumArrays(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('EnumArrays', function() { + it('should create an instance of EnumArrays', function() { + // uncomment below and update the code to test EnumArrays + //var instane = new SwaggerPetstore.EnumArrays(); + //expect(instance).to.be.a(SwaggerPetstore.EnumArrays); + }); + + it('should have the property justSymbol (base name: "just_symbol")', function() { + // uncomment below and update the code to test the property justSymbol + //var instane = new SwaggerPetstore.EnumArrays(); + //expect(instance).to.be(); + }); + + it('should have the property arrayEnum (base name: "array_enum")', function() { + // uncomment below and update the code to test the property arrayEnum + //var instane = new SwaggerPetstore.EnumArrays(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/EnumClass.spec.js b/samples/client/petstore/javascript-es6/src/test/model/EnumClass.spec.js new file mode 100644 index 00000000000..2f60b4fc4a4 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/EnumClass.spec.js @@ -0,0 +1,58 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('EnumClass', function() { + it('should create an instance of EnumClass', function() { + // uncomment below and update the code to test EnumClass + //var instane = new SwaggerPetstore.EnumClass(); + //expect(instance).to.be.a(SwaggerPetstore.EnumClass); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/EnumTest.spec.js b/samples/client/petstore/javascript-es6/src/test/model/EnumTest.spec.js new file mode 100644 index 00000000000..1a08cba3d72 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/EnumTest.spec.js @@ -0,0 +1,83 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.EnumTest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('EnumTest', function() { + it('should create an instance of EnumTest', function() { + // uncomment below and update the code to test EnumTest + //var instane = new SwaggerPetstore.EnumTest(); + //expect(instance).to.be.a(SwaggerPetstore.EnumTest); + }); + + it('should have the property enumString (base name: "enum_string")', function() { + // uncomment below and update the code to test the property enumString + //var instane = new SwaggerPetstore.EnumTest(); + //expect(instance).to.be(); + }); + + it('should have the property enumInteger (base name: "enum_integer")', function() { + // uncomment below and update the code to test the property enumInteger + //var instane = new SwaggerPetstore.EnumTest(); + //expect(instance).to.be(); + }); + + it('should have the property enumNumber (base name: "enum_number")', function() { + // uncomment below and update the code to test the property enumNumber + //var instane = new SwaggerPetstore.EnumTest(); + //expect(instance).to.be(); + }); + + it('should have the property outerEnum (base name: "outerEnum")', function() { + // uncomment below and update the code to test the property outerEnum + //var instane = new SwaggerPetstore.EnumTest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/FormatTest.spec.js b/samples/client/petstore/javascript-es6/src/test/model/FormatTest.spec.js new file mode 100644 index 00000000000..74b0b80c74e --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/FormatTest.spec.js @@ -0,0 +1,137 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.FormatTest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('FormatTest', function() { + it('should create an instance of FormatTest', function() { + // uncomment below and update the code to test FormatTest + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be.a(SwaggerPetstore.FormatTest); + }); + + it('should have the property integer (base name: "integer")', function() { + // uncomment below and update the code to test the property integer + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property int32 (base name: "int32")', function() { + // uncomment below and update the code to test the property int32 + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property int64 (base name: "int64")', function() { + // uncomment below and update the code to test the property int64 + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property _number (base name: "number")', function() { + // uncomment below and update the code to test the property _number + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property _float (base name: "float")', function() { + // uncomment below and update the code to test the property _float + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property _double (base name: "double")', function() { + // uncomment below and update the code to test the property _double + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property _string (base name: "string")', function() { + // uncomment below and update the code to test the property _string + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property _byte (base name: "byte")', function() { + // uncomment below and update the code to test the property _byte + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property binary (base name: "binary")', function() { + // uncomment below and update the code to test the property binary + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property _date (base name: "date")', function() { + // uncomment below and update the code to test the property _date + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property dateTime (base name: "dateTime")', function() { + // uncomment below and update the code to test the property dateTime + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property uuid (base name: "uuid")', function() { + // uncomment below and update the code to test the property uuid + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + it('should have the property password (base name: "password")', function() { + // uncomment below and update the code to test the property password + //var instane = new SwaggerPetstore.FormatTest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/HasOnlyReadOnly.spec.js b/samples/client/petstore/javascript-es6/src/test/model/HasOnlyReadOnly.spec.js new file mode 100644 index 00000000000..ad4f4ba6d71 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/HasOnlyReadOnly.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.HasOnlyReadOnly(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('HasOnlyReadOnly', function() { + it('should create an instance of HasOnlyReadOnly', function() { + // uncomment below and update the code to test HasOnlyReadOnly + //var instane = new SwaggerPetstore.HasOnlyReadOnly(); + //expect(instance).to.be.a(SwaggerPetstore.HasOnlyReadOnly); + }); + + it('should have the property bar (base name: "bar")', function() { + // uncomment below and update the code to test the property bar + //var instane = new SwaggerPetstore.HasOnlyReadOnly(); + //expect(instance).to.be(); + }); + + it('should have the property foo (base name: "foo")', function() { + // uncomment below and update the code to test the property foo + //var instane = new SwaggerPetstore.HasOnlyReadOnly(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/List.spec.js b/samples/client/petstore/javascript-es6/src/test/model/List.spec.js new file mode 100644 index 00000000000..7ea30e82fc8 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/List.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.List(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('List', function() { + it('should create an instance of List', function() { + // uncomment below and update the code to test List + //var instane = new SwaggerPetstore.List(); + //expect(instance).to.be.a(SwaggerPetstore.List); + }); + + it('should have the property _123List (base name: "123-list")', function() { + // uncomment below and update the code to test the property _123List + //var instane = new SwaggerPetstore.List(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/MapTest.spec.js b/samples/client/petstore/javascript-es6/src/test/model/MapTest.spec.js new file mode 100644 index 00000000000..1a67fcf7ae6 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/MapTest.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.MapTest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('MapTest', function() { + it('should create an instance of MapTest', function() { + // uncomment below and update the code to test MapTest + //var instane = new SwaggerPetstore.MapTest(); + //expect(instance).to.be.a(SwaggerPetstore.MapTest); + }); + + it('should have the property mapMapOfString (base name: "map_map_of_string")', function() { + // uncomment below and update the code to test the property mapMapOfString + //var instane = new SwaggerPetstore.MapTest(); + //expect(instance).to.be(); + }); + + it('should have the property mapOfEnumString (base name: "map_of_enum_string")', function() { + // uncomment below and update the code to test the property mapOfEnumString + //var instane = new SwaggerPetstore.MapTest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/MixedPropertiesAndAdditionalPropertiesClass.spec.js b/samples/client/petstore/javascript-es6/src/test/model/MixedPropertiesAndAdditionalPropertiesClass.spec.js new file mode 100644 index 00000000000..be493898584 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/MixedPropertiesAndAdditionalPropertiesClass.spec.js @@ -0,0 +1,77 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('MixedPropertiesAndAdditionalPropertiesClass', function() { + it('should create an instance of MixedPropertiesAndAdditionalPropertiesClass', function() { + // uncomment below and update the code to test MixedPropertiesAndAdditionalPropertiesClass + //var instane = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + //expect(instance).to.be.a(SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass); + }); + + it('should have the property uuid (base name: "uuid")', function() { + // uncomment below and update the code to test the property uuid + //var instane = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + //expect(instance).to.be(); + }); + + it('should have the property dateTime (base name: "dateTime")', function() { + // uncomment below and update the code to test the property dateTime + //var instane = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + //expect(instance).to.be(); + }); + + it('should have the property map (base name: "map")', function() { + // uncomment below and update the code to test the property map + //var instane = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Model200Response.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Model200Response.spec.js new file mode 100644 index 00000000000..5c513a36e1a --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Model200Response.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Model200Response(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Model200Response', function() { + it('should create an instance of Model200Response', function() { + // uncomment below and update the code to test Model200Response + //var instane = new SwaggerPetstore.Model200Response(); + //expect(instance).to.be.a(SwaggerPetstore.Model200Response); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new SwaggerPetstore.Model200Response(); + //expect(instance).to.be(); + }); + + it('should have the property _class (base name: "class")', function() { + // uncomment below and update the code to test the property _class + //var instane = new SwaggerPetstore.Model200Response(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/ModelReturn.spec.js b/samples/client/petstore/javascript-es6/src/test/model/ModelReturn.spec.js new file mode 100644 index 00000000000..62b5f6ba57d --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/ModelReturn.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.ModelReturn(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ModelReturn', function() { + it('should create an instance of ModelReturn', function() { + // uncomment below and update the code to test ModelReturn + //var instane = new SwaggerPetstore.ModelReturn(); + //expect(instance).to.be.a(SwaggerPetstore.ModelReturn); + }); + + it('should have the property _return (base name: "return")', function() { + // uncomment below and update the code to test the property _return + //var instane = new SwaggerPetstore.ModelReturn(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Name.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Name.spec.js new file mode 100644 index 00000000000..c9caf576bd0 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Name.spec.js @@ -0,0 +1,83 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Name(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Name', function() { + it('should create an instance of Name', function() { + // uncomment below and update the code to test Name + //var instane = new SwaggerPetstore.Name(); + //expect(instance).to.be.a(SwaggerPetstore.Name); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new SwaggerPetstore.Name(); + //expect(instance).to.be(); + }); + + it('should have the property snakeCase (base name: "snake_case")', function() { + // uncomment below and update the code to test the property snakeCase + //var instane = new SwaggerPetstore.Name(); + //expect(instance).to.be(); + }); + + it('should have the property property (base name: "property")', function() { + // uncomment below and update the code to test the property property + //var instane = new SwaggerPetstore.Name(); + //expect(instance).to.be(); + }); + + it('should have the property _123Number (base name: "123Number")', function() { + // uncomment below and update the code to test the property _123Number + //var instane = new SwaggerPetstore.Name(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/NumberOnly.spec.js b/samples/client/petstore/javascript-es6/src/test/model/NumberOnly.spec.js new file mode 100644 index 00000000000..641c03b13a4 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/NumberOnly.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.NumberOnly(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('NumberOnly', function() { + it('should create an instance of NumberOnly', function() { + // uncomment below and update the code to test NumberOnly + //var instane = new SwaggerPetstore.NumberOnly(); + //expect(instance).to.be.a(SwaggerPetstore.NumberOnly); + }); + + it('should have the property justNumber (base name: "JustNumber")', function() { + // uncomment below and update the code to test the property justNumber + //var instane = new SwaggerPetstore.NumberOnly(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Order.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Order.spec.js new file mode 100644 index 00000000000..69527dc8fdb --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Order.spec.js @@ -0,0 +1,95 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Order(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Order', function() { + it('should create an instance of Order', function() { + // uncomment below and update the code to test Order + //var instane = new SwaggerPetstore.Order(); + //expect(instance).to.be.a(SwaggerPetstore.Order); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new SwaggerPetstore.Order(); + //expect(instance).to.be(); + }); + + it('should have the property petId (base name: "petId")', function() { + // uncomment below and update the code to test the property petId + //var instane = new SwaggerPetstore.Order(); + //expect(instance).to.be(); + }); + + it('should have the property quantity (base name: "quantity")', function() { + // uncomment below and update the code to test the property quantity + //var instane = new SwaggerPetstore.Order(); + //expect(instance).to.be(); + }); + + it('should have the property shipDate (base name: "shipDate")', function() { + // uncomment below and update the code to test the property shipDate + //var instane = new SwaggerPetstore.Order(); + //expect(instance).to.be(); + }); + + it('should have the property status (base name: "status")', function() { + // uncomment below and update the code to test the property status + //var instane = new SwaggerPetstore.Order(); + //expect(instance).to.be(); + }); + + it('should have the property complete (base name: "complete")', function() { + // uncomment below and update the code to test the property complete + //var instane = new SwaggerPetstore.Order(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/OuterBoolean.spec.js b/samples/client/petstore/javascript-es6/src/test/model/OuterBoolean.spec.js new file mode 100644 index 00000000000..765f758cd09 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/OuterBoolean.spec.js @@ -0,0 +1,60 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + // OuterBoolean is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterBoolean(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('OuterBoolean', function() { + it('should create an instance of OuterBoolean', function() { + // uncomment below and update the code to test OuterBoolean + //var instane = new SwaggerPetstore.OuterBoolean(); + //expect(instance).to.be.a(SwaggerPetstore.OuterBoolean); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/OuterComposite.spec.js b/samples/client/petstore/javascript-es6/src/test/model/OuterComposite.spec.js new file mode 100644 index 00000000000..6fd830b7c0e --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/OuterComposite.spec.js @@ -0,0 +1,77 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.OuterComposite(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('OuterComposite', function() { + it('should create an instance of OuterComposite', function() { + // uncomment below and update the code to test OuterComposite + //var instane = new SwaggerPetstore.OuterComposite(); + //expect(instance).to.be.a(SwaggerPetstore.OuterComposite); + }); + + it('should have the property myNumber (base name: "my_number")', function() { + // uncomment below and update the code to test the property myNumber + //var instane = new SwaggerPetstore.OuterComposite(); + //expect(instance).to.be(); + }); + + it('should have the property myString (base name: "my_string")', function() { + // uncomment below and update the code to test the property myString + //var instane = new SwaggerPetstore.OuterComposite(); + //expect(instance).to.be(); + }); + + it('should have the property myBoolean (base name: "my_boolean")', function() { + // uncomment below and update the code to test the property myBoolean + //var instane = new SwaggerPetstore.OuterComposite(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/OuterEnum.spec.js b/samples/client/petstore/javascript-es6/src/test/model/OuterEnum.spec.js new file mode 100644 index 00000000000..14c26a3aef5 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/OuterEnum.spec.js @@ -0,0 +1,58 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('OuterEnum', function() { + it('should create an instance of OuterEnum', function() { + // uncomment below and update the code to test OuterEnum + //var instane = new SwaggerPetstore.OuterEnum(); + //expect(instance).to.be.a(SwaggerPetstore.OuterEnum); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/OuterNumber.spec.js b/samples/client/petstore/javascript-es6/src/test/model/OuterNumber.spec.js new file mode 100644 index 00000000000..2466fbe6dc9 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/OuterNumber.spec.js @@ -0,0 +1,60 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + // OuterNumber is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterNumber(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('OuterNumber', function() { + it('should create an instance of OuterNumber', function() { + // uncomment below and update the code to test OuterNumber + //var instane = new SwaggerPetstore.OuterNumber(); + //expect(instance).to.be.a(SwaggerPetstore.OuterNumber); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/OuterString.spec.js b/samples/client/petstore/javascript-es6/src/test/model/OuterString.spec.js new file mode 100644 index 00000000000..46d6c579bc9 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/OuterString.spec.js @@ -0,0 +1,60 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + // OuterString is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterString(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('OuterString', function() { + it('should create an instance of OuterString', function() { + // uncomment below and update the code to test OuterString + //var instane = new SwaggerPetstore.OuterString(); + //expect(instance).to.be.a(SwaggerPetstore.OuterString); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Pet.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Pet.spec.js new file mode 100644 index 00000000000..0da95d08662 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Pet.spec.js @@ -0,0 +1,95 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Pet(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Pet', function() { + it('should create an instance of Pet', function() { + // uncomment below and update the code to test Pet + //var instane = new SwaggerPetstore.Pet(); + //expect(instance).to.be.a(SwaggerPetstore.Pet); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new SwaggerPetstore.Pet(); + //expect(instance).to.be(); + }); + + it('should have the property category (base name: "category")', function() { + // uncomment below and update the code to test the property category + //var instane = new SwaggerPetstore.Pet(); + //expect(instance).to.be(); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new SwaggerPetstore.Pet(); + //expect(instance).to.be(); + }); + + it('should have the property photoUrls (base name: "photoUrls")', function() { + // uncomment below and update the code to test the property photoUrls + //var instane = new SwaggerPetstore.Pet(); + //expect(instance).to.be(); + }); + + it('should have the property tags (base name: "tags")', function() { + // uncomment below and update the code to test the property tags + //var instane = new SwaggerPetstore.Pet(); + //expect(instance).to.be(); + }); + + it('should have the property status (base name: "status")', function() { + // uncomment below and update the code to test the property status + //var instane = new SwaggerPetstore.Pet(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/ReadOnlyFirst.spec.js b/samples/client/petstore/javascript-es6/src/test/model/ReadOnlyFirst.spec.js new file mode 100644 index 00000000000..375856a5abc --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/ReadOnlyFirst.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.ReadOnlyFirst(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ReadOnlyFirst', function() { + it('should create an instance of ReadOnlyFirst', function() { + // uncomment below and update the code to test ReadOnlyFirst + //var instane = new SwaggerPetstore.ReadOnlyFirst(); + //expect(instance).to.be.a(SwaggerPetstore.ReadOnlyFirst); + }); + + it('should have the property bar (base name: "bar")', function() { + // uncomment below and update the code to test the property bar + //var instane = new SwaggerPetstore.ReadOnlyFirst(); + //expect(instance).to.be(); + }); + + it('should have the property baz (base name: "baz")', function() { + // uncomment below and update the code to test the property baz + //var instane = new SwaggerPetstore.ReadOnlyFirst(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/SpecialModelName.spec.js b/samples/client/petstore/javascript-es6/src/test/model/SpecialModelName.spec.js new file mode 100644 index 00000000000..1d821d94f2a --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/SpecialModelName.spec.js @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.SpecialModelName(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('SpecialModelName', function() { + it('should create an instance of SpecialModelName', function() { + // uncomment below and update the code to test SpecialModelName + //var instane = new SwaggerPetstore.SpecialModelName(); + //expect(instance).to.be.a(SwaggerPetstore.SpecialModelName); + }); + + it('should have the property specialPropertyName (base name: "$special[property.name]")', function() { + // uncomment below and update the code to test the property specialPropertyName + //var instane = new SwaggerPetstore.SpecialModelName(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/Tag.spec.js b/samples/client/petstore/javascript-es6/src/test/model/Tag.spec.js new file mode 100644 index 00000000000..b4aaf43538e --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/Tag.spec.js @@ -0,0 +1,71 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.Tag(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Tag', function() { + it('should create an instance of Tag', function() { + // uncomment below and update the code to test Tag + //var instane = new SwaggerPetstore.Tag(); + //expect(instance).to.be.a(SwaggerPetstore.Tag); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new SwaggerPetstore.Tag(); + //expect(instance).to.be(); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new SwaggerPetstore.Tag(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/src/test/model/User.spec.js b/samples/client/petstore/javascript-es6/src/test/model/User.spec.js new file mode 100644 index 00000000000..19db8f90bfd --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/test/model/User.spec.js @@ -0,0 +1,107 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.User(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('User', function() { + it('should create an instance of User', function() { + // uncomment below and update the code to test User + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be.a(SwaggerPetstore.User); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be(); + }); + + it('should have the property username (base name: "username")', function() { + // uncomment below and update the code to test the property username + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be(); + }); + + it('should have the property firstName (base name: "firstName")', function() { + // uncomment below and update the code to test the property firstName + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be(); + }); + + it('should have the property lastName (base name: "lastName")', function() { + // uncomment below and update the code to test the property lastName + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be(); + }); + + it('should have the property email (base name: "email")', function() { + // uncomment below and update the code to test the property email + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be(); + }); + + it('should have the property password (base name: "password")', function() { + // uncomment below and update the code to test the property password + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be(); + }); + + it('should have the property phone (base name: "phone")', function() { + // uncomment below and update the code to test the property phone + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be(); + }); + + it('should have the property userStatus (base name: "userStatus")', function() { + // uncomment below and update the code to test the property userStatus + //var instane = new SwaggerPetstore.User(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/javascript-es6/test/ApiClientTest.js b/samples/client/petstore/javascript-es6/test/ApiClientTest.js new file mode 100644 index 00000000000..5e98b685a91 --- /dev/null +++ b/samples/client/petstore/javascript-es6/test/ApiClientTest.js @@ -0,0 +1,393 @@ +if (typeof module === 'object' && module.exports) { + var expect = require('expect.js'); + var SwaggerPetstore = require('../src/index'); + var sinon = require('sinon'); +} + +var apiClient = SwaggerPetstore.ApiClient.instance; + +describe('ApiClient', function() { + describe('defaults', function() { + it('should have correct default values with the default API client', function() { + expect(apiClient).to.be.ok(); + expect(apiClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(apiClient.authentications).to.eql({ + petstore_auth: {type: 'oauth2'}, + http_basic_test: {type: 'basic'}, + api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'}, + api_key_query: {type: 'apiKey', 'in': 'query', name: 'api_key_query'}, + /* comment out the following as these fake security def (testing purpose) + * are removed from the spec, we'll add these back after updating the + * petstore server + * + test_http_basic: {type: 'basic'}, + test_api_client_id: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_id' + }, + test_api_client_secret: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_secret' + }, + test_api_key_query: { + type: 'apiKey', + 'in': 'query', + name: 'test_api_key_query' + }, + test_api_key_header: { + type: 'apiKey', + 'in': 'header', + name: 'test_api_key_header' + }*/ + }); + }); + + it('should have correct default values with new API client and can customize it', function() { + var newClient = new SwaggerPetstore.ApiClient; + expect(newClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(newClient.buildUrl('/abc', {})).to.be('http://petstore.swagger.io:80/v2/abc'); + + newClient.basePath = 'http://example.com'; + expect(newClient.basePath).to.be('http://example.com'); + expect(newClient.buildUrl('/abc', {})).to.be('http://example.com/abc'); + }); + }); + + describe('#paramToString', function() { + it('should return empty string for null and undefined', function() { + expect(apiClient.paramToString(null)).to.be(''); + expect(apiClient.paramToString(undefined)).to.be(''); + }); + + it('should return string', function() { + expect(apiClient.paramToString('')).to.be(''); + expect(apiClient.paramToString('abc')).to.be('abc'); + expect(apiClient.paramToString(123)).to.be('123'); + }); + }); + + describe('#buildCollectionParam', function() { + var param; + + beforeEach(function() { + param = ['aa', 'bb', 123]; + }); + + it('works for csv', function() { + expect(apiClient.buildCollectionParam(param, 'csv')).to.be('aa,bb,123'); + }); + + it('works for ssv', function() { + expect(apiClient.buildCollectionParam(param, 'ssv')).to.be('aa bb 123'); + }); + + it('works for tsv', function() { + expect(apiClient.buildCollectionParam(param, 'tsv')).to.be('aa\tbb\t123'); + }); + + it('works for pipes', function() { + expect(apiClient.buildCollectionParam(param, 'pipes')).to.be('aa|bb|123'); + }); + + it('works for multi', function() { + expect(apiClient.buildCollectionParam(param, 'multi')).to.eql(['aa', 'bb', '123']); + }); + + it('fails for invalid collection format', function() { + expect(function() { apiClient.buildCollectionParam(param, 'INVALID'); }).to.throwError(); + }); + }); + + describe('#buildUrl', function() { + it('should work without path parameters in the path', function() { + expect(apiClient.buildUrl('/abc', {})).to + .be('http://petstore.swagger.io:80/v2/abc'); + expect(apiClient.buildUrl('/abc/def?ok', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/abc/def?ok'); + }); + + it('should work with path parameters in the path', function() { + expect(apiClient.buildUrl('/{id}', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/123'); + expect(apiClient.buildUrl('/abc/{id}/{name}?ok', {id: 456, name: 'a b'})).to. + be('http://petstore.swagger.io:80/v2/abc/456/a%20b?ok'); + }); + }); + + describe('#isJsonMime', function() { + it('should return true for JSON MIME', function() { + expect(apiClient.isJsonMime('application/json')).to.be(true); + expect(apiClient.isJsonMime('application/json; charset=UTF8')).to.be(true); + expect(apiClient.isJsonMime('APPLICATION/JSON')).to.be(true); + }); + + it('should return false for non-JSON MIME', function() { + expect(apiClient.isJsonMime('')).to.be(false); + expect(apiClient.isJsonMime('text/plain')).to.be(false); + expect(apiClient.isJsonMime('application/xml')).to.be(false); + expect(apiClient.isJsonMime('application/jsonp')).to.be(false); + }); + }); + + describe('#applyAuthToRequest', function() { + var req, newClient; + + beforeEach(function() { + req = { + auth: function() {}, + set: function() {}, + query: function() {} + }; + sinon.stub(req, 'auth'); + sinon.stub(req, 'set'); + sinon.stub(req, 'query'); + newClient = new SwaggerPetstore.ApiClient(); + }); + + describe('basic', function() { + var authName = 'testBasicAuth'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'basic'}; + auth = newClient.authentications[authName]; + }); + + it('sets auth header with username and password set', function() { + auth.username = 'user'; + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjpwYXNz' is base64-encoded string of 'user:pass' + sinon.assert.calledWithMatch(req.auth, 'user', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only username set', function() { + auth.username = 'user'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjo=' is base64-encoded string of 'user:' + sinon.assert.calledWithMatch(req.auth, 'user', ''); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only password set', function() { + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'OnBhc3M=' is base64-encoded string of ':pass' + sinon.assert.calledWithMatch(req.auth, '', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('does not set header when username and password are not set', function() { + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + }); + + describe('apiKey', function() { + var authName = 'testApiKey'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'apiKey', name: 'api_key'}; + auth = newClient.authentications[authName]; + }); + + it('sets api key in header', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('sets api key in query', function() { + auth.in = 'query'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + + it('sets api key in header with prefix', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + auth.apiKeyPrefix = 'Key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'Key my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when api key is not set', function() { + auth.in = 'query'; + auth.apiKey = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('oauth2', function() { + var authName = 'testOAuth2'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'oauth2'}; + auth = newClient.authentications[authName]; + }); + + it('sets access token in header', function() { + auth.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when access token is not set', function() { + auth.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('apiKey and oauth2', function() { + var apiKeyAuthName = 'testApiKey'; + var oauth2Name = 'testOAuth2'; + var authNames = [apiKeyAuthName, oauth2Name]; + var apiKeyAuth, oauth2; + + beforeEach(function() { + newClient.authentications[apiKeyAuthName] = {type: 'apiKey', name: 'api_key', 'in': 'query'}; + newClient.authentications[oauth2Name] = {type: 'oauth2'}; + apiKeyAuth = newClient.authentications[apiKeyAuthName]; + oauth2 = newClient.authentications[oauth2Name]; + }); + + it('works when setting both api key and access token', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + }); + + it('works when setting only api key', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + }); + + it('works when neither api key nor access token is set', function() { + apiKeyAuth.apiKey = null; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('unknown type', function() { + var authName = 'unknown'; + var authNames = [authName]; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'UNKNOWN'}; + }); + + it('throws error for unknown auth type', function() { + expect(function() { + newClient.applyAuthToRequest(req, authNames); + }).to.throwError(); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + }); + }); + + /* + describe('#defaultHeaders', function() { + it('should initialize default headers to be an empty object', function() { + expect(apiClient.defaultHeaders).to.eql({}); + }); + + it('should put default headers in request', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var expected = {'Content-Type': 'text/plain', 'api_key': 'special-key'}; + expect(newClient.defaultHeaders).to.eql(expected); + var req = makeDumbRequest(newClient); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + + it('should override default headers with provided header params', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var headerParams = {'Content-Type': 'application/json', 'Authorization': 'Bearer test-token'} + var expected = { + 'Content-Type': 'application/json', + 'api_key': 'special-key', + 'Authorization': 'Bearer test-token' + }; + var req = makeDumbRequest(newClient, {headerParams: headerParams}); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + }); +*/ + +}); + +function makeDumbRequest(apiClient, opts) { + opts = opts || {}; + var path = opts.path || '/store/inventory'; + var httpMethod = opts.httpMethod || 'GET'; + var pathParams = opts.pathParams || {}; + var queryParams = opts.queryParams || {}; + var headerParams = opts.headerParams || {}; + var formParams = opts.formParams || {}; + var bodyParam = opts.bodyParam; + var authNames = []; + var contentTypes = opts.contentTypes || []; + var accepts = opts.accepts || []; + var callback = opts.callback; + return apiClient.callApi(path, httpMethod, pathParams, queryParams, + headerParams, formParams, bodyParam, authNames, contentTypes, accepts); +} diff --git a/samples/client/petstore/javascript-es6/test/api/AnotherFakeApi.spec.js b/samples/client/petstore/javascript-es6/test/api/AnotherFakeApi.spec.js index f55538a53e7..75084078423 100644 --- a/samples/client/petstore/javascript-es6/test/api/AnotherFakeApi.spec.js +++ b/samples/client/petstore/javascript-es6/test/api/AnotherFakeApi.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.AnotherFakeApi(); + instance = new OpenApiPetstore.AnotherFakeApi(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-es6/test/api/FakeApi.spec.js b/samples/client/petstore/javascript-es6/test/api/FakeApi.spec.js index f2903d6612c..7931dbdd6c8 100644 --- a/samples/client/petstore/javascript-es6/test/api/FakeApi.spec.js +++ b/samples/client/petstore/javascript-es6/test/api/FakeApi.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.FakeApi(); + instance = new OpenApiPetstore.FakeApi(); }); var getProperty = function(object, getter, property) { @@ -88,6 +88,16 @@ done(); }); }); + describe('testBodyWithQueryParams', function() { + it('should call testBodyWithQueryParams successfully', function(done) { + //uncomment below and update the code to test testBodyWithQueryParams + //instance.testBodyWithQueryParams(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); describe('testClientModel', function() { it('should call testClientModel successfully', function(done) { //uncomment below and update the code to test testClientModel @@ -118,6 +128,26 @@ done(); }); }); + describe('testInlineAdditionalProperties', function() { + it('should call testInlineAdditionalProperties successfully', function(done) { + //uncomment below and update the code to test testInlineAdditionalProperties + //instance.testInlineAdditionalProperties(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('testJsonFormData', function() { + it('should call testJsonFormData successfully', function(done) { + //uncomment below and update the code to test testJsonFormData + //instance.testJsonFormData(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); }); })); diff --git a/samples/client/petstore/javascript-es6/test/api/FakeClassnameTags123Api.spec.js b/samples/client/petstore/javascript-es6/test/api/FakeClassnameTags123Api.spec.js index 10e20e7778a..a9f0780a18f 100644 --- a/samples/client/petstore/javascript-es6/test/api/FakeClassnameTags123Api.spec.js +++ b/samples/client/petstore/javascript-es6/test/api/FakeClassnameTags123Api.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.FakeClassnameTags123Api(); + instance = new OpenApiPetstore.FakeClassnameTags123Api(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-es6/test/api/PetApi.spec.js b/samples/client/petstore/javascript-es6/test/api/PetApi.spec.js index 5259a2c6665..259dfabb3f0 100644 --- a/samples/client/petstore/javascript-es6/test/api/PetApi.spec.js +++ b/samples/client/petstore/javascript-es6/test/api/PetApi.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.PetApi(); + instance = new OpenApiPetstore.PetApi(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-es6/test/api/StoreApi.spec.js b/samples/client/petstore/javascript-es6/test/api/StoreApi.spec.js index d19da2f28d8..cd542e15f5d 100644 --- a/samples/client/petstore/javascript-es6/test/api/StoreApi.spec.js +++ b/samples/client/petstore/javascript-es6/test/api/StoreApi.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.StoreApi(); + instance = new OpenApiPetstore.StoreApi(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-es6/test/api/UserApi.spec.js b/samples/client/petstore/javascript-es6/test/api/UserApi.spec.js index 55c8967f13b..c5ba7e4e4bc 100644 --- a/samples/client/petstore/javascript-es6/test/api/UserApi.spec.js +++ b/samples/client/petstore/javascript-es6/test/api/UserApi.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.UserApi(); + instance = new OpenApiPetstore.UserApi(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-es6/test/model/AdditionalPropertiesClass.spec.js b/samples/client/petstore/javascript-es6/test/model/AdditionalPropertiesClass.spec.js index 887052c0109..4c472d5ac5f 100644 --- a/samples/client/petstore/javascript-es6/test/model/AdditionalPropertiesClass.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/AdditionalPropertiesClass.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.AdditionalPropertiesClass(); + instance = new OpenApiPetstore.AdditionalPropertiesClass(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('AdditionalPropertiesClass', function() { it('should create an instance of AdditionalPropertiesClass', function() { // uncomment below and update the code to test AdditionalPropertiesClass - //var instane = new SwaggerPetstore.AdditionalPropertiesClass(); - //expect(instance).to.be.a(SwaggerPetstore.AdditionalPropertiesClass); + //var instane = new OpenApiPetstore.AdditionalPropertiesClass(); + //expect(instance).to.be.a(OpenApiPetstore.AdditionalPropertiesClass); }); it('should have the property mapProperty (base name: "map_property")', function() { // uncomment below and update the code to test the property mapProperty - //var instane = new SwaggerPetstore.AdditionalPropertiesClass(); + //var instane = new OpenApiPetstore.AdditionalPropertiesClass(); //expect(instance).to.be(); }); it('should have the property mapOfMapProperty (base name: "map_of_map_property")', function() { // uncomment below and update the code to test the property mapOfMapProperty - //var instane = new SwaggerPetstore.AdditionalPropertiesClass(); + //var instane = new OpenApiPetstore.AdditionalPropertiesClass(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Animal.spec.js b/samples/client/petstore/javascript-es6/test/model/Animal.spec.js index 4270461cc5e..dbe9ef41d14 100644 --- a/samples/client/petstore/javascript-es6/test/model/Animal.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Animal.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Animal(); + instance = new OpenApiPetstore.Animal(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('Animal', function() { it('should create an instance of Animal', function() { // uncomment below and update the code to test Animal - //var instane = new SwaggerPetstore.Animal(); - //expect(instance).to.be.a(SwaggerPetstore.Animal); + //var instane = new OpenApiPetstore.Animal(); + //expect(instance).to.be.a(OpenApiPetstore.Animal); }); it('should have the property className (base name: "className")', function() { // uncomment below and update the code to test the property className - //var instane = new SwaggerPetstore.Animal(); + //var instane = new OpenApiPetstore.Animal(); //expect(instance).to.be(); }); it('should have the property color (base name: "color")', function() { // uncomment below and update the code to test the property color - //var instane = new SwaggerPetstore.Animal(); + //var instane = new OpenApiPetstore.Animal(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/AnimalFarm.spec.js b/samples/client/petstore/javascript-es6/test/model/AnimalFarm.spec.js index ffc54a3c381..4c616e5e308 100644 --- a/samples/client/petstore/javascript-es6/test/model/AnimalFarm.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/AnimalFarm.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.AnimalFarm(); + instance = new OpenApiPetstore.AnimalFarm(); }); var getProperty = function(object, getter, property) { @@ -50,8 +50,8 @@ describe('AnimalFarm', function() { it('should create an instance of AnimalFarm', function() { // uncomment below and update the code to test AnimalFarm - //var instane = new SwaggerPetstore.AnimalFarm(); - //expect(instance).to.be.a(SwaggerPetstore.AnimalFarm); + //var instane = new OpenApiPetstore.AnimalFarm(); + //expect(instance).to.be.a(OpenApiPetstore.AnimalFarm); }); }); diff --git a/samples/client/petstore/javascript-es6/test/model/ApiResponse.spec.js b/samples/client/petstore/javascript-es6/test/model/ApiResponse.spec.js index 1070013e367..1165094a73c 100644 --- a/samples/client/petstore/javascript-es6/test/model/ApiResponse.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/ApiResponse.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.ApiResponse(); + instance = new OpenApiPetstore.ApiResponse(); }); var getProperty = function(object, getter, property) { @@ -50,25 +50,25 @@ describe('ApiResponse', function() { it('should create an instance of ApiResponse', function() { // uncomment below and update the code to test ApiResponse - //var instane = new SwaggerPetstore.ApiResponse(); - //expect(instance).to.be.a(SwaggerPetstore.ApiResponse); + //var instane = new OpenApiPetstore.ApiResponse(); + //expect(instance).to.be.a(OpenApiPetstore.ApiResponse); }); it('should have the property code (base name: "code")', function() { // uncomment below and update the code to test the property code - //var instane = new SwaggerPetstore.ApiResponse(); + //var instane = new OpenApiPetstore.ApiResponse(); //expect(instance).to.be(); }); it('should have the property type (base name: "type")', function() { // uncomment below and update the code to test the property type - //var instane = new SwaggerPetstore.ApiResponse(); + //var instane = new OpenApiPetstore.ApiResponse(); //expect(instance).to.be(); }); it('should have the property message (base name: "message")', function() { // uncomment below and update the code to test the property message - //var instane = new SwaggerPetstore.ApiResponse(); + //var instane = new OpenApiPetstore.ApiResponse(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/ArrayOfArrayOfNumberOnly.spec.js b/samples/client/petstore/javascript-es6/test/model/ArrayOfArrayOfNumberOnly.spec.js index 9fcd218fbb3..f30c53f5ed6 100644 --- a/samples/client/petstore/javascript-es6/test/model/ArrayOfArrayOfNumberOnly.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/ArrayOfArrayOfNumberOnly.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.ArrayOfArrayOfNumberOnly(); + instance = new OpenApiPetstore.ArrayOfArrayOfNumberOnly(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('ArrayOfArrayOfNumberOnly', function() { it('should create an instance of ArrayOfArrayOfNumberOnly', function() { // uncomment below and update the code to test ArrayOfArrayOfNumberOnly - //var instane = new SwaggerPetstore.ArrayOfArrayOfNumberOnly(); - //expect(instance).to.be.a(SwaggerPetstore.ArrayOfArrayOfNumberOnly); + //var instane = new OpenApiPetstore.ArrayOfArrayOfNumberOnly(); + //expect(instance).to.be.a(OpenApiPetstore.ArrayOfArrayOfNumberOnly); }); it('should have the property arrayArrayNumber (base name: "ArrayArrayNumber")', function() { // uncomment below and update the code to test the property arrayArrayNumber - //var instane = new SwaggerPetstore.ArrayOfArrayOfNumberOnly(); + //var instane = new OpenApiPetstore.ArrayOfArrayOfNumberOnly(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/ArrayOfNumberOnly.spec.js b/samples/client/petstore/javascript-es6/test/model/ArrayOfNumberOnly.spec.js index 32d5f98586a..6c2bc8807d9 100644 --- a/samples/client/petstore/javascript-es6/test/model/ArrayOfNumberOnly.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/ArrayOfNumberOnly.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.ArrayOfNumberOnly(); + instance = new OpenApiPetstore.ArrayOfNumberOnly(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('ArrayOfNumberOnly', function() { it('should create an instance of ArrayOfNumberOnly', function() { // uncomment below and update the code to test ArrayOfNumberOnly - //var instane = new SwaggerPetstore.ArrayOfNumberOnly(); - //expect(instance).to.be.a(SwaggerPetstore.ArrayOfNumberOnly); + //var instane = new OpenApiPetstore.ArrayOfNumberOnly(); + //expect(instance).to.be.a(OpenApiPetstore.ArrayOfNumberOnly); }); it('should have the property arrayNumber (base name: "ArrayNumber")', function() { // uncomment below and update the code to test the property arrayNumber - //var instane = new SwaggerPetstore.ArrayOfNumberOnly(); + //var instane = new OpenApiPetstore.ArrayOfNumberOnly(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/ArrayTest.spec.js b/samples/client/petstore/javascript-es6/test/model/ArrayTest.spec.js index 1d93d897a9d..ab9294b159c 100644 --- a/samples/client/petstore/javascript-es6/test/model/ArrayTest.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/ArrayTest.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.ArrayTest(); + instance = new OpenApiPetstore.ArrayTest(); }); var getProperty = function(object, getter, property) { @@ -50,25 +50,25 @@ describe('ArrayTest', function() { it('should create an instance of ArrayTest', function() { // uncomment below and update the code to test ArrayTest - //var instane = new SwaggerPetstore.ArrayTest(); - //expect(instance).to.be.a(SwaggerPetstore.ArrayTest); + //var instane = new OpenApiPetstore.ArrayTest(); + //expect(instance).to.be.a(OpenApiPetstore.ArrayTest); }); it('should have the property arrayOfString (base name: "array_of_string")', function() { // uncomment below and update the code to test the property arrayOfString - //var instane = new SwaggerPetstore.ArrayTest(); + //var instane = new OpenApiPetstore.ArrayTest(); //expect(instance).to.be(); }); it('should have the property arrayArrayOfInteger (base name: "array_array_of_integer")', function() { // uncomment below and update the code to test the property arrayArrayOfInteger - //var instane = new SwaggerPetstore.ArrayTest(); + //var instane = new OpenApiPetstore.ArrayTest(); //expect(instance).to.be(); }); it('should have the property arrayArrayOfModel (base name: "array_array_of_model")', function() { // uncomment below and update the code to test the property arrayArrayOfModel - //var instane = new SwaggerPetstore.ArrayTest(); + //var instane = new OpenApiPetstore.ArrayTest(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Capitalization.spec.js b/samples/client/petstore/javascript-es6/test/model/Capitalization.spec.js index f1aa695c3fd..8be47e3e132 100644 --- a/samples/client/petstore/javascript-es6/test/model/Capitalization.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Capitalization.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Capitalization(); + instance = new OpenApiPetstore.Capitalization(); }); var getProperty = function(object, getter, property) { @@ -50,43 +50,43 @@ describe('Capitalization', function() { it('should create an instance of Capitalization', function() { // uncomment below and update the code to test Capitalization - //var instane = new SwaggerPetstore.Capitalization(); - //expect(instance).to.be.a(SwaggerPetstore.Capitalization); + //var instane = new OpenApiPetstore.Capitalization(); + //expect(instance).to.be.a(OpenApiPetstore.Capitalization); }); it('should have the property smallCamel (base name: "smallCamel")', function() { // uncomment below and update the code to test the property smallCamel - //var instane = new SwaggerPetstore.Capitalization(); + //var instane = new OpenApiPetstore.Capitalization(); //expect(instance).to.be(); }); it('should have the property capitalCamel (base name: "CapitalCamel")', function() { // uncomment below and update the code to test the property capitalCamel - //var instane = new SwaggerPetstore.Capitalization(); + //var instane = new OpenApiPetstore.Capitalization(); //expect(instance).to.be(); }); it('should have the property smallSnake (base name: "small_Snake")', function() { // uncomment below and update the code to test the property smallSnake - //var instane = new SwaggerPetstore.Capitalization(); + //var instane = new OpenApiPetstore.Capitalization(); //expect(instance).to.be(); }); it('should have the property capitalSnake (base name: "Capital_Snake")', function() { // uncomment below and update the code to test the property capitalSnake - //var instane = new SwaggerPetstore.Capitalization(); + //var instane = new OpenApiPetstore.Capitalization(); //expect(instance).to.be(); }); it('should have the property sCAETHFlowPoints (base name: "SCA_ETH_Flow_Points")', function() { // uncomment below and update the code to test the property sCAETHFlowPoints - //var instane = new SwaggerPetstore.Capitalization(); + //var instane = new OpenApiPetstore.Capitalization(); //expect(instance).to.be(); }); it('should have the property ATT_NAME (base name: "ATT_NAME")', function() { // uncomment below and update the code to test the property ATT_NAME - //var instane = new SwaggerPetstore.Capitalization(); + //var instane = new OpenApiPetstore.Capitalization(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Cat.spec.js b/samples/client/petstore/javascript-es6/test/model/Cat.spec.js index f0d5476b268..99b7496450d 100644 --- a/samples/client/petstore/javascript-es6/test/model/Cat.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Cat.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Cat(); + instance = new OpenApiPetstore.Cat(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('Cat', function() { it('should create an instance of Cat', function() { // uncomment below and update the code to test Cat - //var instane = new SwaggerPetstore.Cat(); - //expect(instance).to.be.a(SwaggerPetstore.Cat); + //var instane = new OpenApiPetstore.Cat(); + //expect(instance).to.be.a(OpenApiPetstore.Cat); }); it('should have the property declawed (base name: "declawed")', function() { // uncomment below and update the code to test the property declawed - //var instane = new SwaggerPetstore.Cat(); + //var instane = new OpenApiPetstore.Cat(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Category.spec.js b/samples/client/petstore/javascript-es6/test/model/Category.spec.js index 561eaf8373e..2a02a9e4708 100644 --- a/samples/client/petstore/javascript-es6/test/model/Category.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Category.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Category(); + instance = new OpenApiPetstore.Category(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('Category', function() { it('should create an instance of Category', function() { // uncomment below and update the code to test Category - //var instane = new SwaggerPetstore.Category(); - //expect(instance).to.be.a(SwaggerPetstore.Category); + //var instane = new OpenApiPetstore.Category(); + //expect(instance).to.be.a(OpenApiPetstore.Category); }); it('should have the property id (base name: "id")', function() { // uncomment below and update the code to test the property id - //var instane = new SwaggerPetstore.Category(); + //var instane = new OpenApiPetstore.Category(); //expect(instance).to.be(); }); it('should have the property name (base name: "name")', function() { // uncomment below and update the code to test the property name - //var instane = new SwaggerPetstore.Category(); + //var instane = new OpenApiPetstore.Category(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/ClassModel.spec.js b/samples/client/petstore/javascript-es6/test/model/ClassModel.spec.js index 5ee2e49a0de..d87a995d19b 100644 --- a/samples/client/petstore/javascript-es6/test/model/ClassModel.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/ClassModel.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.ClassModel(); + instance = new OpenApiPetstore.ClassModel(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('ClassModel', function() { it('should create an instance of ClassModel', function() { // uncomment below and update the code to test ClassModel - //var instane = new SwaggerPetstore.ClassModel(); - //expect(instance).to.be.a(SwaggerPetstore.ClassModel); + //var instane = new OpenApiPetstore.ClassModel(); + //expect(instance).to.be.a(OpenApiPetstore.ClassModel); }); it('should have the property _class (base name: "_class")', function() { // uncomment below and update the code to test the property _class - //var instane = new SwaggerPetstore.ClassModel(); + //var instane = new OpenApiPetstore.ClassModel(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Client.spec.js b/samples/client/petstore/javascript-es6/test/model/Client.spec.js index 03af5ef730e..182ad624434 100644 --- a/samples/client/petstore/javascript-es6/test/model/Client.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Client.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Client(); + instance = new OpenApiPetstore.Client(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('Client', function() { it('should create an instance of Client', function() { // uncomment below and update the code to test Client - //var instane = new SwaggerPetstore.Client(); - //expect(instance).to.be.a(SwaggerPetstore.Client); + //var instane = new OpenApiPetstore.Client(); + //expect(instance).to.be.a(OpenApiPetstore.Client); }); it('should have the property client (base name: "client")', function() { // uncomment below and update the code to test the property client - //var instane = new SwaggerPetstore.Client(); + //var instane = new OpenApiPetstore.Client(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Dog.spec.js b/samples/client/petstore/javascript-es6/test/model/Dog.spec.js index 6421a501134..13d1584d01a 100644 --- a/samples/client/petstore/javascript-es6/test/model/Dog.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Dog.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Dog(); + instance = new OpenApiPetstore.Dog(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('Dog', function() { it('should create an instance of Dog', function() { // uncomment below and update the code to test Dog - //var instane = new SwaggerPetstore.Dog(); - //expect(instance).to.be.a(SwaggerPetstore.Dog); + //var instane = new OpenApiPetstore.Dog(); + //expect(instance).to.be.a(OpenApiPetstore.Dog); }); it('should have the property breed (base name: "breed")', function() { // uncomment below and update the code to test the property breed - //var instane = new SwaggerPetstore.Dog(); + //var instane = new OpenApiPetstore.Dog(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/EnumArrays.spec.js b/samples/client/petstore/javascript-es6/test/model/EnumArrays.spec.js index 45c8d595bb6..dae8d83d7f2 100644 --- a/samples/client/petstore/javascript-es6/test/model/EnumArrays.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/EnumArrays.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.EnumArrays(); + instance = new OpenApiPetstore.EnumArrays(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('EnumArrays', function() { it('should create an instance of EnumArrays', function() { // uncomment below and update the code to test EnumArrays - //var instane = new SwaggerPetstore.EnumArrays(); - //expect(instance).to.be.a(SwaggerPetstore.EnumArrays); + //var instane = new OpenApiPetstore.EnumArrays(); + //expect(instance).to.be.a(OpenApiPetstore.EnumArrays); }); it('should have the property justSymbol (base name: "just_symbol")', function() { // uncomment below and update the code to test the property justSymbol - //var instane = new SwaggerPetstore.EnumArrays(); + //var instane = new OpenApiPetstore.EnumArrays(); //expect(instance).to.be(); }); it('should have the property arrayEnum (base name: "array_enum")', function() { // uncomment below and update the code to test the property arrayEnum - //var instane = new SwaggerPetstore.EnumArrays(); + //var instane = new OpenApiPetstore.EnumArrays(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/EnumClass.spec.js b/samples/client/petstore/javascript-es6/test/model/EnumClass.spec.js index 2f60b4fc4a4..eb5a1117918 100644 --- a/samples/client/petstore/javascript-es6/test/model/EnumClass.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/EnumClass.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,9 +20,9 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; @@ -49,8 +49,8 @@ describe('EnumClass', function() { it('should create an instance of EnumClass', function() { // uncomment below and update the code to test EnumClass - //var instane = new SwaggerPetstore.EnumClass(); - //expect(instance).to.be.a(SwaggerPetstore.EnumClass); + //var instane = new OpenApiPetstore.EnumClass(); + //expect(instance).to.be.a(OpenApiPetstore.EnumClass); }); }); diff --git a/samples/client/petstore/javascript-es6/test/model/EnumTest.spec.js b/samples/client/petstore/javascript-es6/test/model/EnumTest.spec.js index 1a08cba3d72..6d7c2519e68 100644 --- a/samples/client/petstore/javascript-es6/test/model/EnumTest.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/EnumTest.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.EnumTest(); + instance = new OpenApiPetstore.EnumTest(); }); var getProperty = function(object, getter, property) { @@ -50,31 +50,37 @@ describe('EnumTest', function() { it('should create an instance of EnumTest', function() { // uncomment below and update the code to test EnumTest - //var instane = new SwaggerPetstore.EnumTest(); - //expect(instance).to.be.a(SwaggerPetstore.EnumTest); + //var instane = new OpenApiPetstore.EnumTest(); + //expect(instance).to.be.a(OpenApiPetstore.EnumTest); }); it('should have the property enumString (base name: "enum_string")', function() { // uncomment below and update the code to test the property enumString - //var instane = new SwaggerPetstore.EnumTest(); + //var instane = new OpenApiPetstore.EnumTest(); + //expect(instance).to.be(); + }); + + it('should have the property enumStringRequired (base name: "enum_string_required")', function() { + // uncomment below and update the code to test the property enumStringRequired + //var instane = new OpenApiPetstore.EnumTest(); //expect(instance).to.be(); }); it('should have the property enumInteger (base name: "enum_integer")', function() { // uncomment below and update the code to test the property enumInteger - //var instane = new SwaggerPetstore.EnumTest(); + //var instane = new OpenApiPetstore.EnumTest(); //expect(instance).to.be(); }); it('should have the property enumNumber (base name: "enum_number")', function() { // uncomment below and update the code to test the property enumNumber - //var instane = new SwaggerPetstore.EnumTest(); + //var instane = new OpenApiPetstore.EnumTest(); //expect(instance).to.be(); }); it('should have the property outerEnum (base name: "outerEnum")', function() { // uncomment below and update the code to test the property outerEnum - //var instane = new SwaggerPetstore.EnumTest(); + //var instane = new OpenApiPetstore.EnumTest(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/FormatTest.spec.js b/samples/client/petstore/javascript-es6/test/model/FormatTest.spec.js index 74b0b80c74e..2e61e4f8ed9 100644 --- a/samples/client/petstore/javascript-es6/test/model/FormatTest.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/FormatTest.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.FormatTest(); + instance = new OpenApiPetstore.FormatTest(); }); var getProperty = function(object, getter, property) { @@ -50,85 +50,85 @@ describe('FormatTest', function() { it('should create an instance of FormatTest', function() { // uncomment below and update the code to test FormatTest - //var instane = new SwaggerPetstore.FormatTest(); - //expect(instance).to.be.a(SwaggerPetstore.FormatTest); + //var instane = new OpenApiPetstore.FormatTest(); + //expect(instance).to.be.a(OpenApiPetstore.FormatTest); }); it('should have the property integer (base name: "integer")', function() { // uncomment below and update the code to test the property integer - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property int32 (base name: "int32")', function() { // uncomment below and update the code to test the property int32 - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property int64 (base name: "int64")', function() { // uncomment below and update the code to test the property int64 - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property _number (base name: "number")', function() { // uncomment below and update the code to test the property _number - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property _float (base name: "float")', function() { // uncomment below and update the code to test the property _float - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property _double (base name: "double")', function() { // uncomment below and update the code to test the property _double - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property _string (base name: "string")', function() { // uncomment below and update the code to test the property _string - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property _byte (base name: "byte")', function() { // uncomment below and update the code to test the property _byte - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property binary (base name: "binary")', function() { // uncomment below and update the code to test the property binary - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property _date (base name: "date")', function() { // uncomment below and update the code to test the property _date - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property dateTime (base name: "dateTime")', function() { // uncomment below and update the code to test the property dateTime - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property uuid (base name: "uuid")', function() { // uncomment below and update the code to test the property uuid - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); it('should have the property password (base name: "password")', function() { // uncomment below and update the code to test the property password - //var instane = new SwaggerPetstore.FormatTest(); + //var instane = new OpenApiPetstore.FormatTest(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/HasOnlyReadOnly.spec.js b/samples/client/petstore/javascript-es6/test/model/HasOnlyReadOnly.spec.js index ad4f4ba6d71..409e06ad823 100644 --- a/samples/client/petstore/javascript-es6/test/model/HasOnlyReadOnly.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/HasOnlyReadOnly.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.HasOnlyReadOnly(); + instance = new OpenApiPetstore.HasOnlyReadOnly(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('HasOnlyReadOnly', function() { it('should create an instance of HasOnlyReadOnly', function() { // uncomment below and update the code to test HasOnlyReadOnly - //var instane = new SwaggerPetstore.HasOnlyReadOnly(); - //expect(instance).to.be.a(SwaggerPetstore.HasOnlyReadOnly); + //var instane = new OpenApiPetstore.HasOnlyReadOnly(); + //expect(instance).to.be.a(OpenApiPetstore.HasOnlyReadOnly); }); it('should have the property bar (base name: "bar")', function() { // uncomment below and update the code to test the property bar - //var instane = new SwaggerPetstore.HasOnlyReadOnly(); + //var instane = new OpenApiPetstore.HasOnlyReadOnly(); //expect(instance).to.be(); }); it('should have the property foo (base name: "foo")', function() { // uncomment below and update the code to test the property foo - //var instane = new SwaggerPetstore.HasOnlyReadOnly(); + //var instane = new OpenApiPetstore.HasOnlyReadOnly(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/List.spec.js b/samples/client/petstore/javascript-es6/test/model/List.spec.js index 7ea30e82fc8..e3a8574d9ae 100644 --- a/samples/client/petstore/javascript-es6/test/model/List.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/List.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.List(); + instance = new OpenApiPetstore.List(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('List', function() { it('should create an instance of List', function() { // uncomment below and update the code to test List - //var instane = new SwaggerPetstore.List(); - //expect(instance).to.be.a(SwaggerPetstore.List); + //var instane = new OpenApiPetstore.List(); + //expect(instance).to.be.a(OpenApiPetstore.List); }); - it('should have the property _123List (base name: "123-list")', function() { - // uncomment below and update the code to test the property _123List - //var instane = new SwaggerPetstore.List(); + it('should have the property _123list (base name: "123-list")', function() { + // uncomment below and update the code to test the property _123list + //var instane = new OpenApiPetstore.List(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/MapTest.spec.js b/samples/client/petstore/javascript-es6/test/model/MapTest.spec.js index 1a67fcf7ae6..da009beec4e 100644 --- a/samples/client/petstore/javascript-es6/test/model/MapTest.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/MapTest.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.MapTest(); + instance = new OpenApiPetstore.MapTest(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('MapTest', function() { it('should create an instance of MapTest', function() { // uncomment below and update the code to test MapTest - //var instane = new SwaggerPetstore.MapTest(); - //expect(instance).to.be.a(SwaggerPetstore.MapTest); + //var instane = new OpenApiPetstore.MapTest(); + //expect(instance).to.be.a(OpenApiPetstore.MapTest); }); it('should have the property mapMapOfString (base name: "map_map_of_string")', function() { // uncomment below and update the code to test the property mapMapOfString - //var instane = new SwaggerPetstore.MapTest(); + //var instane = new OpenApiPetstore.MapTest(); //expect(instance).to.be(); }); it('should have the property mapOfEnumString (base name: "map_of_enum_string")', function() { // uncomment below and update the code to test the property mapOfEnumString - //var instane = new SwaggerPetstore.MapTest(); + //var instane = new OpenApiPetstore.MapTest(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/MixedPropertiesAndAdditionalPropertiesClass.spec.js b/samples/client/petstore/javascript-es6/test/model/MixedPropertiesAndAdditionalPropertiesClass.spec.js index be493898584..c9174f56154 100644 --- a/samples/client/petstore/javascript-es6/test/model/MixedPropertiesAndAdditionalPropertiesClass.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/MixedPropertiesAndAdditionalPropertiesClass.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + instance = new OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass(); }); var getProperty = function(object, getter, property) { @@ -50,25 +50,25 @@ describe('MixedPropertiesAndAdditionalPropertiesClass', function() { it('should create an instance of MixedPropertiesAndAdditionalPropertiesClass', function() { // uncomment below and update the code to test MixedPropertiesAndAdditionalPropertiesClass - //var instane = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); - //expect(instance).to.be.a(SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass); + //var instane = new OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + //expect(instance).to.be.a(OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass); }); it('should have the property uuid (base name: "uuid")', function() { // uncomment below and update the code to test the property uuid - //var instane = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + //var instane = new OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass(); //expect(instance).to.be(); }); it('should have the property dateTime (base name: "dateTime")', function() { // uncomment below and update the code to test the property dateTime - //var instane = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + //var instane = new OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass(); //expect(instance).to.be(); }); it('should have the property map (base name: "map")', function() { // uncomment below and update the code to test the property map - //var instane = new SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass(); + //var instane = new OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Model200Response.spec.js b/samples/client/petstore/javascript-es6/test/model/Model200Response.spec.js index 5c513a36e1a..13f768e9730 100644 --- a/samples/client/petstore/javascript-es6/test/model/Model200Response.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Model200Response.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Model200Response(); + instance = new OpenApiPetstore.Model200Response(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('Model200Response', function() { it('should create an instance of Model200Response', function() { // uncomment below and update the code to test Model200Response - //var instane = new SwaggerPetstore.Model200Response(); - //expect(instance).to.be.a(SwaggerPetstore.Model200Response); + //var instane = new OpenApiPetstore.Model200Response(); + //expect(instance).to.be.a(OpenApiPetstore.Model200Response); }); it('should have the property name (base name: "name")', function() { // uncomment below and update the code to test the property name - //var instane = new SwaggerPetstore.Model200Response(); + //var instane = new OpenApiPetstore.Model200Response(); //expect(instance).to.be(); }); it('should have the property _class (base name: "class")', function() { // uncomment below and update the code to test the property _class - //var instane = new SwaggerPetstore.Model200Response(); + //var instane = new OpenApiPetstore.Model200Response(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/ModelReturn.spec.js b/samples/client/petstore/javascript-es6/test/model/ModelReturn.spec.js index 62b5f6ba57d..bda09c52366 100644 --- a/samples/client/petstore/javascript-es6/test/model/ModelReturn.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/ModelReturn.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.ModelReturn(); + instance = new OpenApiPetstore.ModelReturn(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('ModelReturn', function() { it('should create an instance of ModelReturn', function() { // uncomment below and update the code to test ModelReturn - //var instane = new SwaggerPetstore.ModelReturn(); - //expect(instance).to.be.a(SwaggerPetstore.ModelReturn); + //var instane = new OpenApiPetstore.ModelReturn(); + //expect(instance).to.be.a(OpenApiPetstore.ModelReturn); }); it('should have the property _return (base name: "return")', function() { // uncomment below and update the code to test the property _return - //var instane = new SwaggerPetstore.ModelReturn(); + //var instane = new OpenApiPetstore.ModelReturn(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Name.spec.js b/samples/client/petstore/javascript-es6/test/model/Name.spec.js index c9caf576bd0..3726b8867b4 100644 --- a/samples/client/petstore/javascript-es6/test/model/Name.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Name.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Name(); + instance = new OpenApiPetstore.Name(); }); var getProperty = function(object, getter, property) { @@ -50,31 +50,31 @@ describe('Name', function() { it('should create an instance of Name', function() { // uncomment below and update the code to test Name - //var instane = new SwaggerPetstore.Name(); - //expect(instance).to.be.a(SwaggerPetstore.Name); + //var instane = new OpenApiPetstore.Name(); + //expect(instance).to.be.a(OpenApiPetstore.Name); }); it('should have the property name (base name: "name")', function() { // uncomment below and update the code to test the property name - //var instane = new SwaggerPetstore.Name(); + //var instane = new OpenApiPetstore.Name(); //expect(instance).to.be(); }); it('should have the property snakeCase (base name: "snake_case")', function() { // uncomment below and update the code to test the property snakeCase - //var instane = new SwaggerPetstore.Name(); + //var instane = new OpenApiPetstore.Name(); //expect(instance).to.be(); }); it('should have the property property (base name: "property")', function() { // uncomment below and update the code to test the property property - //var instane = new SwaggerPetstore.Name(); + //var instane = new OpenApiPetstore.Name(); //expect(instance).to.be(); }); - it('should have the property _123Number (base name: "123Number")', function() { - // uncomment below and update the code to test the property _123Number - //var instane = new SwaggerPetstore.Name(); + it('should have the property _123number (base name: "123Number")', function() { + // uncomment below and update the code to test the property _123number + //var instane = new OpenApiPetstore.Name(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/NumberOnly.spec.js b/samples/client/petstore/javascript-es6/test/model/NumberOnly.spec.js index 641c03b13a4..2261973c9af 100644 --- a/samples/client/petstore/javascript-es6/test/model/NumberOnly.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/NumberOnly.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.NumberOnly(); + instance = new OpenApiPetstore.NumberOnly(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('NumberOnly', function() { it('should create an instance of NumberOnly', function() { // uncomment below and update the code to test NumberOnly - //var instane = new SwaggerPetstore.NumberOnly(); - //expect(instance).to.be.a(SwaggerPetstore.NumberOnly); + //var instane = new OpenApiPetstore.NumberOnly(); + //expect(instance).to.be.a(OpenApiPetstore.NumberOnly); }); it('should have the property justNumber (base name: "JustNumber")', function() { // uncomment below and update the code to test the property justNumber - //var instane = new SwaggerPetstore.NumberOnly(); + //var instane = new OpenApiPetstore.NumberOnly(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Order.spec.js b/samples/client/petstore/javascript-es6/test/model/Order.spec.js index 69527dc8fdb..536d217cc5b 100644 --- a/samples/client/petstore/javascript-es6/test/model/Order.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Order.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Order(); + instance = new OpenApiPetstore.Order(); }); var getProperty = function(object, getter, property) { @@ -50,43 +50,43 @@ describe('Order', function() { it('should create an instance of Order', function() { // uncomment below and update the code to test Order - //var instane = new SwaggerPetstore.Order(); - //expect(instance).to.be.a(SwaggerPetstore.Order); + //var instane = new OpenApiPetstore.Order(); + //expect(instance).to.be.a(OpenApiPetstore.Order); }); it('should have the property id (base name: "id")', function() { // uncomment below and update the code to test the property id - //var instane = new SwaggerPetstore.Order(); + //var instane = new OpenApiPetstore.Order(); //expect(instance).to.be(); }); it('should have the property petId (base name: "petId")', function() { // uncomment below and update the code to test the property petId - //var instane = new SwaggerPetstore.Order(); + //var instane = new OpenApiPetstore.Order(); //expect(instance).to.be(); }); it('should have the property quantity (base name: "quantity")', function() { // uncomment below and update the code to test the property quantity - //var instane = new SwaggerPetstore.Order(); + //var instane = new OpenApiPetstore.Order(); //expect(instance).to.be(); }); it('should have the property shipDate (base name: "shipDate")', function() { // uncomment below and update the code to test the property shipDate - //var instane = new SwaggerPetstore.Order(); + //var instane = new OpenApiPetstore.Order(); //expect(instance).to.be(); }); it('should have the property status (base name: "status")', function() { // uncomment below and update the code to test the property status - //var instane = new SwaggerPetstore.Order(); + //var instane = new OpenApiPetstore.Order(); //expect(instance).to.be(); }); it('should have the property complete (base name: "complete")', function() { // uncomment below and update the code to test the property complete - //var instane = new SwaggerPetstore.Order(); + //var instane = new OpenApiPetstore.Order(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/OuterBoolean.spec.js b/samples/client/petstore/javascript-es6/test/model/OuterBoolean.spec.js index d5495a638d8..765f758cd09 100644 --- a/samples/client/petstore/javascript-es6/test/model/OuterBoolean.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/OuterBoolean.spec.js @@ -28,7 +28,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterBoolean(); + // OuterBoolean is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterBoolean(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-es6/test/model/OuterComposite.spec.js b/samples/client/petstore/javascript-es6/test/model/OuterComposite.spec.js index 6fd830b7c0e..3309d619422 100644 --- a/samples/client/petstore/javascript-es6/test/model/OuterComposite.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/OuterComposite.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterComposite(); + instance = new OpenApiPetstore.OuterComposite(); }); var getProperty = function(object, getter, property) { @@ -50,25 +50,25 @@ describe('OuterComposite', function() { it('should create an instance of OuterComposite', function() { // uncomment below and update the code to test OuterComposite - //var instane = new SwaggerPetstore.OuterComposite(); - //expect(instance).to.be.a(SwaggerPetstore.OuterComposite); + //var instane = new OpenApiPetstore.OuterComposite(); + //expect(instance).to.be.a(OpenApiPetstore.OuterComposite); }); it('should have the property myNumber (base name: "my_number")', function() { // uncomment below and update the code to test the property myNumber - //var instane = new SwaggerPetstore.OuterComposite(); + //var instane = new OpenApiPetstore.OuterComposite(); //expect(instance).to.be(); }); it('should have the property myString (base name: "my_string")', function() { // uncomment below and update the code to test the property myString - //var instane = new SwaggerPetstore.OuterComposite(); + //var instane = new OpenApiPetstore.OuterComposite(); //expect(instance).to.be(); }); it('should have the property myBoolean (base name: "my_boolean")', function() { // uncomment below and update the code to test the property myBoolean - //var instane = new SwaggerPetstore.OuterComposite(); + //var instane = new OpenApiPetstore.OuterComposite(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/OuterEnum.spec.js b/samples/client/petstore/javascript-es6/test/model/OuterEnum.spec.js index 14c26a3aef5..fa51fa90cb4 100644 --- a/samples/client/petstore/javascript-es6/test/model/OuterEnum.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/OuterEnum.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,9 +20,9 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; @@ -49,8 +49,8 @@ describe('OuterEnum', function() { it('should create an instance of OuterEnum', function() { // uncomment below and update the code to test OuterEnum - //var instane = new SwaggerPetstore.OuterEnum(); - //expect(instance).to.be.a(SwaggerPetstore.OuterEnum); + //var instane = new OpenApiPetstore.OuterEnum(); + //expect(instance).to.be.a(OpenApiPetstore.OuterEnum); }); }); diff --git a/samples/client/petstore/javascript-es6/test/model/OuterNumber.spec.js b/samples/client/petstore/javascript-es6/test/model/OuterNumber.spec.js index 7b0e4ebf119..2466fbe6dc9 100644 --- a/samples/client/petstore/javascript-es6/test/model/OuterNumber.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/OuterNumber.spec.js @@ -28,7 +28,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterNumber(); + // OuterNumber is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterNumber(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-es6/test/model/OuterString.spec.js b/samples/client/petstore/javascript-es6/test/model/OuterString.spec.js index 4e7f99ca88d..46d6c579bc9 100644 --- a/samples/client/petstore/javascript-es6/test/model/OuterString.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/OuterString.spec.js @@ -28,7 +28,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterString(); + // OuterString is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterString(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-es6/test/model/Pet.spec.js b/samples/client/petstore/javascript-es6/test/model/Pet.spec.js index 0da95d08662..f8ce9b93a3c 100644 --- a/samples/client/petstore/javascript-es6/test/model/Pet.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Pet.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Pet(); + instance = new OpenApiPetstore.Pet(); }); var getProperty = function(object, getter, property) { @@ -50,43 +50,43 @@ describe('Pet', function() { it('should create an instance of Pet', function() { // uncomment below and update the code to test Pet - //var instane = new SwaggerPetstore.Pet(); - //expect(instance).to.be.a(SwaggerPetstore.Pet); + //var instane = new OpenApiPetstore.Pet(); + //expect(instance).to.be.a(OpenApiPetstore.Pet); }); it('should have the property id (base name: "id")', function() { // uncomment below and update the code to test the property id - //var instane = new SwaggerPetstore.Pet(); + //var instane = new OpenApiPetstore.Pet(); //expect(instance).to.be(); }); it('should have the property category (base name: "category")', function() { // uncomment below and update the code to test the property category - //var instane = new SwaggerPetstore.Pet(); + //var instane = new OpenApiPetstore.Pet(); //expect(instance).to.be(); }); it('should have the property name (base name: "name")', function() { // uncomment below and update the code to test the property name - //var instane = new SwaggerPetstore.Pet(); + //var instane = new OpenApiPetstore.Pet(); //expect(instance).to.be(); }); it('should have the property photoUrls (base name: "photoUrls")', function() { // uncomment below and update the code to test the property photoUrls - //var instane = new SwaggerPetstore.Pet(); + //var instane = new OpenApiPetstore.Pet(); //expect(instance).to.be(); }); it('should have the property tags (base name: "tags")', function() { // uncomment below and update the code to test the property tags - //var instane = new SwaggerPetstore.Pet(); + //var instane = new OpenApiPetstore.Pet(); //expect(instance).to.be(); }); it('should have the property status (base name: "status")', function() { // uncomment below and update the code to test the property status - //var instane = new SwaggerPetstore.Pet(); + //var instane = new OpenApiPetstore.Pet(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/ReadOnlyFirst.spec.js b/samples/client/petstore/javascript-es6/test/model/ReadOnlyFirst.spec.js index 375856a5abc..5bc5cb3a700 100644 --- a/samples/client/petstore/javascript-es6/test/model/ReadOnlyFirst.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/ReadOnlyFirst.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.ReadOnlyFirst(); + instance = new OpenApiPetstore.ReadOnlyFirst(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('ReadOnlyFirst', function() { it('should create an instance of ReadOnlyFirst', function() { // uncomment below and update the code to test ReadOnlyFirst - //var instane = new SwaggerPetstore.ReadOnlyFirst(); - //expect(instance).to.be.a(SwaggerPetstore.ReadOnlyFirst); + //var instane = new OpenApiPetstore.ReadOnlyFirst(); + //expect(instance).to.be.a(OpenApiPetstore.ReadOnlyFirst); }); it('should have the property bar (base name: "bar")', function() { // uncomment below and update the code to test the property bar - //var instane = new SwaggerPetstore.ReadOnlyFirst(); + //var instane = new OpenApiPetstore.ReadOnlyFirst(); //expect(instance).to.be(); }); it('should have the property baz (base name: "baz")', function() { // uncomment below and update the code to test the property baz - //var instane = new SwaggerPetstore.ReadOnlyFirst(); + //var instane = new OpenApiPetstore.ReadOnlyFirst(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/SpecialModelName.spec.js b/samples/client/petstore/javascript-es6/test/model/SpecialModelName.spec.js index 1d821d94f2a..f459d2e0cd6 100644 --- a/samples/client/petstore/javascript-es6/test/model/SpecialModelName.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/SpecialModelName.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.SpecialModelName(); + instance = new OpenApiPetstore.SpecialModelName(); }); var getProperty = function(object, getter, property) { @@ -50,13 +50,13 @@ describe('SpecialModelName', function() { it('should create an instance of SpecialModelName', function() { // uncomment below and update the code to test SpecialModelName - //var instane = new SwaggerPetstore.SpecialModelName(); - //expect(instance).to.be.a(SwaggerPetstore.SpecialModelName); + //var instane = new OpenApiPetstore.SpecialModelName(); + //expect(instance).to.be.a(OpenApiPetstore.SpecialModelName); }); it('should have the property specialPropertyName (base name: "$special[property.name]")', function() { // uncomment below and update the code to test the property specialPropertyName - //var instane = new SwaggerPetstore.SpecialModelName(); + //var instane = new OpenApiPetstore.SpecialModelName(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/Tag.spec.js b/samples/client/petstore/javascript-es6/test/model/Tag.spec.js index b4aaf43538e..2213b06d509 100644 --- a/samples/client/petstore/javascript-es6/test/model/Tag.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/Tag.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.Tag(); + instance = new OpenApiPetstore.Tag(); }); var getProperty = function(object, getter, property) { @@ -50,19 +50,19 @@ describe('Tag', function() { it('should create an instance of Tag', function() { // uncomment below and update the code to test Tag - //var instane = new SwaggerPetstore.Tag(); - //expect(instance).to.be.a(SwaggerPetstore.Tag); + //var instane = new OpenApiPetstore.Tag(); + //expect(instance).to.be.a(OpenApiPetstore.Tag); }); it('should have the property id (base name: "id")', function() { // uncomment below and update the code to test the property id - //var instane = new SwaggerPetstore.Tag(); + //var instane = new OpenApiPetstore.Tag(); //expect(instance).to.be(); }); it('should have the property name (base name: "name")', function() { // uncomment below and update the code to test the property name - //var instane = new SwaggerPetstore.Tag(); + //var instane = new OpenApiPetstore.Tag(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-es6/test/model/User.spec.js b/samples/client/petstore/javascript-es6/test/model/User.spec.js index 19db8f90bfd..f0cd8819ec8 100644 --- a/samples/client/petstore/javascript-es6/test/model/User.spec.js +++ b/samples/client/petstore/javascript-es6/test/model/User.spec.js @@ -1,12 +1,12 @@ /** - * Swagger Petstore + * OpenAPI Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io + * * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ @@ -20,15 +20,15 @@ factory(require('expect.js'), require('../../src/index')); } else { // Browser globals (root is window) - factory(root.expect, root.SwaggerPetstore); + factory(root.expect, root.OpenApiPetstore); } -}(this, function(expect, SwaggerPetstore) { +}(this, function(expect, OpenApiPetstore) { 'use strict'; var instance; beforeEach(function() { - instance = new SwaggerPetstore.User(); + instance = new OpenApiPetstore.User(); }); var getProperty = function(object, getter, property) { @@ -50,55 +50,55 @@ describe('User', function() { it('should create an instance of User', function() { // uncomment below and update the code to test User - //var instane = new SwaggerPetstore.User(); - //expect(instance).to.be.a(SwaggerPetstore.User); + //var instane = new OpenApiPetstore.User(); + //expect(instance).to.be.a(OpenApiPetstore.User); }); it('should have the property id (base name: "id")', function() { // uncomment below and update the code to test the property id - //var instane = new SwaggerPetstore.User(); + //var instane = new OpenApiPetstore.User(); //expect(instance).to.be(); }); it('should have the property username (base name: "username")', function() { // uncomment below and update the code to test the property username - //var instane = new SwaggerPetstore.User(); + //var instane = new OpenApiPetstore.User(); //expect(instance).to.be(); }); it('should have the property firstName (base name: "firstName")', function() { // uncomment below and update the code to test the property firstName - //var instane = new SwaggerPetstore.User(); + //var instane = new OpenApiPetstore.User(); //expect(instance).to.be(); }); it('should have the property lastName (base name: "lastName")', function() { // uncomment below and update the code to test the property lastName - //var instane = new SwaggerPetstore.User(); + //var instane = new OpenApiPetstore.User(); //expect(instance).to.be(); }); it('should have the property email (base name: "email")', function() { // uncomment below and update the code to test the property email - //var instane = new SwaggerPetstore.User(); + //var instane = new OpenApiPetstore.User(); //expect(instance).to.be(); }); it('should have the property password (base name: "password")', function() { // uncomment below and update the code to test the property password - //var instane = new SwaggerPetstore.User(); + //var instane = new OpenApiPetstore.User(); //expect(instance).to.be(); }); it('should have the property phone (base name: "phone")', function() { // uncomment below and update the code to test the property phone - //var instane = new SwaggerPetstore.User(); + //var instane = new OpenApiPetstore.User(); //expect(instance).to.be(); }); it('should have the property userStatus (base name: "userStatus")', function() { // uncomment below and update the code to test the property userStatus - //var instane = new SwaggerPetstore.User(); + //var instane = new OpenApiPetstore.User(); //expect(instance).to.be(); }); diff --git a/samples/client/petstore/javascript-promise-es6/pom.xml b/samples/client/petstore/javascript-promise-es6/pom.xml index 3892dedffa2..793a531b460 100644 --- a/samples/client/petstore/javascript-promise-es6/pom.xml +++ b/samples/client/petstore/javascript-promise-es6/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - io.swagger - swagger-petstore-javascript-promise-es6 + org.openapitools + openapi-petstore-javascript-promise-es6 pom 1.0-SNAPSHOT - Swagger Petstore JS ES6 Client (Promise version) + OpenAPI Petstore JS Client (ES6, Promise) diff --git a/samples/client/petstore/javascript-promise-es6/src/ApiClient.js b/samples/client/petstore/javascript-promise-es6/src/ApiClient.js index 2bb0139797c..330df9845a0 100644 --- a/samples/client/petstore/javascript-promise-es6/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise-es6/src/ApiClient.js @@ -27,7 +27,7 @@ import querystring from "querystring"; * @alias module:ApiClient * @class */ -export default class ApiClient { +class ApiClient { constructor() { /** * The base URL against which to resolve every API call's (relative) path. @@ -225,43 +225,6 @@ export default class ApiClient { return newParams; } - /** - * Enumeration of collection format separator strategies. - * @enum {String} - * @readonly - */ - static CollectionFormatEnum = { - /** - * Comma-separated values. Value: csv - * @const - */ - CSV: ',', - - /** - * Space-separated values. Value: ssv - * @const - */ - SSV: ' ', - - /** - * Tab-separated values. Value: tsv - * @const - */ - TSV: '\t', - - /** - * Pipe(|)-separated values. Value: pipes - * @const - */ - PIPES: '|', - - /** - * Native array. Value: multi - * @const - */ - MULTI: 'multi' - }; - /** * Builds a string representation of an array-type actual parameter, according to the given collection format. * @param {Array} param An array parameter. @@ -573,8 +536,46 @@ export default class ApiClient { }; } +/** + * Enumeration of collection format separator strategies. + * @enum {String} + * @readonly + */ +ApiClient.CollectionFormatEnum = { + /** + * Comma-separated values. Value: csv + * @const + */ + CSV: ',', + + /** + * Space-separated values. Value: ssv + * @const + */ + SSV: ' ', + + /** + * Tab-separated values. Value: tsv + * @const + */ + TSV: '\t', + + /** + * Pipe(|)-separated values. Value: pipes + * @const + */ + PIPES: '|', + + /** + * Native array. Value: multi + * @const + */ + MULTI: 'multi' +}; + /** * The default API client implementation. * @type {module:ApiClient} */ ApiClient.instance = new ApiClient(); +export default ApiClient; \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js index d347940fffb..87cfae00659 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js @@ -60,7 +60,7 @@ export default class FakeApi { let authNames = []; let contentTypes = []; let accepts = ['*/*']; - let returnType = Boolean; + let returnType = 'Boolean'; return this.apiClient.callApi( '/fake/outer/boolean', 'POST', @@ -152,7 +152,7 @@ export default class FakeApi { let authNames = []; let contentTypes = []; let accepts = ['*/*']; - let returnType = Number; + let returnType = 'Number'; return this.apiClient.callApi( '/fake/outer/number', 'POST', @@ -198,7 +198,7 @@ export default class FakeApi { let authNames = []; let contentTypes = []; let accepts = ['*/*']; - let returnType = String; + let returnType = 'String'; return this.apiClient.callApi( '/fake/outer/string', 'POST', diff --git a/samples/client/petstore/javascript-promise-es6/src/api/Fake_classname_tags123Api.js b/samples/client/petstore/javascript-promise-es6/src/api/Fake_classname_tags123Api.js deleted file mode 100644 index 9ce405845a5..00000000000 --- a/samples/client/petstore/javascript-promise-es6/src/api/Fake_classname_tags123Api.js +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - */ - - -import ApiClient from "../ApiClient"; -import Client from '../model/Client'; - -/** -* Fake_classname_tags123 service. -* @module api/Fake_classname_tags123Api -* @version 1.0.0 -*/ -export default class Fake_classname_tags123Api { - - /** - * Constructs a new Fake_classname_tags123Api. - * @alias module:api/Fake_classname_tags123Api - * @class - * @param {module:ApiClient} [apiClient] Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - constructor(apiClient) { - this.apiClient = apiClient || ApiClient.instance; - } - - - - /** - * To test class name in snake case - * @param {module:model/Client} body client model - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response - */ - testClassnameWithHttpInfo(body) { - let postBody = body; - - // verify the required parameter 'body' is set - if (body === undefined || body === null) { - throw new Error("Missing the required parameter 'body' when calling testClassname"); - } - - - let pathParams = { - }; - let queryParams = { - }; - let headerParams = { - }; - let formParams = { - }; - - let authNames = ['api_key_query']; - let contentTypes = ['application/json']; - let accepts = ['application/json']; - let returnType = Client; - - return this.apiClient.callApi( - '/fake_classname_test', 'PATCH', - pathParams, queryParams, headerParams, formParams, postBody, - authNames, contentTypes, accepts, returnType - ); - } - - /** - * To test class name in snake case - * @param {module:model/Client} body client model - * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} - */ - testClassname(body) { - return this.testClassnameWithHttpInfo(body) - .then(function(response_and_data) { - return response_and_data.data; - }); - } - - -} diff --git a/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js b/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js index f21f9822eeb..583a5e44fc1 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js @@ -107,7 +107,7 @@ export default class StoreApi { let authNames = ['api_key']; let contentTypes = []; let accepts = ['application/json']; - let returnType = {String: Number}; + let returnType = {'String': 'Number'}; return this.apiClient.callApi( '/store/inventory', 'GET', diff --git a/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js b/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js index 98100f61564..c58384b97c3 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js @@ -315,7 +315,7 @@ export default class UserApi { let authNames = []; let contentTypes = []; let accepts = ['application/xml', 'application/json']; - let returnType = String; + let returnType = 'String'; return this.apiClient.callApi( '/user/login', 'GET', diff --git a/samples/client/petstore/javascript-promise-es6/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise-es6/src/model/AdditionalPropertiesClass.js index 227fb797557..d6e898a5ab0 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/AdditionalPropertiesClass.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The AdditionalPropertiesClass model module. -* @module model/AdditionalPropertiesClass -* @version 1.0.0 -*/ -export default class AdditionalPropertiesClass { + * The AdditionalPropertiesClass model module. + * @module model/AdditionalPropertiesClass + * @version 1.0.0 + */ +class AdditionalPropertiesClass { /** - * Constructs a new AdditionalPropertiesClass. - * @alias module:model/AdditionalPropertiesClass - * @class - */ - - constructor() { - - - - - - - + * Constructs a new AdditionalPropertiesClass. + * @alias module:model/AdditionalPropertiesClass + */ + constructor() { + AdditionalPropertiesClass.initialize(this); } /** - * Constructs a AdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/AdditionalPropertiesClass} obj Optional instance to populate. - * @return {module:model/AdditionalPropertiesClass} The populated AdditionalPropertiesClass instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a AdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/AdditionalPropertiesClass} obj Optional instance to populate. + * @return {module:model/AdditionalPropertiesClass} The populated AdditionalPropertiesClass instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new AdditionalPropertiesClass(); - - - - if (data.hasOwnProperty('map_property')) { obj['map_property'] = ApiClient.convertToType(data['map_property'], {'String': 'String'}); } @@ -66,22 +57,23 @@ export default class AdditionalPropertiesClass { return obj; } - /** - * @member {Object.} map_property - */ - map_property = undefined; - /** - * @member {Object.>} map_of_map_property - */ - map_of_map_property = undefined; - - - - - - - } +/** + * @member {Object.} map_property + */ +AdditionalPropertiesClass.prototype['map_property'] = undefined; + +/** + * @member {Object.>} map_of_map_property + */ +AdditionalPropertiesClass.prototype['map_of_map_property'] = undefined; + + + + + + +export default AdditionalPropertiesClass; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Animal.js b/samples/client/petstore/javascript-promise-es6/src/model/Animal.js index dce658d7016..c55d0c758f0 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Animal.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Animal.js @@ -11,52 +11,44 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Animal model module. -* @module model/Animal -* @version 1.0.0 -*/ -export default class Animal { + * The Animal model module. + * @module model/Animal + * @version 1.0.0 + */ +class Animal { /** - * Constructs a new Animal. - * @alias module:model/Animal - * @class - * @param className {String} - */ - - constructor(className) { - - - - - - this['className'] = className; - + * Constructs a new Animal. + * @alias module:model/Animal + * @param className {String} + */ + constructor(className) { + Animal.initialize(this, className); } /** - * Constructs a Animal from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Animal} obj Optional instance to populate. - * @return {module:model/Animal} The populated Animal instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, className) { + obj['className'] = className; + } + + /** + * Constructs a Animal from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Animal} obj Optional instance to populate. + * @return {module:model/Animal} The populated Animal instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Animal(); - - - - if (data.hasOwnProperty('className')) { obj['className'] = ApiClient.convertToType(data['className'], 'String'); } @@ -67,23 +59,24 @@ export default class Animal { return obj; } - /** - * @member {String} className - */ - className = undefined; - /** - * @member {String} color - * @default 'red' - */ - color = 'red'; - - - - - - - } +/** + * @member {String} className + */ +Animal.prototype['className'] = undefined; + +/** + * @member {String} color + * @default 'red' + */ +Animal.prototype['color'] = 'red'; + + + + + + +export default Animal; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/AnimalFarm.js b/samples/client/petstore/javascript-promise-es6/src/model/AnimalFarm.js index c0663cd1fa6..3b9cc01f03d 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/AnimalFarm.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/AnimalFarm.js @@ -11,54 +11,47 @@ * */ - import ApiClient from '../ApiClient'; import Animal from './Animal'; - - - - /** -* The AnimalFarm model module. -* @module model/AnimalFarm -* @version 1.0.0 -*/ -export default class AnimalFarm extends Array { + * The AnimalFarm model module. + * @module model/AnimalFarm + * @version 1.0.0 + */ +class AnimalFarm extends Array { /** - * Constructs a new AnimalFarm. - * @alias module:model/AnimalFarm - * @class - * @extends Array - */ - - constructor() { - + * Constructs a new AnimalFarm. + * @alias module:model/AnimalFarm + * @extends Array + */ + constructor() { super(); - - - - - - return this; + AnimalFarm.initialize(this); } /** - * Constructs a AnimalFarm from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/AnimalFarm} obj Optional instance to populate. - * @return {module:model/AnimalFarm} The populated AnimalFarm instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a AnimalFarm from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/AnimalFarm} obj Optional instance to populate. + * @return {module:model/AnimalFarm} The populated AnimalFarm instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new AnimalFarm(); ApiClient.constructFromObject(data, obj, 'Animal'); - - } @@ -66,13 +59,12 @@ export default class AnimalFarm extends Array { } - - - - - - - } + + + + +export default AnimalFarm; + diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ApiResponse.js b/samples/client/petstore/javascript-promise-es6/src/model/ApiResponse.js index 48142ded09d..4f5fb55291c 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ApiResponse.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ApiResponse model module. -* @module model/ApiResponse -* @version 1.0.0 -*/ -export default class ApiResponse { + * The ApiResponse model module. + * @module model/ApiResponse + * @version 1.0.0 + */ +class ApiResponse { /** - * Constructs a new ApiResponse. - * @alias module:model/ApiResponse - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ApiResponse. + * @alias module:model/ApiResponse + */ + constructor() { + ApiResponse.initialize(this); } /** - * Constructs a ApiResponse from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ApiResponse} obj Optional instance to populate. - * @return {module:model/ApiResponse} The populated ApiResponse instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ApiResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ApiResponse} obj Optional instance to populate. + * @return {module:model/ApiResponse} The populated ApiResponse instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ApiResponse(); - - - - if (data.hasOwnProperty('code')) { obj['code'] = ApiClient.convertToType(data['code'], 'Number'); } @@ -69,26 +60,28 @@ export default class ApiResponse { return obj; } - /** - * @member {Number} code - */ - code = undefined; - /** - * @member {String} type - */ - type = undefined; - /** - * @member {String} message - */ - message = undefined; - - - - - - - } +/** + * @member {Number} code + */ +ApiResponse.prototype['code'] = undefined; + +/** + * @member {String} type + */ +ApiResponse.prototype['type'] = undefined; + +/** + * @member {String} message + */ +ApiResponse.prototype['message'] = undefined; + + + + + + +export default ApiResponse; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfArrayOfNumberOnly.js index acfac49ce0d..e8d959f3689 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfArrayOfNumberOnly.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ArrayOfArrayOfNumberOnly model module. -* @module model/ArrayOfArrayOfNumberOnly -* @version 1.0.0 -*/ -export default class ArrayOfArrayOfNumberOnly { + * The ArrayOfArrayOfNumberOnly model module. + * @module model/ArrayOfArrayOfNumberOnly + * @version 1.0.0 + */ +class ArrayOfArrayOfNumberOnly { /** - * Constructs a new ArrayOfArrayOfNumberOnly. - * @alias module:model/ArrayOfArrayOfNumberOnly - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ArrayOfArrayOfNumberOnly. + * @alias module:model/ArrayOfArrayOfNumberOnly + */ + constructor() { + ArrayOfArrayOfNumberOnly.initialize(this); } /** - * Constructs a ArrayOfArrayOfNumberOnly from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ArrayOfArrayOfNumberOnly} obj Optional instance to populate. - * @return {module:model/ArrayOfArrayOfNumberOnly} The populated ArrayOfArrayOfNumberOnly instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ArrayOfArrayOfNumberOnly from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ArrayOfArrayOfNumberOnly} obj Optional instance to populate. + * @return {module:model/ArrayOfArrayOfNumberOnly} The populated ArrayOfArrayOfNumberOnly instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ArrayOfArrayOfNumberOnly(); - - - - if (data.hasOwnProperty('ArrayArrayNumber')) { obj['ArrayArrayNumber'] = ApiClient.convertToType(data['ArrayArrayNumber'], [['Number']]); } @@ -63,18 +54,18 @@ export default class ArrayOfArrayOfNumberOnly { return obj; } - /** - * @member {Array.>} ArrayArrayNumber - */ - ArrayArrayNumber = undefined; - - - - - - - } +/** + * @member {Array.>} ArrayArrayNumber + */ +ArrayOfArrayOfNumberOnly.prototype['ArrayArrayNumber'] = undefined; + + + + + + +export default ArrayOfArrayOfNumberOnly; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfNumberOnly.js index 28a47d0bb7a..4fb72e435e6 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfNumberOnly.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ArrayOfNumberOnly model module. -* @module model/ArrayOfNumberOnly -* @version 1.0.0 -*/ -export default class ArrayOfNumberOnly { + * The ArrayOfNumberOnly model module. + * @module model/ArrayOfNumberOnly + * @version 1.0.0 + */ +class ArrayOfNumberOnly { /** - * Constructs a new ArrayOfNumberOnly. - * @alias module:model/ArrayOfNumberOnly - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ArrayOfNumberOnly. + * @alias module:model/ArrayOfNumberOnly + */ + constructor() { + ArrayOfNumberOnly.initialize(this); } /** - * Constructs a ArrayOfNumberOnly from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ArrayOfNumberOnly} obj Optional instance to populate. - * @return {module:model/ArrayOfNumberOnly} The populated ArrayOfNumberOnly instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ArrayOfNumberOnly from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ArrayOfNumberOnly} obj Optional instance to populate. + * @return {module:model/ArrayOfNumberOnly} The populated ArrayOfNumberOnly instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ArrayOfNumberOnly(); - - - - if (data.hasOwnProperty('ArrayNumber')) { obj['ArrayNumber'] = ApiClient.convertToType(data['ArrayNumber'], ['Number']); } @@ -63,18 +54,18 @@ export default class ArrayOfNumberOnly { return obj; } - /** - * @member {Array.} ArrayNumber - */ - ArrayNumber = undefined; - - - - - - - } +/** + * @member {Array.} ArrayNumber + */ +ArrayOfNumberOnly.prototype['ArrayNumber'] = undefined; + + + + + + +export default ArrayOfNumberOnly; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ArrayTest.js b/samples/client/petstore/javascript-promise-es6/src/model/ArrayTest.js index eff8b23dd82..8096c2c4f7f 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ArrayTest.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; import ReadOnlyFirst from './ReadOnlyFirst'; - - - - /** -* The ArrayTest model module. -* @module model/ArrayTest -* @version 1.0.0 -*/ -export default class ArrayTest { + * The ArrayTest model module. + * @module model/ArrayTest + * @version 1.0.0 + */ +class ArrayTest { /** - * Constructs a new ArrayTest. - * @alias module:model/ArrayTest - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ArrayTest. + * @alias module:model/ArrayTest + */ + constructor() { + ArrayTest.initialize(this); } /** - * Constructs a ArrayTest from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ArrayTest} obj Optional instance to populate. - * @return {module:model/ArrayTest} The populated ArrayTest instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ArrayTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ArrayTest} obj Optional instance to populate. + * @return {module:model/ArrayTest} The populated ArrayTest instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ArrayTest(); - - - - if (data.hasOwnProperty('array_of_string')) { obj['array_of_string'] = ApiClient.convertToType(data['array_of_string'], ['String']); } @@ -70,26 +61,28 @@ export default class ArrayTest { return obj; } - /** - * @member {Array.} array_of_string - */ - array_of_string = undefined; - /** - * @member {Array.>} array_array_of_integer - */ - array_array_of_integer = undefined; - /** - * @member {Array.>} array_array_of_model - */ - array_array_of_model = undefined; - - - - - - - } +/** + * @member {Array.} array_of_string + */ +ArrayTest.prototype['array_of_string'] = undefined; + +/** + * @member {Array.>} array_array_of_integer + */ +ArrayTest.prototype['array_array_of_integer'] = undefined; + +/** + * @member {Array.>} array_array_of_model + */ +ArrayTest.prototype['array_array_of_model'] = undefined; + + + + + + +export default ArrayTest; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Capitalization.js b/samples/client/petstore/javascript-promise-es6/src/model/Capitalization.js index 41c6ff9af30..bc1cdefb71b 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Capitalization.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Capitalization.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Capitalization model module. -* @module model/Capitalization -* @version 1.0.0 -*/ -export default class Capitalization { + * The Capitalization model module. + * @module model/Capitalization + * @version 1.0.0 + */ +class Capitalization { /** - * Constructs a new Capitalization. - * @alias module:model/Capitalization - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Capitalization. + * @alias module:model/Capitalization + */ + constructor() { + Capitalization.initialize(this); } /** - * Constructs a Capitalization from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Capitalization} obj Optional instance to populate. - * @return {module:model/Capitalization} The populated Capitalization instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Capitalization from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Capitalization} obj Optional instance to populate. + * @return {module:model/Capitalization} The populated Capitalization instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Capitalization(); - - - - if (data.hasOwnProperty('smallCamel')) { obj['smallCamel'] = ApiClient.convertToType(data['smallCamel'], 'String'); } @@ -78,39 +69,44 @@ export default class Capitalization { return obj; } - /** - * @member {String} smallCamel - */ - smallCamel = undefined; - /** - * @member {String} CapitalCamel - */ - CapitalCamel = undefined; - /** - * @member {String} small_Snake - */ - small_Snake = undefined; - /** - * @member {String} Capital_Snake - */ - Capital_Snake = undefined; - /** - * @member {String} SCA_ETH_Flow_Points - */ - SCA_ETH_Flow_Points = undefined; - /** - * Name of the pet - * @member {String} ATT_NAME - */ - ATT_NAME = undefined; - - - - - - - } +/** + * @member {String} smallCamel + */ +Capitalization.prototype['smallCamel'] = undefined; + +/** + * @member {String} CapitalCamel + */ +Capitalization.prototype['CapitalCamel'] = undefined; + +/** + * @member {String} small_Snake + */ +Capitalization.prototype['small_Snake'] = undefined; + +/** + * @member {String} Capital_Snake + */ +Capitalization.prototype['Capital_Snake'] = undefined; + +/** + * @member {String} SCA_ETH_Flow_Points + */ +Capitalization.prototype['SCA_ETH_Flow_Points'] = undefined; + +/** + * Name of the pet + * @member {String} ATT_NAME + */ +Capitalization.prototype['ATT_NAME'] = undefined; + + + + + + +export default Capitalization; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Cat.js b/samples/client/petstore/javascript-promise-es6/src/model/Cat.js index cc759099886..5ad5fb40286 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Cat.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Cat.js @@ -11,53 +11,45 @@ * */ - import ApiClient from '../ApiClient'; import Animal from './Animal'; - - - - /** -* The Cat model module. -* @module model/Cat -* @version 1.0.0 -*/ -export default class Cat { + * The Cat model module. + * @module model/Cat + * @version 1.0.0 + */ +class Cat { /** - * Constructs a new Cat. - * @alias module:model/Cat - * @class - * @extends module:model/Animal - * @implements module:model/Animal - * @param className {} - */ - - constructor(className) { - - - Animal.call(this, className); - Animal.call(this, className); - - - - + * Constructs a new Cat. + * @alias module:model/Cat + * @extends module:model/Animal + * @implements module:model/Animal + * @param className {} + */ + constructor(className) { + Animal.initialize(this, className); + Cat.initialize(this, className); } /** - * Constructs a Cat from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Cat} obj Optional instance to populate. - * @return {module:model/Cat} The populated Cat instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, className) { + } + + /** + * Constructs a Cat from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Cat} obj Optional instance to populate. + * @return {module:model/Cat} The populated Cat instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Cat(); - - - Animal.constructFromObject(data, obj); Animal.constructFromObject(data, obj); @@ -68,29 +60,28 @@ export default class Cat { return obj; } - /** - * @member {Boolean} declawed - */ - declawed = undefined; - - - // Implement Animal interface: - /** - * @member {String} className - */ - className = undefined; -/** - * @member {String} color - * @default 'red' - */ - color = 'red'; - - - - - - } +/** + * @member {Boolean} declawed + */ +Cat.prototype['declawed'] = undefined; + + +// Implement Animal interface: +/** + * @member {String} className + */ +Animal.prototype['className'] = undefined; +/** + * @member {String} color + * @default 'red' + */ +Animal.prototype['color'] = 'red'; + + + + +export default Cat; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Category.js b/samples/client/petstore/javascript-promise-es6/src/model/Category.js index cdd487022d0..fd0bf79dafb 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Category.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Category.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Category model module. -* @module model/Category -* @version 1.0.0 -*/ -export default class Category { + * The Category model module. + * @module model/Category + * @version 1.0.0 + */ +class Category { /** - * Constructs a new Category. - * @alias module:model/Category - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Category. + * @alias module:model/Category + */ + constructor() { + Category.initialize(this); } /** - * Constructs a Category from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Category} obj Optional instance to populate. - * @return {module:model/Category} The populated Category instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Category from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Category} obj Optional instance to populate. + * @return {module:model/Category} The populated Category instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Category(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -66,22 +57,23 @@ export default class Category { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {String} name - */ - name = undefined; - - - - - - - } +/** + * @member {Number} id + */ +Category.prototype['id'] = undefined; + +/** + * @member {String} name + */ +Category.prototype['name'] = undefined; + + + + + + +export default Category; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ClassModel.js b/samples/client/petstore/javascript-promise-es6/src/model/ClassModel.js index c9c39c22fff..2e55c2a6342 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ClassModel.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ClassModel.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ClassModel model module. -* @module model/ClassModel -* @version 1.0.0 -*/ -export default class ClassModel { + * The ClassModel model module. + * @module model/ClassModel + * @version 1.0.0 + */ +class ClassModel { /** - * Constructs a new ClassModel. - * Model for testing model with \"_class\" property - * @alias module:model/ClassModel - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ClassModel. + * Model for testing model with \"_class\" property + * @alias module:model/ClassModel + */ + constructor() { + ClassModel.initialize(this); } /** - * Constructs a ClassModel from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ClassModel} obj Optional instance to populate. - * @return {module:model/ClassModel} The populated ClassModel instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ClassModel from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ClassModel} obj Optional instance to populate. + * @return {module:model/ClassModel} The populated ClassModel instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ClassModel(); - - - - if (data.hasOwnProperty('_class')) { obj['_class'] = ApiClient.convertToType(data['_class'], 'String'); } @@ -64,18 +55,18 @@ export default class ClassModel { return obj; } - /** - * @member {String} _class - */ - _class = undefined; - - - - - - - } +/** + * @member {String} _class + */ +ClassModel.prototype['_class'] = undefined; + + + + + + +export default ClassModel; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Client.js b/samples/client/petstore/javascript-promise-es6/src/model/Client.js index 82dca1732b3..c506d2fa174 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Client.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Client.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Client model module. -* @module model/Client -* @version 1.0.0 -*/ -export default class Client { + * The Client model module. + * @module model/Client + * @version 1.0.0 + */ +class Client { /** - * Constructs a new Client. - * @alias module:model/Client - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Client. + * @alias module:model/Client + */ + constructor() { + Client.initialize(this); } /** - * Constructs a Client from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Client} obj Optional instance to populate. - * @return {module:model/Client} The populated Client instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Client from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Client} obj Optional instance to populate. + * @return {module:model/Client} The populated Client instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Client(); - - - - if (data.hasOwnProperty('client')) { obj['client'] = ApiClient.convertToType(data['client'], 'String'); } @@ -63,18 +54,18 @@ export default class Client { return obj; } - /** - * @member {String} client - */ - client = undefined; - - - - - - - } +/** + * @member {String} client + */ +Client.prototype['client'] = undefined; + + + + + + +export default Client; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Dog.js b/samples/client/petstore/javascript-promise-es6/src/model/Dog.js index 92168904822..ba225630e93 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Dog.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Dog.js @@ -11,53 +11,45 @@ * */ - import ApiClient from '../ApiClient'; import Animal from './Animal'; - - - - /** -* The Dog model module. -* @module model/Dog -* @version 1.0.0 -*/ -export default class Dog { + * The Dog model module. + * @module model/Dog + * @version 1.0.0 + */ +class Dog { /** - * Constructs a new Dog. - * @alias module:model/Dog - * @class - * @extends module:model/Animal - * @implements module:model/Animal - * @param className {} - */ - - constructor(className) { - - - Animal.call(this, className); - Animal.call(this, className); - - - - + * Constructs a new Dog. + * @alias module:model/Dog + * @extends module:model/Animal + * @implements module:model/Animal + * @param className {} + */ + constructor(className) { + Animal.initialize(this, className); + Dog.initialize(this, className); } /** - * Constructs a Dog from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Dog} obj Optional instance to populate. - * @return {module:model/Dog} The populated Dog instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, className) { + } + + /** + * Constructs a Dog from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Dog} obj Optional instance to populate. + * @return {module:model/Dog} The populated Dog instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Dog(); - - - Animal.constructFromObject(data, obj); Animal.constructFromObject(data, obj); @@ -68,29 +60,28 @@ export default class Dog { return obj; } - /** - * @member {String} breed - */ - breed = undefined; - - - // Implement Animal interface: - /** - * @member {String} className - */ - className = undefined; -/** - * @member {String} color - * @default 'red' - */ - color = 'red'; - - - - - - } +/** + * @member {String} breed + */ +Dog.prototype['breed'] = undefined; + + +// Implement Animal interface: +/** + * @member {String} className + */ +Animal.prototype['className'] = undefined; +/** + * @member {String} color + * @default 'red' + */ +Animal.prototype['color'] = 'red'; + + + + +export default Dog; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/EnumArrays.js b/samples/client/petstore/javascript-promise-es6/src/model/EnumArrays.js index f017d9a5396..9426d4735ac 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/EnumArrays.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The EnumArrays model module. -* @module model/EnumArrays -* @version 1.0.0 -*/ -export default class EnumArrays { + * The EnumArrays model module. + * @module model/EnumArrays + * @version 1.0.0 + */ +class EnumArrays { /** - * Constructs a new EnumArrays. - * @alias module:model/EnumArrays - * @class - */ - - constructor() { - - - - - - - + * Constructs a new EnumArrays. + * @alias module:model/EnumArrays + */ + constructor() { + EnumArrays.initialize(this); } /** - * Constructs a EnumArrays from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/EnumArrays} obj Optional instance to populate. - * @return {module:model/EnumArrays} The populated EnumArrays instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a EnumArrays from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/EnumArrays} obj Optional instance to populate. + * @return {module:model/EnumArrays} The populated EnumArrays instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new EnumArrays(); - - - - if (data.hasOwnProperty('just_symbol')) { obj['just_symbol'] = ApiClient.convertToType(data['just_symbol'], 'String'); } @@ -66,62 +57,65 @@ export default class EnumArrays { return obj; } - /** - * @member {module:model/EnumArrays.JustSymbolEnum} just_symbol - */ - just_symbol = undefined; - /** - * @member {Array.} array_enum - */ - array_enum = undefined; - - - - - - - /** - * Allowed values for the just_symbol property. - * @enum {String} - * @readonly - */ - static JustSymbolEnum = { - - /** - * value: ">=" - * @const - */ - "GREATER_THAN_OR_EQUAL_TO": ">=", - - /** - * value: "$" - * @const - */ - "DOLLAR": "$" - }; - - /** - * Allowed values for the arrayEnum property. - * @enum {String} - * @readonly - */ - static ArrayEnumEnum = { - - /** - * value: "fish" - * @const - */ - "fish": "fish", - - /** - * value: "crab" - * @const - */ - "crab": "crab" - }; - - } +/** + * @member {module:model/EnumArrays.JustSymbolEnum} just_symbol + */ +EnumArrays.prototype['just_symbol'] = undefined; + +/** + * @member {Array.} array_enum + */ +EnumArrays.prototype['array_enum'] = undefined; + + + + + +/** + * Allowed values for the just_symbol property. + * @enum {String} + * @readonly + */ +EnumArrays['JustSymbolEnum'] = { + + /** + * value: ">=" + * @const + */ + "GREATER_THAN_OR_EQUAL_TO": ">=", + + /** + * value: "$" + * @const + */ + "DOLLAR": "$" +}; + + +/** + * Allowed values for the arrayEnum property. + * @enum {String} + * @readonly + */ +EnumArrays['ArrayEnumEnum'] = { + + /** + * value: "fish" + * @const + */ + "fish": "fish", + + /** + * value: "crab" + * @const + */ + "crab": "crab" +}; + + + +export default EnumArrays; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/EnumClass.js b/samples/client/petstore/javascript-promise-es6/src/model/EnumClass.js index feb022bc831..65ac9f1f1bc 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/EnumClass.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/EnumClass.js @@ -11,10 +11,7 @@ * */ - import ApiClient from '../ApiClient'; - - /** * Enum class EnumClass. * @enum {} @@ -26,21 +23,21 @@ export default class EnumClass { * value: "_abc" * @const */ - _abc = "_abc"; + "_abc" = "_abc"; /** * value: "-efg" * @const */ - -efg = "-efg"; + "-efg" = "-efg"; /** * value: "(xyz)" * @const */ - (xyz) = "(xyz)"; + "(xyz)" = "(xyz)"; @@ -54,4 +51,3 @@ export default class EnumClass { } } - diff --git a/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js b/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js index eaf874922b5..08828485c18 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js @@ -11,53 +11,45 @@ * */ - import ApiClient from '../ApiClient'; import OuterEnum from './OuterEnum'; - - - - /** -* The EnumTest model module. -* @module model/EnumTest -* @version 1.0.0 -*/ -export default class EnumTest { + * The EnumTest model module. + * @module model/EnumTest + * @version 1.0.0 + */ +class EnumTest { /** - * Constructs a new EnumTest. - * @alias module:model/EnumTest - * @class - * @param enumStringRequired {module:model/EnumTest.EnumStringRequiredEnum} - */ - - constructor(enumStringRequired) { - - - - - - this['enum_string_required'] = enumStringRequired; - + * Constructs a new EnumTest. + * @alias module:model/EnumTest + * @param enumStringRequired {module:model/EnumTest.EnumStringRequiredEnum} + */ + constructor(enumStringRequired) { + EnumTest.initialize(this, enumStringRequired); } /** - * Constructs a EnumTest from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/EnumTest} obj Optional instance to populate. - * @return {module:model/EnumTest} The populated EnumTest instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, enumStringRequired) { + obj['enum_string_required'] = enumStringRequired; + } + + /** + * Constructs a EnumTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/EnumTest} obj Optional instance to populate. + * @return {module:model/EnumTest} The populated EnumTest instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new EnumTest(); - - - - if (data.hasOwnProperty('enum_string')) { obj['enum_string'] = ApiClient.convertToType(data['enum_string'], 'String'); } @@ -77,126 +69,134 @@ export default class EnumTest { return obj; } - /** - * @member {module:model/EnumTest.EnumStringEnum} enum_string - */ - enum_string = undefined; - /** - * @member {module:model/EnumTest.EnumStringRequiredEnum} enum_string_required - */ - enum_string_required = undefined; - /** - * @member {module:model/EnumTest.EnumIntegerEnum} enum_integer - */ - enum_integer = undefined; - /** - * @member {module:model/EnumTest.EnumNumberEnum} enum_number - */ - enum_number = undefined; - /** - * @member {module:model/OuterEnum} outerEnum - */ - outerEnum = undefined; - - - - - - - /** - * Allowed values for the enum_string property. - * @enum {String} - * @readonly - */ - static EnumStringEnum = { - - /** - * value: "UPPER" - * @const - */ - "UPPER": "UPPER", - - /** - * value: "lower" - * @const - */ - "lower": "lower", - - /** - * value: "" - * @const - */ - "empty": "" - }; - - /** - * Allowed values for the enum_string_required property. - * @enum {String} - * @readonly - */ - static EnumStringRequiredEnum = { - - /** - * value: "UPPER" - * @const - */ - "UPPER": "UPPER", - - /** - * value: "lower" - * @const - */ - "lower": "lower", - - /** - * value: "" - * @const - */ - "empty": "" - }; - - /** - * Allowed values for the enum_integer property. - * @enum {Number} - * @readonly - */ - static EnumIntegerEnum = { - - /** - * value: 1 - * @const - */ - "1": 1, - - /** - * value: -1 - * @const - */ - "-1": -1 - }; - - /** - * Allowed values for the enum_number property. - * @enum {Number} - * @readonly - */ - static EnumNumberEnum = { - - /** - * value: 1.1 - * @const - */ - "1.1": 1.1, - - /** - * value: -1.2 - * @const - */ - "-1.2": -1.2 - }; - - } +/** + * @member {module:model/EnumTest.EnumStringEnum} enum_string + */ +EnumTest.prototype['enum_string'] = undefined; + +/** + * @member {module:model/EnumTest.EnumStringRequiredEnum} enum_string_required + */ +EnumTest.prototype['enum_string_required'] = undefined; + +/** + * @member {module:model/EnumTest.EnumIntegerEnum} enum_integer + */ +EnumTest.prototype['enum_integer'] = undefined; + +/** + * @member {module:model/EnumTest.EnumNumberEnum} enum_number + */ +EnumTest.prototype['enum_number'] = undefined; + +/** + * @member {module:model/OuterEnum} outerEnum + */ +EnumTest.prototype['outerEnum'] = undefined; + + + + + +/** + * Allowed values for the enum_string property. + * @enum {String} + * @readonly + */ +EnumTest['EnumStringEnum'] = { + + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + + /** + * value: "lower" + * @const + */ + "lower": "lower", + + /** + * value: "" + * @const + */ + "empty": "" +}; + + +/** + * Allowed values for the enum_string_required property. + * @enum {String} + * @readonly + */ +EnumTest['EnumStringRequiredEnum'] = { + + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + + /** + * value: "lower" + * @const + */ + "lower": "lower", + + /** + * value: "" + * @const + */ + "empty": "" +}; + + +/** + * Allowed values for the enum_integer property. + * @enum {Number} + * @readonly + */ +EnumTest['EnumIntegerEnum'] = { + + /** + * value: 1 + * @const + */ + "1": 1, + + /** + * value: -1 + * @const + */ + "-1": -1 +}; + + +/** + * Allowed values for the enum_number property. + * @enum {Number} + * @readonly + */ +EnumTest['EnumNumberEnum'] = { + + /** + * value: 1.1 + * @const + */ + "1.1": 1.1, + + /** + * value: -1.2 + * @const + */ + "-1.2": -1.2 +}; + + + +export default EnumTest; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/FormatTest.js b/samples/client/petstore/javascript-promise-es6/src/model/FormatTest.js index 7d04ffd26d3..87fa2afe86b 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/FormatTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/FormatTest.js @@ -11,55 +11,50 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The FormatTest model module. -* @module model/FormatTest -* @version 1.0.0 -*/ -export default class FormatTest { + * The FormatTest model module. + * @module model/FormatTest + * @version 1.0.0 + */ +class FormatTest { /** - * Constructs a new FormatTest. - * @alias module:model/FormatTest - * @class - * @param _number {Number} - * @param _byte {Blob} - * @param _date {Date} - * @param password {String} - */ - - constructor(_number, _byte, _date, password) { - - - - - - this['number'] = _number;this['byte'] = _byte;this['date'] = _date;this['password'] = password; - + * Constructs a new FormatTest. + * @alias module:model/FormatTest + * @param _number {Number} + * @param _byte {Blob} + * @param _date {Date} + * @param password {String} + */ + constructor(_number, _byte, _date, password) { + FormatTest.initialize(this, _number, _byte, _date, password); } /** - * Constructs a FormatTest from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/FormatTest} obj Optional instance to populate. - * @return {module:model/FormatTest} The populated FormatTest instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, _number, _byte, _date, password) { + obj['number'] = _number; + obj['byte'] = _byte; + obj['date'] = _date; + obj['password'] = password; + } + + /** + * Constructs a FormatTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/FormatTest} obj Optional instance to populate. + * @return {module:model/FormatTest} The populated FormatTest instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new FormatTest(); - - - - if (data.hasOwnProperty('integer')) { obj['integer'] = ApiClient.convertToType(data['integer'], 'Number'); } @@ -103,66 +98,78 @@ export default class FormatTest { return obj; } - /** - * @member {Number} integer - */ - integer = undefined; - /** - * @member {Number} int32 - */ - int32 = undefined; - /** - * @member {Number} int64 - */ - int64 = undefined; - /** - * @member {Number} number - */ - number = undefined; - /** - * @member {Number} float - */ - float = undefined; - /** - * @member {Number} double - */ - double = undefined; - /** - * @member {String} string - */ - string = undefined; - /** - * @member {Blob} byte - */ - byte = undefined; - /** - * @member {File} binary - */ - binary = undefined; - /** - * @member {Date} date - */ - date = undefined; - /** - * @member {Date} dateTime - */ - dateTime = undefined; - /** - * @member {String} uuid - */ - uuid = undefined; - /** - * @member {String} password - */ - password = undefined; - - - - - - - } +/** + * @member {Number} integer + */ +FormatTest.prototype['integer'] = undefined; + +/** + * @member {Number} int32 + */ +FormatTest.prototype['int32'] = undefined; + +/** + * @member {Number} int64 + */ +FormatTest.prototype['int64'] = undefined; + +/** + * @member {Number} number + */ +FormatTest.prototype['number'] = undefined; + +/** + * @member {Number} float + */ +FormatTest.prototype['float'] = undefined; + +/** + * @member {Number} double + */ +FormatTest.prototype['double'] = undefined; + +/** + * @member {String} string + */ +FormatTest.prototype['string'] = undefined; + +/** + * @member {Blob} byte + */ +FormatTest.prototype['byte'] = undefined; + +/** + * @member {File} binary + */ +FormatTest.prototype['binary'] = undefined; + +/** + * @member {Date} date + */ +FormatTest.prototype['date'] = undefined; + +/** + * @member {Date} dateTime + */ +FormatTest.prototype['dateTime'] = undefined; + +/** + * @member {String} uuid + */ +FormatTest.prototype['uuid'] = undefined; + +/** + * @member {String} password + */ +FormatTest.prototype['password'] = undefined; + + + + + + +export default FormatTest; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript-promise-es6/src/model/HasOnlyReadOnly.js index e5f746c32ba..9c11ae559c9 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/HasOnlyReadOnly.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The HasOnlyReadOnly model module. -* @module model/HasOnlyReadOnly -* @version 1.0.0 -*/ -export default class HasOnlyReadOnly { + * The HasOnlyReadOnly model module. + * @module model/HasOnlyReadOnly + * @version 1.0.0 + */ +class HasOnlyReadOnly { /** - * Constructs a new HasOnlyReadOnly. - * @alias module:model/HasOnlyReadOnly - * @class - */ - - constructor() { - - - - - - - + * Constructs a new HasOnlyReadOnly. + * @alias module:model/HasOnlyReadOnly + */ + constructor() { + HasOnlyReadOnly.initialize(this); } /** - * Constructs a HasOnlyReadOnly from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/HasOnlyReadOnly} obj Optional instance to populate. - * @return {module:model/HasOnlyReadOnly} The populated HasOnlyReadOnly instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a HasOnlyReadOnly from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/HasOnlyReadOnly} obj Optional instance to populate. + * @return {module:model/HasOnlyReadOnly} The populated HasOnlyReadOnly instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new HasOnlyReadOnly(); - - - - if (data.hasOwnProperty('bar')) { obj['bar'] = ApiClient.convertToType(data['bar'], 'String'); } @@ -66,22 +57,23 @@ export default class HasOnlyReadOnly { return obj; } - /** - * @member {String} bar - */ - bar = undefined; - /** - * @member {String} foo - */ - foo = undefined; - - - - - - - } +/** + * @member {String} bar + */ +HasOnlyReadOnly.prototype['bar'] = undefined; + +/** + * @member {String} foo + */ +HasOnlyReadOnly.prototype['foo'] = undefined; + + + + + + +export default HasOnlyReadOnly; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/List.js b/samples/client/petstore/javascript-promise-es6/src/model/List.js index 67d6d9ef144..d4d342319e7 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/List.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/List.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The List model module. -* @module model/List -* @version 1.0.0 -*/ -export default class List { + * The List model module. + * @module model/List + * @version 1.0.0 + */ +class List { /** - * Constructs a new List. - * @alias module:model/List - * @class - */ - - constructor() { - - - - - - - + * Constructs a new List. + * @alias module:model/List + */ + constructor() { + List.initialize(this); } /** - * Constructs a List from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/List} obj Optional instance to populate. - * @return {module:model/List} The populated List instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a List from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/List} obj Optional instance to populate. + * @return {module:model/List} The populated List instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new List(); - - - - if (data.hasOwnProperty('123-list')) { obj['123-list'] = ApiClient.convertToType(data['123-list'], 'String'); } @@ -63,18 +54,18 @@ export default class List { return obj; } - /** - * @member {String} 123-list - */ - 123-list = undefined; - - - - - - - } +/** + * @member {String} 123-list + */ +List.prototype['123-list'] = undefined; + + + + + + +export default List; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/MapTest.js b/samples/client/petstore/javascript-promise-es6/src/model/MapTest.js index e4be468e253..8cc6640c9d4 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/MapTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/MapTest.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The MapTest model module. -* @module model/MapTest -* @version 1.0.0 -*/ -export default class MapTest { + * The MapTest model module. + * @module model/MapTest + * @version 1.0.0 + */ +class MapTest { /** - * Constructs a new MapTest. - * @alias module:model/MapTest - * @class - */ - - constructor() { - - - - - - - + * Constructs a new MapTest. + * @alias module:model/MapTest + */ + constructor() { + MapTest.initialize(this); } /** - * Constructs a MapTest from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/MapTest} obj Optional instance to populate. - * @return {module:model/MapTest} The populated MapTest instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a MapTest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/MapTest} obj Optional instance to populate. + * @return {module:model/MapTest} The populated MapTest instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new MapTest(); - - - - if (data.hasOwnProperty('map_map_of_string')) { obj['map_map_of_string'] = ApiClient.convertToType(data['map_map_of_string'], {'String': {'String': 'String'}}); } @@ -66,42 +57,44 @@ export default class MapTest { return obj; } - /** - * @member {Object.>} map_map_of_string - */ - map_map_of_string = undefined; - /** - * @member {Object.} map_of_enum_string - */ - map_of_enum_string = undefined; - - - - - - - /** - * Allowed values for the inner property. - * @enum {String} - * @readonly - */ - static InnerEnum = { - - /** - * value: "UPPER" - * @const - */ - "UPPER": "UPPER", - - /** - * value: "lower" - * @const - */ - "lower": "lower" - }; - - } +/** + * @member {Object.>} map_map_of_string + */ +MapTest.prototype['map_map_of_string'] = undefined; + +/** + * @member {Object.} map_of_enum_string + */ +MapTest.prototype['map_of_enum_string'] = undefined; + + + + + +/** + * Allowed values for the inner property. + * @enum {String} + * @readonly + */ +MapTest['InnerEnum'] = { + + /** + * value: "UPPER" + * @const + */ + "UPPER": "UPPER", + + /** + * value: "lower" + * @const + */ + "lower": "lower" +}; + + + +export default MapTest; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index 17ea09bd69a..5568d3a6e96 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; import Animal from './Animal'; - - - - /** -* The MixedPropertiesAndAdditionalPropertiesClass model module. -* @module model/MixedPropertiesAndAdditionalPropertiesClass -* @version 1.0.0 -*/ -export default class MixedPropertiesAndAdditionalPropertiesClass { + * The MixedPropertiesAndAdditionalPropertiesClass model module. + * @module model/MixedPropertiesAndAdditionalPropertiesClass + * @version 1.0.0 + */ +class MixedPropertiesAndAdditionalPropertiesClass { /** - * Constructs a new MixedPropertiesAndAdditionalPropertiesClass. - * @alias module:model/MixedPropertiesAndAdditionalPropertiesClass - * @class - */ - - constructor() { - - - - - - - + * Constructs a new MixedPropertiesAndAdditionalPropertiesClass. + * @alias module:model/MixedPropertiesAndAdditionalPropertiesClass + */ + constructor() { + MixedPropertiesAndAdditionalPropertiesClass.initialize(this); } /** - * Constructs a MixedPropertiesAndAdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/MixedPropertiesAndAdditionalPropertiesClass} obj Optional instance to populate. - * @return {module:model/MixedPropertiesAndAdditionalPropertiesClass} The populated MixedPropertiesAndAdditionalPropertiesClass instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a MixedPropertiesAndAdditionalPropertiesClass from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/MixedPropertiesAndAdditionalPropertiesClass} obj Optional instance to populate. + * @return {module:model/MixedPropertiesAndAdditionalPropertiesClass} The populated MixedPropertiesAndAdditionalPropertiesClass instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new MixedPropertiesAndAdditionalPropertiesClass(); - - - - if (data.hasOwnProperty('uuid')) { obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String'); } @@ -70,26 +61,28 @@ export default class MixedPropertiesAndAdditionalPropertiesClass { return obj; } - /** - * @member {String} uuid - */ - uuid = undefined; - /** - * @member {Date} dateTime - */ - dateTime = undefined; - /** - * @member {Object.} map - */ - map = undefined; - - - - - - - } +/** + * @member {String} uuid + */ +MixedPropertiesAndAdditionalPropertiesClass.prototype['uuid'] = undefined; + +/** + * @member {Date} dateTime + */ +MixedPropertiesAndAdditionalPropertiesClass.prototype['dateTime'] = undefined; + +/** + * @member {Object.} map + */ +MixedPropertiesAndAdditionalPropertiesClass.prototype['map'] = undefined; + + + + + + +export default MixedPropertiesAndAdditionalPropertiesClass; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Model200Response.js b/samples/client/petstore/javascript-promise-es6/src/model/Model200Response.js index 3dbecac1336..629b0f0c75a 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Model200Response.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Model200Response.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Model200Response model module. -* @module model/Model200Response -* @version 1.0.0 -*/ -export default class Model200Response { + * The Model200Response model module. + * @module model/Model200Response + * @version 1.0.0 + */ +class Model200Response { /** - * Constructs a new Model200Response. - * Model for testing model name starting with number - * @alias module:model/Model200Response - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Model200Response. + * Model for testing model name starting with number + * @alias module:model/Model200Response + */ + constructor() { + Model200Response.initialize(this); } /** - * Constructs a Model200Response from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Model200Response} obj Optional instance to populate. - * @return {module:model/Model200Response} The populated Model200Response instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Model200Response from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Model200Response} obj Optional instance to populate. + * @return {module:model/Model200Response} The populated Model200Response instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Model200Response(); - - - - if (data.hasOwnProperty('name')) { obj['name'] = ApiClient.convertToType(data['name'], 'Number'); } @@ -67,22 +58,23 @@ export default class Model200Response { return obj; } - /** - * @member {Number} name - */ - name = undefined; - /** - * @member {String} class - */ - class = undefined; - - - - - - - } +/** + * @member {Number} name + */ +Model200Response.prototype['name'] = undefined; + +/** + * @member {String} class + */ +Model200Response.prototype['class'] = undefined; + + + + + + +export default Model200Response; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ModelReturn.js b/samples/client/petstore/javascript-promise-es6/src/model/ModelReturn.js index 0f287b72281..9ad0c11befc 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ModelReturn.js @@ -11,52 +11,43 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ModelReturn model module. -* @module model/ModelReturn -* @version 1.0.0 -*/ -export default class ModelReturn { + * The ModelReturn model module. + * @module model/ModelReturn + * @version 1.0.0 + */ +class ModelReturn { /** - * Constructs a new ModelReturn. - * Model for testing reserved words - * @alias module:model/ModelReturn - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ModelReturn. + * Model for testing reserved words + * @alias module:model/ModelReturn + */ + constructor() { + ModelReturn.initialize(this); } /** - * Constructs a ModelReturn from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ModelReturn} obj Optional instance to populate. - * @return {module:model/ModelReturn} The populated ModelReturn instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ModelReturn from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ModelReturn} obj Optional instance to populate. + * @return {module:model/ModelReturn} The populated ModelReturn instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ModelReturn(); - - - - if (data.hasOwnProperty('return')) { obj['return'] = ApiClient.convertToType(data['return'], 'Number'); } @@ -64,18 +55,18 @@ export default class ModelReturn { return obj; } - /** - * @member {Number} return - */ - return = undefined; - - - - - - - } +/** + * @member {Number} return + */ +ModelReturn.prototype['return'] = undefined; + + + + + + +export default ModelReturn; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Name.js b/samples/client/petstore/javascript-promise-es6/src/model/Name.js index 0da2f21ca4c..63e7d52e5ff 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Name.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Name.js @@ -11,53 +11,45 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Name model module. -* @module model/Name -* @version 1.0.0 -*/ -export default class Name { + * The Name model module. + * @module model/Name + * @version 1.0.0 + */ +class Name { /** - * Constructs a new Name. - * Model for testing model name same as property name - * @alias module:model/Name - * @class - * @param name {Number} - */ - - constructor(name) { - - - - - - this['name'] = name; - + * Constructs a new Name. + * Model for testing model name same as property name + * @alias module:model/Name + * @param name {Number} + */ + constructor(name) { + Name.initialize(this, name); } /** - * Constructs a Name from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Name} obj Optional instance to populate. - * @return {module:model/Name} The populated Name instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, name) { + obj['name'] = name; + } + + /** + * Constructs a Name from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Name} obj Optional instance to populate. + * @return {module:model/Name} The populated Name instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Name(); - - - - if (data.hasOwnProperty('name')) { obj['name'] = ApiClient.convertToType(data['name'], 'Number'); } @@ -74,30 +66,33 @@ export default class Name { return obj; } - /** - * @member {Number} name - */ - name = undefined; - /** - * @member {Number} snake_case - */ - snake_case = undefined; - /** - * @member {String} property - */ - property = undefined; - /** - * @member {Number} 123Number - */ - 123Number = undefined; - - - - - - - } +/** + * @member {Number} name + */ +Name.prototype['name'] = undefined; + +/** + * @member {Number} snake_case + */ +Name.prototype['snake_case'] = undefined; + +/** + * @member {String} property + */ +Name.prototype['property'] = undefined; + +/** + * @member {Number} 123Number + */ +Name.prototype['123Number'] = undefined; + + + + + + +export default Name; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/NumberOnly.js b/samples/client/petstore/javascript-promise-es6/src/model/NumberOnly.js index e1f7978f7f6..ec5ad812b40 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/NumberOnly.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The NumberOnly model module. -* @module model/NumberOnly -* @version 1.0.0 -*/ -export default class NumberOnly { + * The NumberOnly model module. + * @module model/NumberOnly + * @version 1.0.0 + */ +class NumberOnly { /** - * Constructs a new NumberOnly. - * @alias module:model/NumberOnly - * @class - */ - - constructor() { - - - - - - - + * Constructs a new NumberOnly. + * @alias module:model/NumberOnly + */ + constructor() { + NumberOnly.initialize(this); } /** - * Constructs a NumberOnly from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/NumberOnly} obj Optional instance to populate. - * @return {module:model/NumberOnly} The populated NumberOnly instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a NumberOnly from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/NumberOnly} obj Optional instance to populate. + * @return {module:model/NumberOnly} The populated NumberOnly instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new NumberOnly(); - - - - if (data.hasOwnProperty('JustNumber')) { obj['JustNumber'] = ApiClient.convertToType(data['JustNumber'], 'Number'); } @@ -63,18 +54,18 @@ export default class NumberOnly { return obj; } - /** - * @member {Number} JustNumber - */ - JustNumber = undefined; - - - - - - - } +/** + * @member {Number} JustNumber + */ +NumberOnly.prototype['JustNumber'] = undefined; + + + + + + +export default NumberOnly; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Order.js b/samples/client/petstore/javascript-promise-es6/src/model/Order.js index fb8bdd4ab9f..8c07a5cd0f3 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Order.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Order.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Order model module. -* @module model/Order -* @version 1.0.0 -*/ -export default class Order { + * The Order model module. + * @module model/Order + * @version 1.0.0 + */ +class Order { /** - * Constructs a new Order. - * @alias module:model/Order - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Order. + * @alias module:model/Order + */ + constructor() { + Order.initialize(this); } /** - * Constructs a Order from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Order} obj Optional instance to populate. - * @return {module:model/Order} The populated Order instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Order from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Order} obj Optional instance to populate. + * @return {module:model/Order} The populated Order instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Order(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -78,66 +69,72 @@ export default class Order { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {Number} petId - */ - petId = undefined; - /** - * @member {Number} quantity - */ - quantity = undefined; - /** - * @member {Date} shipDate - */ - shipDate = undefined; - /** - * Order Status - * @member {module:model/Order.StatusEnum} status - */ - status = undefined; - /** - * @member {Boolean} complete - * @default false - */ - complete = false; - - - - - - - /** - * Allowed values for the status property. - * @enum {String} - * @readonly - */ - static StatusEnum = { - - /** - * value: "placed" - * @const - */ - "placed": "placed", - - /** - * value: "approved" - * @const - */ - "approved": "approved", - - /** - * value: "delivered" - * @const - */ - "delivered": "delivered" - }; - - } +/** + * @member {Number} id + */ +Order.prototype['id'] = undefined; + +/** + * @member {Number} petId + */ +Order.prototype['petId'] = undefined; + +/** + * @member {Number} quantity + */ +Order.prototype['quantity'] = undefined; + +/** + * @member {Date} shipDate + */ +Order.prototype['shipDate'] = undefined; + +/** + * Order Status + * @member {module:model/Order.StatusEnum} status + */ +Order.prototype['status'] = undefined; + +/** + * @member {Boolean} complete + * @default false + */ +Order.prototype['complete'] = false; + + + + + +/** + * Allowed values for the status property. + * @enum {String} + * @readonly + */ +Order['StatusEnum'] = { + + /** + * value: "placed" + * @const + */ + "placed": "placed", + + /** + * value: "approved" + * @const + */ + "approved": "approved", + + /** + * value: "delivered" + * @const + */ + "delivered": "delivered" +}; + + + +export default Order; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterBoolean.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterBoolean.js deleted file mode 100644 index 592a0b69864..00000000000 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterBoolean.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - */ - - -import ApiClient from '../ApiClient'; - - - - - -/** -* The OuterBoolean model module. -* @module model/OuterBoolean -* @version 1.0.0 -*/ -export default class OuterBoolean { - /** - * Constructs a new OuterBoolean. - * @alias module:model/OuterBoolean - * @class - */ - - constructor() { - - - - - - - - - } - - /** - * Constructs a OuterBoolean from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/OuterBoolean} obj Optional instance to populate. - * @return {module:model/OuterBoolean} The populated OuterBoolean instance. - */ - static constructFromObject(data, obj) { - if (data) { - obj = obj || new OuterBoolean(); - - - - - - } - return obj; - } - - - - - - - - - -} - - diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterComposite.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterComposite.js index ebacb2837d8..8b61cb8f654 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/OuterComposite.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The OuterComposite model module. -* @module model/OuterComposite -* @version 1.0.0 -*/ -export default class OuterComposite { + * The OuterComposite model module. + * @module model/OuterComposite + * @version 1.0.0 + */ +class OuterComposite { /** - * Constructs a new OuterComposite. - * @alias module:model/OuterComposite - * @class - */ - - constructor() { - - - - - - - + * Constructs a new OuterComposite. + * @alias module:model/OuterComposite + */ + constructor() { + OuterComposite.initialize(this); } /** - * Constructs a OuterComposite from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/OuterComposite} obj Optional instance to populate. - * @return {module:model/OuterComposite} The populated OuterComposite instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a OuterComposite from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/OuterComposite} obj Optional instance to populate. + * @return {module:model/OuterComposite} The populated OuterComposite instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new OuterComposite(); - - - - if (data.hasOwnProperty('my_number')) { obj['my_number'] = 'Number'.constructFromObject(data['my_number']); } @@ -69,26 +60,28 @@ export default class OuterComposite { return obj; } - /** - * @member {Number} my_number - */ - my_number = undefined; - /** - * @member {String} my_string - */ - my_string = undefined; - /** - * @member {Boolean} my_boolean - */ - my_boolean = undefined; - - - - - - - } +/** + * @member {Number} my_number + */ +OuterComposite.prototype['my_number'] = undefined; + +/** + * @member {String} my_string + */ +OuterComposite.prototype['my_string'] = undefined; + +/** + * @member {Boolean} my_boolean + */ +OuterComposite.prototype['my_boolean'] = undefined; + + + + + + +export default OuterComposite; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterEnum.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterEnum.js index a31e00b729d..0404b03b061 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/OuterEnum.js @@ -11,10 +11,7 @@ * */ - import ApiClient from '../ApiClient'; - - /** * Enum class OuterEnum. * @enum {} @@ -26,21 +23,21 @@ export default class OuterEnum { * value: "placed" * @const */ - placed = "placed"; + "placed" = "placed"; /** * value: "approved" * @const */ - approved = "approved"; + "approved" = "approved"; /** * value: "delivered" * @const */ - delivered = "delivered"; + "delivered" = "delivered"; @@ -54,4 +51,3 @@ export default class OuterEnum { } } - diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterNumber.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterNumber.js deleted file mode 100644 index ff65b1588b7..00000000000 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterNumber.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - */ - - -import ApiClient from '../ApiClient'; - - - - - -/** -* The OuterNumber model module. -* @module model/OuterNumber -* @version 1.0.0 -*/ -export default class OuterNumber { - /** - * Constructs a new OuterNumber. - * @alias module:model/OuterNumber - * @class - */ - - constructor() { - - - - - - - - - } - - /** - * Constructs a OuterNumber from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/OuterNumber} obj Optional instance to populate. - * @return {module:model/OuterNumber} The populated OuterNumber instance. - */ - static constructFromObject(data, obj) { - if (data) { - obj = obj || new OuterNumber(); - - - - - - } - return obj; - } - - - - - - - - - -} - - diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterString.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterString.js deleted file mode 100644 index 6921029ede1..00000000000 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterString.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - */ - - -import ApiClient from '../ApiClient'; - - - - - -/** -* The OuterString model module. -* @module model/OuterString -* @version 1.0.0 -*/ -export default class OuterString { - /** - * Constructs a new OuterString. - * @alias module:model/OuterString - * @class - */ - - constructor() { - - - - - - - - - } - - /** - * Constructs a OuterString from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/OuterString} obj Optional instance to populate. - * @return {module:model/OuterString} The populated OuterString instance. - */ - static constructFromObject(data, obj) { - if (data) { - obj = obj || new OuterString(); - - - - - - } - return obj; - } - - - - - - - - - -} - - diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Pet.js b/samples/client/petstore/javascript-promise-es6/src/model/Pet.js index 4edbd6e3d75..37b987fdf81 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Pet.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Pet.js @@ -11,55 +11,48 @@ * */ - import ApiClient from '../ApiClient'; import Category from './Category'; import Tag from './Tag'; - - - - /** -* The Pet model module. -* @module model/Pet -* @version 1.0.0 -*/ -export default class Pet { + * The Pet model module. + * @module model/Pet + * @version 1.0.0 + */ +class Pet { /** - * Constructs a new Pet. - * @alias module:model/Pet - * @class - * @param name {String} - * @param photoUrls {Array.} - */ - - constructor(name, photoUrls) { - - - - - - this['name'] = name;this['photoUrls'] = photoUrls; - + * Constructs a new Pet. + * @alias module:model/Pet + * @param name {String} + * @param photoUrls {Array.} + */ + constructor(name, photoUrls) { + Pet.initialize(this, name, photoUrls); } /** - * Constructs a Pet from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Pet} obj Optional instance to populate. - * @return {module:model/Pet} The populated Pet instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, name, photoUrls) { + obj['name'] = name; + obj['photoUrls'] = photoUrls; + } + + /** + * Constructs a Pet from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Pet} obj Optional instance to populate. + * @return {module:model/Pet} The populated Pet instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Pet(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -82,65 +75,71 @@ export default class Pet { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {module:model/Category} category - */ - category = undefined; - /** - * @member {String} name - */ - name = undefined; - /** - * @member {Array.} photoUrls - */ - photoUrls = undefined; - /** - * @member {Array.} tags - */ - tags = undefined; - /** - * pet status in the store - * @member {module:model/Pet.StatusEnum} status - */ - status = undefined; - - - - - - - /** - * Allowed values for the status property. - * @enum {String} - * @readonly - */ - static StatusEnum = { - - /** - * value: "available" - * @const - */ - "available": "available", - - /** - * value: "pending" - * @const - */ - "pending": "pending", - - /** - * value: "sold" - * @const - */ - "sold": "sold" - }; - - } +/** + * @member {Number} id + */ +Pet.prototype['id'] = undefined; + +/** + * @member {module:model/Category} category + */ +Pet.prototype['category'] = undefined; + +/** + * @member {String} name + */ +Pet.prototype['name'] = undefined; + +/** + * @member {Array.} photoUrls + */ +Pet.prototype['photoUrls'] = undefined; + +/** + * @member {Array.} tags + */ +Pet.prototype['tags'] = undefined; + +/** + * pet status in the store + * @member {module:model/Pet.StatusEnum} status + */ +Pet.prototype['status'] = undefined; + + + + + +/** + * Allowed values for the status property. + * @enum {String} + * @readonly + */ +Pet['StatusEnum'] = { + + /** + * value: "available" + * @const + */ + "available": "available", + + /** + * value: "pending" + * @const + */ + "pending": "pending", + + /** + * value: "sold" + * @const + */ + "sold": "sold" +}; + + + +export default Pet; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript-promise-es6/src/model/ReadOnlyFirst.js index 5aee0fce320..289277c191d 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ReadOnlyFirst.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The ReadOnlyFirst model module. -* @module model/ReadOnlyFirst -* @version 1.0.0 -*/ -export default class ReadOnlyFirst { + * The ReadOnlyFirst model module. + * @module model/ReadOnlyFirst + * @version 1.0.0 + */ +class ReadOnlyFirst { /** - * Constructs a new ReadOnlyFirst. - * @alias module:model/ReadOnlyFirst - * @class - */ - - constructor() { - - - - - - - + * Constructs a new ReadOnlyFirst. + * @alias module:model/ReadOnlyFirst + */ + constructor() { + ReadOnlyFirst.initialize(this); } /** - * Constructs a ReadOnlyFirst from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/ReadOnlyFirst} obj Optional instance to populate. - * @return {module:model/ReadOnlyFirst} The populated ReadOnlyFirst instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ReadOnlyFirst from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ReadOnlyFirst} obj Optional instance to populate. + * @return {module:model/ReadOnlyFirst} The populated ReadOnlyFirst instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new ReadOnlyFirst(); - - - - if (data.hasOwnProperty('bar')) { obj['bar'] = ApiClient.convertToType(data['bar'], 'String'); } @@ -66,22 +57,23 @@ export default class ReadOnlyFirst { return obj; } - /** - * @member {String} bar - */ - bar = undefined; - /** - * @member {String} baz - */ - baz = undefined; - - - - - - - } +/** + * @member {String} bar + */ +ReadOnlyFirst.prototype['bar'] = undefined; + +/** + * @member {String} baz + */ +ReadOnlyFirst.prototype['baz'] = undefined; + + + + + + +export default ReadOnlyFirst; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/SpecialModelName.js b/samples/client/petstore/javascript-promise-es6/src/model/SpecialModelName.js index c00da7303e9..be9f36a855f 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/SpecialModelName.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The SpecialModelName model module. -* @module model/SpecialModelName -* @version 1.0.0 -*/ -export default class SpecialModelName { + * The SpecialModelName model module. + * @module model/SpecialModelName + * @version 1.0.0 + */ +class SpecialModelName { /** - * Constructs a new SpecialModelName. - * @alias module:model/SpecialModelName - * @class - */ - - constructor() { - - - - - - - + * Constructs a new SpecialModelName. + * @alias module:model/SpecialModelName + */ + constructor() { + SpecialModelName.initialize(this); } /** - * Constructs a SpecialModelName from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/SpecialModelName} obj Optional instance to populate. - * @return {module:model/SpecialModelName} The populated SpecialModelName instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a SpecialModelName from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/SpecialModelName} obj Optional instance to populate. + * @return {module:model/SpecialModelName} The populated SpecialModelName instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new SpecialModelName(); - - - - if (data.hasOwnProperty('$special[property.name]')) { obj['$special[property.name]'] = ApiClient.convertToType(data['$special[property.name]'], 'Number'); } @@ -63,18 +54,18 @@ export default class SpecialModelName { return obj; } - /** - * @member {Number} $special[property.name] - */ - $special[property.name] = undefined; - - - - - - - } +/** + * @member {Number} $special[property.name] + */ +SpecialModelName.prototype['$special[property.name]'] = undefined; + + + + + + +export default SpecialModelName; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Tag.js b/samples/client/petstore/javascript-promise-es6/src/model/Tag.js index 994da23e2a7..0d39a36833a 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Tag.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Tag.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The Tag model module. -* @module model/Tag -* @version 1.0.0 -*/ -export default class Tag { + * The Tag model module. + * @module model/Tag + * @version 1.0.0 + */ +class Tag { /** - * Constructs a new Tag. - * @alias module:model/Tag - * @class - */ - - constructor() { - - - - - - - + * Constructs a new Tag. + * @alias module:model/Tag + */ + constructor() { + Tag.initialize(this); } /** - * Constructs a Tag from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/Tag} obj Optional instance to populate. - * @return {module:model/Tag} The populated Tag instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a Tag from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/Tag} obj Optional instance to populate. + * @return {module:model/Tag} The populated Tag instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new Tag(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -66,22 +57,23 @@ export default class Tag { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {String} name - */ - name = undefined; - - - - - - - } +/** + * @member {Number} id + */ +Tag.prototype['id'] = undefined; + +/** + * @member {String} name + */ +Tag.prototype['name'] = undefined; + + + + + + +export default Tag; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/User.js b/samples/client/petstore/javascript-promise-es6/src/model/User.js index c0f5ef56e6f..7f8e2848e18 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/User.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/User.js @@ -11,51 +11,42 @@ * */ - import ApiClient from '../ApiClient'; - - - - /** -* The User model module. -* @module model/User -* @version 1.0.0 -*/ -export default class User { + * The User model module. + * @module model/User + * @version 1.0.0 + */ +class User { /** - * Constructs a new User. - * @alias module:model/User - * @class - */ - - constructor() { - - - - - - - + * Constructs a new User. + * @alias module:model/User + */ + constructor() { + User.initialize(this); } /** - * Constructs a User from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:model/User} obj Optional instance to populate. - * @return {module:model/User} The populated User instance. - */ + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a User from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/User} obj Optional instance to populate. + * @return {module:model/User} The populated User instance. + */ static constructFromObject(data, obj) { if (data) { obj = obj || new User(); - - - - if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } @@ -84,47 +75,54 @@ export default class User { return obj; } - /** - * @member {Number} id - */ - id = undefined; - /** - * @member {String} username - */ - username = undefined; - /** - * @member {String} firstName - */ - firstName = undefined; - /** - * @member {String} lastName - */ - lastName = undefined; - /** - * @member {String} email - */ - email = undefined; - /** - * @member {String} password - */ - password = undefined; - /** - * @member {String} phone - */ - phone = undefined; - /** - * User Status - * @member {Number} userStatus - */ - userStatus = undefined; - - - - - - - } +/** + * @member {Number} id + */ +User.prototype['id'] = undefined; + +/** + * @member {String} username + */ +User.prototype['username'] = undefined; + +/** + * @member {String} firstName + */ +User.prototype['firstName'] = undefined; + +/** + * @member {String} lastName + */ +User.prototype['lastName'] = undefined; + +/** + * @member {String} email + */ +User.prototype['email'] = undefined; + +/** + * @member {String} password + */ +User.prototype['password'] = undefined; + +/** + * @member {String} phone + */ +User.prototype['phone'] = undefined; + +/** + * User Status + * @member {Number} userStatus + */ +User.prototype['userStatus'] = undefined; + + + + + + +export default User; diff --git a/samples/client/petstore/javascript-promise-es6/test/ApiClientTest.js b/samples/client/petstore/javascript-promise-es6/test/ApiClientTest.js new file mode 100644 index 00000000000..5e98b685a91 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/test/ApiClientTest.js @@ -0,0 +1,393 @@ +if (typeof module === 'object' && module.exports) { + var expect = require('expect.js'); + var SwaggerPetstore = require('../src/index'); + var sinon = require('sinon'); +} + +var apiClient = SwaggerPetstore.ApiClient.instance; + +describe('ApiClient', function() { + describe('defaults', function() { + it('should have correct default values with the default API client', function() { + expect(apiClient).to.be.ok(); + expect(apiClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(apiClient.authentications).to.eql({ + petstore_auth: {type: 'oauth2'}, + http_basic_test: {type: 'basic'}, + api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'}, + api_key_query: {type: 'apiKey', 'in': 'query', name: 'api_key_query'}, + /* comment out the following as these fake security def (testing purpose) + * are removed from the spec, we'll add these back after updating the + * petstore server + * + test_http_basic: {type: 'basic'}, + test_api_client_id: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_id' + }, + test_api_client_secret: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_secret' + }, + test_api_key_query: { + type: 'apiKey', + 'in': 'query', + name: 'test_api_key_query' + }, + test_api_key_header: { + type: 'apiKey', + 'in': 'header', + name: 'test_api_key_header' + }*/ + }); + }); + + it('should have correct default values with new API client and can customize it', function() { + var newClient = new SwaggerPetstore.ApiClient; + expect(newClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(newClient.buildUrl('/abc', {})).to.be('http://petstore.swagger.io:80/v2/abc'); + + newClient.basePath = 'http://example.com'; + expect(newClient.basePath).to.be('http://example.com'); + expect(newClient.buildUrl('/abc', {})).to.be('http://example.com/abc'); + }); + }); + + describe('#paramToString', function() { + it('should return empty string for null and undefined', function() { + expect(apiClient.paramToString(null)).to.be(''); + expect(apiClient.paramToString(undefined)).to.be(''); + }); + + it('should return string', function() { + expect(apiClient.paramToString('')).to.be(''); + expect(apiClient.paramToString('abc')).to.be('abc'); + expect(apiClient.paramToString(123)).to.be('123'); + }); + }); + + describe('#buildCollectionParam', function() { + var param; + + beforeEach(function() { + param = ['aa', 'bb', 123]; + }); + + it('works for csv', function() { + expect(apiClient.buildCollectionParam(param, 'csv')).to.be('aa,bb,123'); + }); + + it('works for ssv', function() { + expect(apiClient.buildCollectionParam(param, 'ssv')).to.be('aa bb 123'); + }); + + it('works for tsv', function() { + expect(apiClient.buildCollectionParam(param, 'tsv')).to.be('aa\tbb\t123'); + }); + + it('works for pipes', function() { + expect(apiClient.buildCollectionParam(param, 'pipes')).to.be('aa|bb|123'); + }); + + it('works for multi', function() { + expect(apiClient.buildCollectionParam(param, 'multi')).to.eql(['aa', 'bb', '123']); + }); + + it('fails for invalid collection format', function() { + expect(function() { apiClient.buildCollectionParam(param, 'INVALID'); }).to.throwError(); + }); + }); + + describe('#buildUrl', function() { + it('should work without path parameters in the path', function() { + expect(apiClient.buildUrl('/abc', {})).to + .be('http://petstore.swagger.io:80/v2/abc'); + expect(apiClient.buildUrl('/abc/def?ok', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/abc/def?ok'); + }); + + it('should work with path parameters in the path', function() { + expect(apiClient.buildUrl('/{id}', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/123'); + expect(apiClient.buildUrl('/abc/{id}/{name}?ok', {id: 456, name: 'a b'})).to. + be('http://petstore.swagger.io:80/v2/abc/456/a%20b?ok'); + }); + }); + + describe('#isJsonMime', function() { + it('should return true for JSON MIME', function() { + expect(apiClient.isJsonMime('application/json')).to.be(true); + expect(apiClient.isJsonMime('application/json; charset=UTF8')).to.be(true); + expect(apiClient.isJsonMime('APPLICATION/JSON')).to.be(true); + }); + + it('should return false for non-JSON MIME', function() { + expect(apiClient.isJsonMime('')).to.be(false); + expect(apiClient.isJsonMime('text/plain')).to.be(false); + expect(apiClient.isJsonMime('application/xml')).to.be(false); + expect(apiClient.isJsonMime('application/jsonp')).to.be(false); + }); + }); + + describe('#applyAuthToRequest', function() { + var req, newClient; + + beforeEach(function() { + req = { + auth: function() {}, + set: function() {}, + query: function() {} + }; + sinon.stub(req, 'auth'); + sinon.stub(req, 'set'); + sinon.stub(req, 'query'); + newClient = new SwaggerPetstore.ApiClient(); + }); + + describe('basic', function() { + var authName = 'testBasicAuth'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'basic'}; + auth = newClient.authentications[authName]; + }); + + it('sets auth header with username and password set', function() { + auth.username = 'user'; + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjpwYXNz' is base64-encoded string of 'user:pass' + sinon.assert.calledWithMatch(req.auth, 'user', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only username set', function() { + auth.username = 'user'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjo=' is base64-encoded string of 'user:' + sinon.assert.calledWithMatch(req.auth, 'user', ''); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only password set', function() { + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'OnBhc3M=' is base64-encoded string of ':pass' + sinon.assert.calledWithMatch(req.auth, '', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('does not set header when username and password are not set', function() { + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + }); + + describe('apiKey', function() { + var authName = 'testApiKey'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'apiKey', name: 'api_key'}; + auth = newClient.authentications[authName]; + }); + + it('sets api key in header', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('sets api key in query', function() { + auth.in = 'query'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + + it('sets api key in header with prefix', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + auth.apiKeyPrefix = 'Key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'Key my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when api key is not set', function() { + auth.in = 'query'; + auth.apiKey = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('oauth2', function() { + var authName = 'testOAuth2'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'oauth2'}; + auth = newClient.authentications[authName]; + }); + + it('sets access token in header', function() { + auth.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when access token is not set', function() { + auth.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('apiKey and oauth2', function() { + var apiKeyAuthName = 'testApiKey'; + var oauth2Name = 'testOAuth2'; + var authNames = [apiKeyAuthName, oauth2Name]; + var apiKeyAuth, oauth2; + + beforeEach(function() { + newClient.authentications[apiKeyAuthName] = {type: 'apiKey', name: 'api_key', 'in': 'query'}; + newClient.authentications[oauth2Name] = {type: 'oauth2'}; + apiKeyAuth = newClient.authentications[apiKeyAuthName]; + oauth2 = newClient.authentications[oauth2Name]; + }); + + it('works when setting both api key and access token', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + }); + + it('works when setting only api key', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + }); + + it('works when neither api key nor access token is set', function() { + apiKeyAuth.apiKey = null; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('unknown type', function() { + var authName = 'unknown'; + var authNames = [authName]; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'UNKNOWN'}; + }); + + it('throws error for unknown auth type', function() { + expect(function() { + newClient.applyAuthToRequest(req, authNames); + }).to.throwError(); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + }); + }); + + /* + describe('#defaultHeaders', function() { + it('should initialize default headers to be an empty object', function() { + expect(apiClient.defaultHeaders).to.eql({}); + }); + + it('should put default headers in request', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var expected = {'Content-Type': 'text/plain', 'api_key': 'special-key'}; + expect(newClient.defaultHeaders).to.eql(expected); + var req = makeDumbRequest(newClient); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + + it('should override default headers with provided header params', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var headerParams = {'Content-Type': 'application/json', 'Authorization': 'Bearer test-token'} + var expected = { + 'Content-Type': 'application/json', + 'api_key': 'special-key', + 'Authorization': 'Bearer test-token' + }; + var req = makeDumbRequest(newClient, {headerParams: headerParams}); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + }); +*/ + +}); + +function makeDumbRequest(apiClient, opts) { + opts = opts || {}; + var path = opts.path || '/store/inventory'; + var httpMethod = opts.httpMethod || 'GET'; + var pathParams = opts.pathParams || {}; + var queryParams = opts.queryParams || {}; + var headerParams = opts.headerParams || {}; + var formParams = opts.formParams || {}; + var bodyParam = opts.bodyParam; + var authNames = []; + var contentTypes = opts.contentTypes || []; + var accepts = opts.accepts || []; + var callback = opts.callback; + return apiClient.callApi(path, httpMethod, pathParams, queryParams, + headerParams, formParams, bodyParam, authNames, contentTypes, accepts); +} diff --git a/samples/client/petstore/javascript-promise-es6/test/model/OuterBoolean.spec.js b/samples/client/petstore/javascript-promise-es6/test/model/OuterBoolean.spec.js index 7560cff154b..400fbecfb13 100644 --- a/samples/client/petstore/javascript-promise-es6/test/model/OuterBoolean.spec.js +++ b/samples/client/petstore/javascript-promise-es6/test/model/OuterBoolean.spec.js @@ -31,7 +31,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterBoolean(); + // OuterBoolean is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterBoolean(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-promise-es6/test/model/OuterNumber.spec.js b/samples/client/petstore/javascript-promise-es6/test/model/OuterNumber.spec.js index 4dbe9d889bb..9cf8d6ac4b8 100644 --- a/samples/client/petstore/javascript-promise-es6/test/model/OuterNumber.spec.js +++ b/samples/client/petstore/javascript-promise-es6/test/model/OuterNumber.spec.js @@ -31,7 +31,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterNumber(); + // OuterNumber is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterNumber(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-promise-es6/test/model/OuterString.spec.js b/samples/client/petstore/javascript-promise-es6/test/model/OuterString.spec.js index d0f6a8fbd9d..93f6e8e4cab 100644 --- a/samples/client/petstore/javascript-promise-es6/test/model/OuterString.spec.js +++ b/samples/client/petstore/javascript-promise-es6/test/model/OuterString.spec.js @@ -31,7 +31,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterString(); + // OuterString is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterString(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-promise/pom.xml b/samples/client/petstore/javascript-promise/pom.xml index d77a24fcd75..7aa5b80ba8c 100644 --- a/samples/client/petstore/javascript-promise/pom.xml +++ b/samples/client/petstore/javascript-promise/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - io.swagger - swagger-petstore-javascript-promise + org.openapitools + openapi-petstore-javascript-promise pom 1.0-SNAPSHOT - Swagger Petstore - Javascript Client (Promise version) + OpenAPI Petstore JS Client (Promise) diff --git a/samples/client/petstore/javascript-promise/src/api/FakeApi.js b/samples/client/petstore/javascript-promise/src/api/FakeApi.js index 7144e267fde..8b07f17c78f 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -73,7 +73,7 @@ var authNames = []; var contentTypes = []; var accepts = ['*/*']; - var returnType = Boolean; + var returnType = 'Boolean'; return this.apiClient.callApi( '/fake/outer/boolean', 'POST', @@ -169,7 +169,7 @@ var authNames = []; var contentTypes = []; var accepts = ['*/*']; - var returnType = Number; + var returnType = 'Number'; return this.apiClient.callApi( '/fake/outer/number', 'POST', @@ -217,7 +217,7 @@ var authNames = []; var contentTypes = []; var accepts = ['*/*']; - var returnType = String; + var returnType = 'String'; return this.apiClient.callApi( '/fake/outer/string', 'POST', diff --git a/samples/client/petstore/javascript-promise/src/api/StoreApi.js b/samples/client/petstore/javascript-promise/src/api/StoreApi.js index 08268a9849c..c4b2f93bbc0 100644 --- a/samples/client/petstore/javascript-promise/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise/src/api/StoreApi.js @@ -124,7 +124,7 @@ var authNames = ['api_key']; var contentTypes = []; var accepts = ['application/json']; - var returnType = {String: Number}; + var returnType = {'String': 'Number'}; return this.apiClient.callApi( '/store/inventory', 'GET', diff --git a/samples/client/petstore/javascript-promise/src/api/UserApi.js b/samples/client/petstore/javascript-promise/src/api/UserApi.js index babd9e513c6..4942cbc464b 100644 --- a/samples/client/petstore/javascript-promise/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise/src/api/UserApi.js @@ -340,7 +340,7 @@ var authNames = []; var contentTypes = []; var accepts = ['application/xml', 'application/json']; - var returnType = String; + var returnType = 'String'; return this.apiClient.callApi( '/user/login', 'GET', diff --git a/samples/client/petstore/javascript-promise/test/ApiClientTest.js b/samples/client/petstore/javascript-promise/test/ApiClientTest.js index b58a27a025b..5e98b685a91 100644 --- a/samples/client/petstore/javascript-promise/test/ApiClientTest.js +++ b/samples/client/petstore/javascript-promise/test/ApiClientTest.js @@ -14,7 +14,8 @@ describe('ApiClient', function() { expect(apiClient.authentications).to.eql({ petstore_auth: {type: 'oauth2'}, http_basic_test: {type: 'basic'}, - api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'} + api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'}, + api_key_query: {type: 'apiKey', 'in': 'query', name: 'api_key_query'}, /* comment out the following as these fake security def (testing purpose) * are removed from the spec, we'll add these back after updating the * petstore server diff --git a/samples/client/petstore/javascript-promise/test/model/OuterBoolean.spec.js b/samples/client/petstore/javascript-promise/test/model/OuterBoolean.spec.js index d5495a638d8..765f758cd09 100644 --- a/samples/client/petstore/javascript-promise/test/model/OuterBoolean.spec.js +++ b/samples/client/petstore/javascript-promise/test/model/OuterBoolean.spec.js @@ -28,7 +28,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterBoolean(); + // OuterBoolean is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterBoolean(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-promise/test/model/OuterNumber.spec.js b/samples/client/petstore/javascript-promise/test/model/OuterNumber.spec.js index 7b0e4ebf119..2466fbe6dc9 100644 --- a/samples/client/petstore/javascript-promise/test/model/OuterNumber.spec.js +++ b/samples/client/petstore/javascript-promise/test/model/OuterNumber.spec.js @@ -28,7 +28,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterNumber(); + // OuterNumber is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterNumber(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript-promise/test/model/OuterString.spec.js b/samples/client/petstore/javascript-promise/test/model/OuterString.spec.js index 4e7f99ca88d..46d6c579bc9 100644 --- a/samples/client/petstore/javascript-promise/test/model/OuterString.spec.js +++ b/samples/client/petstore/javascript-promise/test/model/OuterString.spec.js @@ -28,7 +28,8 @@ var instance; beforeEach(function() { - instance = new SwaggerPetstore.OuterString(); + // OuterString is not a member of SwaggerPetstore + //instance = new SwaggerPetstore.OuterString(); }); var getProperty = function(object, getter, property) { diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index e36feba7bd5..71cb70f8be7 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -81,7 +81,7 @@ var authNames = []; var contentTypes = []; var accepts = ['*/*']; - var returnType = Boolean; + var returnType = 'Boolean'; return this.apiClient.callApi( '/fake/outer/boolean', 'POST', @@ -167,7 +167,7 @@ var authNames = []; var contentTypes = []; var accepts = ['*/*']; - var returnType = Number; + var returnType = 'Number'; return this.apiClient.callApi( '/fake/outer/number', 'POST', @@ -210,7 +210,7 @@ var authNames = []; var contentTypes = []; var accepts = ['*/*']; - var returnType = String; + var returnType = 'String'; return this.apiClient.callApi( '/fake/outer/string', 'POST', diff --git a/samples/client/petstore/javascript/src/api/StoreApi.js b/samples/client/petstore/javascript/src/api/StoreApi.js index f09beb807df..ba2c675ec77 100644 --- a/samples/client/petstore/javascript/src/api/StoreApi.js +++ b/samples/client/petstore/javascript/src/api/StoreApi.js @@ -126,7 +126,7 @@ var authNames = ['api_key']; var contentTypes = []; var accepts = ['application/json']; - var returnType = {String: Number}; + var returnType = {'String': 'Number'}; return this.apiClient.callApi( '/store/inventory', 'GET', diff --git a/samples/client/petstore/javascript/src/api/UserApi.js b/samples/client/petstore/javascript/src/api/UserApi.js index 319572cf2a6..d3e3b8513c5 100644 --- a/samples/client/petstore/javascript/src/api/UserApi.js +++ b/samples/client/petstore/javascript/src/api/UserApi.js @@ -322,7 +322,7 @@ var authNames = []; var contentTypes = []; var accepts = ['application/xml', 'application/json']; - var returnType = String; + var returnType = 'String'; return this.apiClient.callApi( '/user/login', 'GET', From 86a82d103e9a514aef17774f14f0d14c18a65425 Mon Sep 17 00:00:00 2001 From: "shigeru.nakajima" Date: Sun, 17 Jun 2018 13:44:25 +0900 Subject: [PATCH 05/35] Eliminate MySQL dependency of Rails 5 stub server (#279) * [rails] In order to set up the Ruby on Rails stub server easily, remove the dependency on MySQL * [rails] Update sample codes of Ruby on Rails stub server --- .../src/main/resources/rails5/Gemfile | 4 +- .../src/main/resources/rails5/database.yml | 60 +++++-------------- .../rails5/.openapi-generator/VERSION | 2 +- samples/server/petstore/rails5/Gemfile | 4 +- .../petstore/rails5/config/database.yml | 60 +++++-------------- 5 files changed, 33 insertions(+), 97 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/rails5/Gemfile b/modules/openapi-generator/src/main/resources/rails5/Gemfile index a46942406d1..1fddd01a429 100644 --- a/modules/openapi-generator/src/main/resources/rails5/Gemfile +++ b/modules/openapi-generator/src/main/resources/rails5/Gemfile @@ -3,8 +3,8 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.0.0' -# Use mysql as the database for Active Record -gem 'mysql2', '>= 0.3.18', '< 0.5' +# Use sqlite as the database for Active Record +gem 'sqlite3', '~> 1.3' # Use Puma as the app server gem 'puma', '~> 3.0' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder diff --git a/modules/openapi-generator/src/main/resources/rails5/database.yml b/modules/openapi-generator/src/main/resources/rails5/database.yml index e536d9f37dc..025d62a8d81 100644 --- a/modules/openapi-generator/src/main/resources/rails5/database.yml +++ b/modules/openapi-generator/src/main/resources/rails5/database.yml @@ -1,54 +1,22 @@ -# MySQL. Versions 5.0 and up are supported. -# -# Install the MySQL driver -# gem install mysql2 -# -# Ensure the MySQL gem is defined in your Gemfile -# gem 'mysql2' -# -# And be sure to use new-style password hashing: -# http://dev.mysql.com/doc/refman/5.7/en/old-client.html -# -default: &default - adapter: mysql2 - encoding: utf8 - pool: 5 - username: root - password: - socket: /tmp/mysql.sock - +# SQLite version 3.x +# gem install sqlite3-ruby (not necessary on OS X Leopard) development: - <<: *default - database: api_demo_development + adapter: sqlite3 + database: db/development.sqlite3 + pool: 5 + timeout: 5000 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: - <<: *default - database: api_demo_test + adapter: sqlite3 + database: db/test.sqlite3 + pool: 5 + timeout: 5000 -# As with config/secrets.yml, you never want to store sensitive information, -# like your database password, in your source code. If your source code is -# ever seen by anyone, they now have access to your database. -# -# Instead, provide the password as a unix environment variable when you boot -# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database -# for a full rundown on how to provide these environment variables in a -# production deployment. -# -# On Heroku and other platform providers, you may have a full connection URL -# available as an environment variable. For example: -# -# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" -# -# You can use this database configuration with: -# -# production: -# url: <%= ENV['DATABASE_URL'] %> -# production: - <<: *default - database: api_demo_production - username: api_demo - password: <%= ENV['API_DEMO_DATABASE_PASSWORD'] %> + adapter: sqlite3 + database: db/production.sqlite3 + pool: 5 + timeout: 5000 diff --git a/samples/server/petstore/rails5/.openapi-generator/VERSION b/samples/server/petstore/rails5/.openapi-generator/VERSION index 096bf47efe3..ad121e8340e 100644 --- a/samples/server/petstore/rails5/.openapi-generator/VERSION +++ b/samples/server/petstore/rails5/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rails5/Gemfile b/samples/server/petstore/rails5/Gemfile index a46942406d1..1fddd01a429 100644 --- a/samples/server/petstore/rails5/Gemfile +++ b/samples/server/petstore/rails5/Gemfile @@ -3,8 +3,8 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.0.0' -# Use mysql as the database for Active Record -gem 'mysql2', '>= 0.3.18', '< 0.5' +# Use sqlite as the database for Active Record +gem 'sqlite3', '~> 1.3' # Use Puma as the app server gem 'puma', '~> 3.0' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder diff --git a/samples/server/petstore/rails5/config/database.yml b/samples/server/petstore/rails5/config/database.yml index e536d9f37dc..025d62a8d81 100644 --- a/samples/server/petstore/rails5/config/database.yml +++ b/samples/server/petstore/rails5/config/database.yml @@ -1,54 +1,22 @@ -# MySQL. Versions 5.0 and up are supported. -# -# Install the MySQL driver -# gem install mysql2 -# -# Ensure the MySQL gem is defined in your Gemfile -# gem 'mysql2' -# -# And be sure to use new-style password hashing: -# http://dev.mysql.com/doc/refman/5.7/en/old-client.html -# -default: &default - adapter: mysql2 - encoding: utf8 - pool: 5 - username: root - password: - socket: /tmp/mysql.sock - +# SQLite version 3.x +# gem install sqlite3-ruby (not necessary on OS X Leopard) development: - <<: *default - database: api_demo_development + adapter: sqlite3 + database: db/development.sqlite3 + pool: 5 + timeout: 5000 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: - <<: *default - database: api_demo_test + adapter: sqlite3 + database: db/test.sqlite3 + pool: 5 + timeout: 5000 -# As with config/secrets.yml, you never want to store sensitive information, -# like your database password, in your source code. If your source code is -# ever seen by anyone, they now have access to your database. -# -# Instead, provide the password as a unix environment variable when you boot -# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database -# for a full rundown on how to provide these environment variables in a -# production deployment. -# -# On Heroku and other platform providers, you may have a full connection URL -# available as an environment variable. For example: -# -# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" -# -# You can use this database configuration with: -# -# production: -# url: <%= ENV['DATABASE_URL'] %> -# production: - <<: *default - database: api_demo_production - username: api_demo - password: <%= ENV['API_DEMO_DATABASE_PASSWORD'] %> + adapter: sqlite3 + database: db/production.sqlite3 + pool: 5 + timeout: 5000 From 7c49bdd953fb220c3f77b1e96404b7b496963e50 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 17 Jun 2018 14:52:37 +0800 Subject: [PATCH 06/35] CircleCI migration from 1.0 to 2.0 (#333) * migration to circleci 2.0 config * install docker compose * add setup remote docker * comment out docker compose * using public petstore for testing * use only one working_directory * use openapitools/openapi-petstore instead * disable auth in petstore server * run petstore server locally via mvn jetty * fix typo * test go first * test pet server at port 8080 * remove docker compose command * wait for server to start up * sleep longer * test mvn jetty again * use machine executor * comment out docker * comment out restore cache * sleep for 30s * change petstore port * restore petstore docker * fix docker run command * restore cache, clean up comments --- circle.yml | 147 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 93 insertions(+), 54 deletions(-) diff --git a/circle.yml b/circle.yml index 85085c24c16..71da8631b7f 100644 --- a/circle.yml +++ b/circle.yml @@ -1,54 +1,93 @@ -# Java-related client, server tests -machine: - java: - version: openjdk8 - services: - - docker - # Override /etc/hosts - hosts: - petstore.swagger.io: 127.0.0.1 - environment: - DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator - DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli - -dependencies: - cache_directories: - - "~/.m2" - - "~/.sbt" - - "~/.ivy2" - - pre: - - sudo add-apt-repository ppa:duggan/bats --yes - - sudo apt-get update -qq - - sudo apt-get install -qq bats - - sudo apt-get install -qq curl - # to run petstore server locally via docker - - docker pull swaggerapi/petstore - - docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore - - docker ps -a - # show host table to confirm petstore.swagger.io is mapped to localhost - - cat /etc/hosts - override: - - cp CI/pom.xml.circleci pom.xml - -test: - override: - ## test with jdk8 - - java -version - - mvn --quiet clean install - - mvn --quiet verify -Psamples - # skip the rest if previous mvn task fails - - if [ $? -ne 0 ]; then exit 1; fi - ## test with jdk7 - - sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 - - java -version - - cp CI/pom.xml.circleci.java7 pom.xml # use jdk7 pom - - mvn --quiet clean install - - mvn --quiet verify -Psamples - # skip the rest if previous mvn task fails - - if [ $? -ne 0 ]; then exit 1; fi - ## docker push done in Travis instead - ## docker: build generator image and push to Docker Hub - #- if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build --rm=false -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/opeanapi-generator && if [ ! -z "$CIRCLE_TAG" ]; then docker tag $DOCKER_GENERATOR_IMAGE_NAME:latest $DOCKER_GENERATOR_IMAGE_NAME:$CIRCLE_TAG; fi && if [ ! -z "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" = "master" ]; then docker push $DOCKER_GENERATOR_IMAGE_NAME; fi; fi - ### docker: build cli image and push to Docker Hub - #- if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build --rm=false -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/openapi-generator-cli && if [ ! -z "$CIRCLE_TAG" ]; then docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest $DOCKER_CODEGEN_CLI_IMAGE_NAME:$CIRCLE_TAG; fi && if [ ! -z "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" = "master" ]; then docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME; fi; fi +version: 2 +jobs: + build: + machine: + docker_layer_caching: true + working_directory: ~/OpenAPITools/openapi-generator + parallelism: 1 + shell: /bin/bash --login + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator + DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli + steps: + # Machine Setup + # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each + # The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out. + - checkout + # Prepare for artifact and test results collection equivalent to how it was done on 1.0. + # In many cases you can simplify this from what is generated here. + # 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/' + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS + # This is based on your 1.0 configuration file or project settings + - run: + command: sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java; sudo update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac; echo -e "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64" >> $BASH_ENV + - run: + command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; ' + - run: + command: |- + printf '127.0.0.1 petstore.swagger.io + ' | sudo tee -a /etc/hosts + # Dependencies + # This would typically go in either a build or a build-and-test job when using workflows + # Restore the dependency cache + - restore_cache: + keys: + # This branch if available + - v1-dep-{{ .Branch }}- + # Default branch if not + - v1-dep-master- + # This is based on your 1.0 configuration file or project settings + - run: sudo add-apt-repository ppa:duggan/bats --yes + - run: sudo apt-get update -qq + - run: sudo apt-get install -qq bats + - run: sudo apt-get install -qq curl +# - run: docker pull openapitools/openapi-petstore +# - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore + - run: docker pull swaggerapi/petstore + - run: docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore + - run: docker ps -a + - run: sleep 30 + - run: cat /etc/hosts + # This is based on your 1.0 configuration file or project settings + - run: cp CI/pom.xml.circleci pom.xml + # Save dependency cache + - save_cache: + key: v1-dep-{{ .Branch }} + paths: + # This is a broad list of cache paths to include many possible development environments + # You can probably delete some of these entries + - vendor/bundle + - ~/virtualenvs + - ~/.m2 + - ~/.ivy2 + - ~/.bundle + - ~/.go_workspace + - ~/.gradle + - ~/.cache/bower + # These cache paths were specified in the 1.0 config + - ~/.sbt + # Test + # This would typically be a build job when using workflows, possibly combined with build + # This is based on your 1.0 configuration file or project settings + - run: java -version + - run: mvn --quiet clean install + - run: mvn --quiet verify -Psamples + - run: if [ $? -ne 0 ]; then exit 1; fi + - run: sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 + - run: java -version + - run: cp CI/pom.xml.circleci.java7 pom.xml + - run: mvn --quiet clean install + - run: mvn --quiet verify -Psamples + - run: if [ $? -ne 0 ]; then exit 1; fi + # Teardown + # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each + # Save test results + - store_test_results: + path: /tmp/circleci-test-results + # Save artifacts + - store_artifacts: + path: /tmp/circleci-artifacts + - store_artifacts: + path: /tmp/circleci-test-results From 75171b4672efad03e177c5f91683868fb63e862f Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Sun, 17 Jun 2018 19:56:56 +0900 Subject: [PATCH 07/35] [C++] Rename template dir (#332) * Rename templateDir: pistache-server -> cpp-pistache-server * Rename templateDir: qt5cpp -> cpp-qt5-client * Rename templateDir: restbed -> cpp-restbed-server * Rename templateDir: cpprest -> cpp-rest-sdk-client * Rename templateDir: tizen -> cpp-tizen-client * Update scripts --- bin/cpp-qt5-petstore.sh | 2 +- bin/cpp-restsdk-petstore.sh | 2 +- bin/cpp-tizen-petstore.sh | 2 +- bin/openapi3/cpp-qt5-petstore.sh | 2 +- bin/openapi3/cpp-tizen-petstore.sh | 2 +- bin/security/cpp-qt5-petstore.sh | 2 +- bin/security/windows/qt5cpp-petstore.bat | 2 +- .../codegen/languages/CppPistacheServerCodegen.java | 2 +- .../org/openapitools/codegen/languages/CppQt5ClientCodegen.java | 2 +- .../openapitools/codegen/languages/CppRestSdkClientCodegen.java | 2 +- .../openapitools/codegen/languages/CppRestbedServerCodegen.java | 2 +- .../openapitools/codegen/languages/CppTizenClientCodegen.java | 2 +- .../{pistache-server => cpp-pistache-server}/README.mustache | 0 .../api-header.mustache | 0 .../api-impl-header.mustache | 0 .../api-impl-source.mustache | 0 .../api-source.mustache | 0 .../{pistache-server => cpp-pistache-server}/cmake.mustache | 0 .../licenseInfo.mustache | 0 .../main-api-server.mustache | 0 .../model-header.mustache | 0 .../model-source.mustache | 0 .../modelbase-header.mustache | 0 .../modelbase-source.mustache | 0 .../{qt5cpp => cpp-qt5-client}/HttpRequest.cpp.mustache | 0 .../resources/{qt5cpp => cpp-qt5-client}/HttpRequest.h.mustache | 0 .../main/resources/{qt5cpp => cpp-qt5-client}/Project.mustache | 0 .../{qt5cpp => cpp-qt5-client}/QObjectWrapper.h.mustache | 0 .../main/resources/{qt5cpp => cpp-qt5-client}/api-body.mustache | 0 .../resources/{qt5cpp => cpp-qt5-client}/api-header.mustache | 0 .../resources/{qt5cpp => cpp-qt5-client}/helpers-body.mustache | 0 .../{qt5cpp => cpp-qt5-client}/helpers-header.mustache | 0 .../resources/{qt5cpp => cpp-qt5-client}/licenseInfo.mustache | 0 .../resources/{qt5cpp => cpp-qt5-client}/model-body.mustache | 0 .../resources/{qt5cpp => cpp-qt5-client}/model-header.mustache | 0 .../resources/{qt5cpp => cpp-qt5-client}/modelFactory.mustache | 0 .../main/resources/{qt5cpp => cpp-qt5-client}/object.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/api-header.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/api-source.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/apiclient-header.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/apiclient-source.mustache | 0 .../apiconfiguration-header.mustache | 0 .../apiconfiguration-source.mustache | 0 .../apiexception-header.mustache | 0 .../apiexception-source.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/cmake-lists.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/git_push.sh.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/gitignore.mustache | 0 .../httpcontent-header.mustache | 0 .../httpcontent-source.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/ihttpbody-header.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/jsonbody-header.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/jsonbody-source.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/licenseInfo.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/model-header.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/model-source.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/modelbase-header.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/modelbase-source.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/multipart-header.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/multipart-source.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/object-header.mustache | 0 .../{cpprest => cpp-rest-sdk-client}/object-source.mustache | 0 .../resources/{restbed => cpp-restbed-server}/README.mustache | 0 .../{restbed => cpp-restbed-server}/api-header.mustache | 0 .../{restbed => cpp-restbed-server}/api-source.mustache | 0 .../{restbed => cpp-restbed-server}/git_push.sh.mustache | 0 .../{restbed => cpp-restbed-server}/gitignore.mustache | 0 .../{restbed => cpp-restbed-server}/licenseInfo.mustache | 0 .../{restbed => cpp-restbed-server}/model-header.mustache | 0 .../{restbed => cpp-restbed-server}/model-source.mustache | 0 .../resources/{tizen => cpp-tizen-client}/Doxyfile.mustache | 0 .../resources/{tizen => cpp-tizen-client}/api-body.mustache | 0 .../resources/{tizen => cpp-tizen-client}/api-header.mustache | 0 .../resources/{tizen => cpp-tizen-client}/doc-readme.mustache | 0 .../resources/{tizen => cpp-tizen-client}/error-body.mustache | 0 .../resources/{tizen => cpp-tizen-client}/error-header.mustache | 0 .../{tizen => cpp-tizen-client}/generateDocumentation.mustache | 0 .../resources/{tizen => cpp-tizen-client}/helpers-body.mustache | 0 .../{tizen => cpp-tizen-client}/helpers-header.mustache | 0 .../resources/{tizen => cpp-tizen-client}/model-body.mustache | 0 .../resources/{tizen => cpp-tizen-client}/model-header.mustache | 0 .../{tizen => cpp-tizen-client}/netclient-body.mustache | 0 .../{tizen => cpp-tizen-client}/netclient-header.mustache | 0 .../main/resources/{tizen => cpp-tizen-client}/object.mustache | 0 .../resources/{tizen => cpp-tizen-client}/requestinfo.mustache | 0 85 files changed, 12 insertions(+), 12 deletions(-) rename modules/openapi-generator/src/main/resources/{pistache-server => cpp-pistache-server}/README.mustache (100%) rename modules/openapi-generator/src/main/resources/{pistache-server => cpp-pistache-server}/api-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{pistache-server => cpp-pistache-server}/api-impl-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{pistache-server => cpp-pistache-server}/api-impl-source.mustache (100%) rename modules/openapi-generator/src/main/resources/{pistache-server => cpp-pistache-server}/api-source.mustache (100%) rename modules/openapi-generator/src/main/resources/{pistache-server => cpp-pistache-server}/cmake.mustache (100%) rename modules/openapi-generator/src/main/resources/{pistache-server => cpp-pistache-server}/licenseInfo.mustache (100%) rename modules/openapi-generator/src/main/resources/{pistache-server => cpp-pistache-server}/main-api-server.mustache (100%) rename modules/openapi-generator/src/main/resources/{pistache-server => cpp-pistache-server}/model-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{pistache-server => cpp-pistache-server}/model-source.mustache (100%) rename modules/openapi-generator/src/main/resources/{pistache-server => cpp-pistache-server}/modelbase-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{pistache-server => cpp-pistache-server}/modelbase-source.mustache (100%) rename modules/openapi-generator/src/main/resources/{qt5cpp => cpp-qt5-client}/HttpRequest.cpp.mustache (100%) rename modules/openapi-generator/src/main/resources/{qt5cpp => cpp-qt5-client}/HttpRequest.h.mustache (100%) rename modules/openapi-generator/src/main/resources/{qt5cpp => cpp-qt5-client}/Project.mustache (100%) rename modules/openapi-generator/src/main/resources/{qt5cpp => cpp-qt5-client}/QObjectWrapper.h.mustache (100%) rename modules/openapi-generator/src/main/resources/{qt5cpp => cpp-qt5-client}/api-body.mustache (100%) rename modules/openapi-generator/src/main/resources/{qt5cpp => cpp-qt5-client}/api-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{qt5cpp => cpp-qt5-client}/helpers-body.mustache (100%) rename modules/openapi-generator/src/main/resources/{qt5cpp => cpp-qt5-client}/helpers-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{qt5cpp => cpp-qt5-client}/licenseInfo.mustache (100%) rename modules/openapi-generator/src/main/resources/{qt5cpp => cpp-qt5-client}/model-body.mustache (100%) rename modules/openapi-generator/src/main/resources/{qt5cpp => cpp-qt5-client}/model-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{qt5cpp => cpp-qt5-client}/modelFactory.mustache (100%) rename modules/openapi-generator/src/main/resources/{qt5cpp => cpp-qt5-client}/object.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/api-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/api-source.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/apiclient-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/apiclient-source.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/apiconfiguration-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/apiconfiguration-source.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/apiexception-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/apiexception-source.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/cmake-lists.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/git_push.sh.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/gitignore.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/httpcontent-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/httpcontent-source.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/ihttpbody-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/jsonbody-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/jsonbody-source.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/licenseInfo.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/model-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/model-source.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/modelbase-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/modelbase-source.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/multipart-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/multipart-source.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/object-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{cpprest => cpp-rest-sdk-client}/object-source.mustache (100%) rename modules/openapi-generator/src/main/resources/{restbed => cpp-restbed-server}/README.mustache (100%) rename modules/openapi-generator/src/main/resources/{restbed => cpp-restbed-server}/api-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{restbed => cpp-restbed-server}/api-source.mustache (100%) rename modules/openapi-generator/src/main/resources/{restbed => cpp-restbed-server}/git_push.sh.mustache (100%) rename modules/openapi-generator/src/main/resources/{restbed => cpp-restbed-server}/gitignore.mustache (100%) rename modules/openapi-generator/src/main/resources/{restbed => cpp-restbed-server}/licenseInfo.mustache (100%) rename modules/openapi-generator/src/main/resources/{restbed => cpp-restbed-server}/model-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{restbed => cpp-restbed-server}/model-source.mustache (100%) rename modules/openapi-generator/src/main/resources/{tizen => cpp-tizen-client}/Doxyfile.mustache (100%) rename modules/openapi-generator/src/main/resources/{tizen => cpp-tizen-client}/api-body.mustache (100%) rename modules/openapi-generator/src/main/resources/{tizen => cpp-tizen-client}/api-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{tizen => cpp-tizen-client}/doc-readme.mustache (100%) rename modules/openapi-generator/src/main/resources/{tizen => cpp-tizen-client}/error-body.mustache (100%) rename modules/openapi-generator/src/main/resources/{tizen => cpp-tizen-client}/error-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{tizen => cpp-tizen-client}/generateDocumentation.mustache (100%) rename modules/openapi-generator/src/main/resources/{tizen => cpp-tizen-client}/helpers-body.mustache (100%) rename modules/openapi-generator/src/main/resources/{tizen => cpp-tizen-client}/helpers-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{tizen => cpp-tizen-client}/model-body.mustache (100%) rename modules/openapi-generator/src/main/resources/{tizen => cpp-tizen-client}/model-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{tizen => cpp-tizen-client}/netclient-body.mustache (100%) rename modules/openapi-generator/src/main/resources/{tizen => cpp-tizen-client}/netclient-header.mustache (100%) rename modules/openapi-generator/src/main/resources/{tizen => cpp-tizen-client}/object.mustache (100%) rename modules/openapi-generator/src/main/resources/{tizen => cpp-tizen-client}/requestinfo.mustache (100%) diff --git a/bin/cpp-qt5-petstore.sh b/bin/cpp-qt5-petstore.sh index fdca2260d5e..3ed26ff9fe8 100755 --- a/bin/cpp-qt5-petstore.sh +++ b/bin/cpp-qt5-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/qt5cpp -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-qt5 -o samples/client/petstore/cpp-qt5 $@" +ags="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-qt5 -o samples/client/petstore/cpp-qt5 $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/cpp-restsdk-petstore.sh b/bin/cpp-restsdk-petstore.sh index 0a33cb36e3e..3eecfa7a027 100755 --- a/bin/cpp-restsdk-petstore.sh +++ b/bin/cpp-restsdk-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/cpprest -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-restsdk -o samples/client/petstore/cpp-restsdk $@" +ags="generate -t modules/openapi-generator/src/main/resources/cpp-rest-sdk-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-restsdk -o samples/client/petstore/cpp-restsdk $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/cpp-tizen-petstore.sh b/bin/cpp-tizen-petstore.sh index 82d9d9cd3ae..72b0fbe7134 100755 --- a/bin/cpp-tizen-petstore.sh +++ b/bin/cpp-tizen-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/tizen -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-tizen -o samples/client/petstore/cpp-tizen $@" +ags="generate -t modules/openapi-generator/src/main/resources/cpp-tizen-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-tizen -o samples/client/petstore/cpp-tizen $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/cpp-qt5-petstore.sh b/bin/openapi3/cpp-qt5-petstore.sh index d9e1835cc24..aa92aa3b573 100755 --- a/bin/openapi3/cpp-qt5-petstore.sh +++ b/bin/openapi3/cpp-qt5-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/qt5cpp -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g cpp-qt5 -o samples/client/petstore/cpp-qt5 $@" +ags="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-client -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g cpp-qt5 -o samples/client/petstore/cpp-qt5 $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/cpp-tizen-petstore.sh b/bin/openapi3/cpp-tizen-petstore.sh index 2b1179642af..149ec49339c 100755 --- a/bin/openapi3/cpp-tizen-petstore.sh +++ b/bin/openapi3/cpp-tizen-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/tizen -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g cpp-tizen -o samples/client/petstore/cpp-tizen $@" +ags="generate -t modules/openapi-generator/src/main/resources/cpp-tizen-client -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g cpp-tizen -o samples/client/petstore/cpp-tizen $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/security/cpp-qt5-petstore.sh b/bin/security/cpp-qt5-petstore.sh index 1a2b5e76a16..47ec7af4548 100755 --- a/bin/security/cpp-qt5-petstore.sh +++ b/bin/security/cpp-qt5-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/qt5cpp -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g cpp-qt5 -o samples/client/petstore-security-test/cpp-qt5 $@" +ags="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-client -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g cpp-qt5 -o samples/client/petstore-security-test/cpp-qt5 $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/security/windows/qt5cpp-petstore.bat b/bin/security/windows/qt5cpp-petstore.bat index 6cb8a45dbe1..57d6b6c5f9e 100644 --- a/bin/security/windows/qt5cpp-petstore.bat +++ b/bin/security/windows/qt5cpp-petstore.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules/openapi-generator/src/main/resources/qt5cpp -i modules\openapi-generator\src\test\resources\2_0\petstore-security-test.yaml -g qt5cpp -o samples\client\petstore-security-test\qt5cpp +set ags=generate -t modules/openapi-generator/src/main/resources/cpp-qt5-client -i modules\openapi-generator\src\test\resources\2_0\petstore-security-test.yaml -g qt5cpp -o samples\client\petstore-security-test\qt5cpp java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java index b11c02f6329..1bbfafbce37 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java @@ -74,7 +74,7 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { apiTemplateFiles.put("api-impl-source.mustache", ".cpp"); apiTemplateFiles.put("main-api-server.mustache", ".cpp"); - embeddedTemplateDir = templateDir = "pistache-server"; + embeddedTemplateDir = templateDir = "cpp-pistache-server"; cliOptions.clear(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java index dab947d9dd7..fa3e9ca643d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java @@ -92,7 +92,7 @@ public class CppQt5ClientCodegen extends AbstractCppCodegen implements CodegenCo * Template Location. This is the location which templates will be read from. The generator * will use the resource stream to attempt to read the templates. */ - embeddedTemplateDir = templateDir = "qt5cpp"; + embeddedTemplateDir = templateDir = "cpp-qt5-client"; // CLI options addOption(CPP_NAMESPACE, CPP_NAMESPACE_DESC, this.cppNamespace); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java index d8aed6bd863..8cf9a14af6d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java @@ -99,7 +99,7 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen { apiTemplateFiles.put("api-header.mustache", ".h"); apiTemplateFiles.put("api-source.mustache", ".cpp"); - embeddedTemplateDir = templateDir = "cpprest"; + embeddedTemplateDir = templateDir = "cpp-rest-sdk-client"; cliOptions.clear(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java index 69e0ebe17f6..fb8e289b3af 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestbedServerCodegen.java @@ -53,7 +53,7 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen { apiTemplateFiles.put("api-header.mustache", ".h"); apiTemplateFiles.put("api-source.mustache", ".cpp"); - embeddedTemplateDir = templateDir = "restbed"; + embeddedTemplateDir = templateDir = "cpp-restbed-server"; cliOptions.clear(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java index 2f2afe39139..1e3f1a849f1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppTizenClientCodegen.java @@ -44,7 +44,7 @@ public class CppTizenClientCodegen extends DefaultCodegen implements CodegenConf modelTemplateFiles.put("model-body.mustache", ".cpp"); apiTemplateFiles.put("api-header.mustache", ".h"); apiTemplateFiles.put("api-body.mustache", ".cpp"); - embeddedTemplateDir = templateDir = "tizen"; + embeddedTemplateDir = templateDir = "cpp-tizen-client"; modelPackage = ""; defaultIncludes = new HashSet( diff --git a/modules/openapi-generator/src/main/resources/pistache-server/README.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/README.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/pistache-server/README.mustache rename to modules/openapi-generator/src/main/resources/cpp-pistache-server/README.mustache diff --git a/modules/openapi-generator/src/main/resources/pistache-server/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/pistache-server/api-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-pistache-server/api-header.mustache diff --git a/modules/openapi-generator/src/main/resources/pistache-server/api-impl-header.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-impl-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/pistache-server/api-impl-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-pistache-server/api-impl-header.mustache diff --git a/modules/openapi-generator/src/main/resources/pistache-server/api-impl-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-impl-source.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/pistache-server/api-impl-source.mustache rename to modules/openapi-generator/src/main/resources/cpp-pistache-server/api-impl-source.mustache diff --git a/modules/openapi-generator/src/main/resources/pistache-server/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/pistache-server/api-source.mustache rename to modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache diff --git a/modules/openapi-generator/src/main/resources/pistache-server/cmake.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/cmake.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/pistache-server/cmake.mustache rename to modules/openapi-generator/src/main/resources/cpp-pistache-server/cmake.mustache diff --git a/modules/openapi-generator/src/main/resources/pistache-server/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/licenseInfo.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/pistache-server/licenseInfo.mustache rename to modules/openapi-generator/src/main/resources/cpp-pistache-server/licenseInfo.mustache diff --git a/modules/openapi-generator/src/main/resources/pistache-server/main-api-server.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/pistache-server/main-api-server.mustache rename to modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache diff --git a/modules/openapi-generator/src/main/resources/pistache-server/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/pistache-server/model-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-pistache-server/model-header.mustache diff --git a/modules/openapi-generator/src/main/resources/pistache-server/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/pistache-server/model-source.mustache rename to modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache diff --git a/modules/openapi-generator/src/main/resources/pistache-server/modelbase-header.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/modelbase-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/pistache-server/modelbase-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-pistache-server/modelbase-header.mustache diff --git a/modules/openapi-generator/src/main/resources/pistache-server/modelbase-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/modelbase-source.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/pistache-server/modelbase-source.mustache rename to modules/openapi-generator/src/main/resources/cpp-pistache-server/modelbase-source.mustache diff --git a/modules/openapi-generator/src/main/resources/qt5cpp/HttpRequest.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/qt5cpp/HttpRequest.cpp.mustache rename to modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache diff --git a/modules/openapi-generator/src/main/resources/qt5cpp/HttpRequest.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/qt5cpp/HttpRequest.h.mustache rename to modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache diff --git a/modules/openapi-generator/src/main/resources/qt5cpp/Project.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/Project.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/qt5cpp/Project.mustache rename to modules/openapi-generator/src/main/resources/cpp-qt5-client/Project.mustache diff --git a/modules/openapi-generator/src/main/resources/qt5cpp/QObjectWrapper.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/QObjectWrapper.h.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/qt5cpp/QObjectWrapper.h.mustache rename to modules/openapi-generator/src/main/resources/cpp-qt5-client/QObjectWrapper.h.mustache diff --git a/modules/openapi-generator/src/main/resources/qt5cpp/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/qt5cpp/api-body.mustache rename to modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache diff --git a/modules/openapi-generator/src/main/resources/qt5cpp/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/qt5cpp/api-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache diff --git a/modules/openapi-generator/src/main/resources/qt5cpp/helpers-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/helpers-body.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/qt5cpp/helpers-body.mustache rename to modules/openapi-generator/src/main/resources/cpp-qt5-client/helpers-body.mustache diff --git a/modules/openapi-generator/src/main/resources/qt5cpp/helpers-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/helpers-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/qt5cpp/helpers-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-qt5-client/helpers-header.mustache diff --git a/modules/openapi-generator/src/main/resources/qt5cpp/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/licenseInfo.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/qt5cpp/licenseInfo.mustache rename to modules/openapi-generator/src/main/resources/cpp-qt5-client/licenseInfo.mustache diff --git a/modules/openapi-generator/src/main/resources/qt5cpp/model-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-body.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/qt5cpp/model-body.mustache rename to modules/openapi-generator/src/main/resources/cpp-qt5-client/model-body.mustache diff --git a/modules/openapi-generator/src/main/resources/qt5cpp/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/qt5cpp/model-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-qt5-client/model-header.mustache diff --git a/modules/openapi-generator/src/main/resources/qt5cpp/modelFactory.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/modelFactory.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/qt5cpp/modelFactory.mustache rename to modules/openapi-generator/src/main/resources/cpp-qt5-client/modelFactory.mustache diff --git a/modules/openapi-generator/src/main/resources/qt5cpp/object.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/object.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/qt5cpp/object.mustache rename to modules/openapi-generator/src/main/resources/cpp-qt5-client/object.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/api-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-header.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/api-source.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/apiclient-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiclient-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/apiclient-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiclient-header.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/apiclient-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiclient-source.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/apiclient-source.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiclient-source.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/apiconfiguration-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiconfiguration-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/apiconfiguration-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiconfiguration-header.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/apiconfiguration-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiconfiguration-source.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/apiconfiguration-source.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiconfiguration-source.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/apiexception-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiexception-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/apiexception-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiexception-header.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/apiexception-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiexception-source.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/apiexception-source.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/apiexception-source.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/cmake-lists.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/cmake-lists.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/cmake-lists.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/cmake-lists.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/git_push.sh.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/git_push.sh.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/git_push.sh.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/gitignore.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/gitignore.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/gitignore.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/gitignore.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/httpcontent-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/httpcontent-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/httpcontent-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/httpcontent-header.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/httpcontent-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/httpcontent-source.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/httpcontent-source.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/httpcontent-source.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/ihttpbody-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/ihttpbody-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/ihttpbody-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/ihttpbody-header.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/jsonbody-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/jsonbody-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/jsonbody-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/jsonbody-header.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/jsonbody-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/jsonbody-source.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/jsonbody-source.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/jsonbody-source.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/licenseInfo.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/licenseInfo.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/licenseInfo.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/model-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/model-source.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/modelbase-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/modelbase-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/modelbase-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-source.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/modelbase-source.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-source.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/multipart-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/multipart-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/multipart-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/multipart-header.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/multipart-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/multipart-source.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/multipart-source.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/multipart-source.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/object-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/object-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/object-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/object-header.mustache diff --git a/modules/openapi-generator/src/main/resources/cpprest/object-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/object-source.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/cpprest/object-source.mustache rename to modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/object-source.mustache diff --git a/modules/openapi-generator/src/main/resources/restbed/README.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/README.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/restbed/README.mustache rename to modules/openapi-generator/src/main/resources/cpp-restbed-server/README.mustache diff --git a/modules/openapi-generator/src/main/resources/restbed/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/restbed/api-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-restbed-server/api-header.mustache diff --git a/modules/openapi-generator/src/main/resources/restbed/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/restbed/api-source.mustache rename to modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache diff --git a/modules/openapi-generator/src/main/resources/restbed/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/git_push.sh.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/restbed/git_push.sh.mustache rename to modules/openapi-generator/src/main/resources/cpp-restbed-server/git_push.sh.mustache diff --git a/modules/openapi-generator/src/main/resources/restbed/gitignore.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/gitignore.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/restbed/gitignore.mustache rename to modules/openapi-generator/src/main/resources/cpp-restbed-server/gitignore.mustache diff --git a/modules/openapi-generator/src/main/resources/restbed/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/licenseInfo.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/restbed/licenseInfo.mustache rename to modules/openapi-generator/src/main/resources/cpp-restbed-server/licenseInfo.mustache diff --git a/modules/openapi-generator/src/main/resources/restbed/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/model-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/restbed/model-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-restbed-server/model-header.mustache diff --git a/modules/openapi-generator/src/main/resources/restbed/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/model-source.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/restbed/model-source.mustache rename to modules/openapi-generator/src/main/resources/cpp-restbed-server/model-source.mustache diff --git a/modules/openapi-generator/src/main/resources/tizen/Doxyfile.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/Doxyfile.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/tizen/Doxyfile.mustache rename to modules/openapi-generator/src/main/resources/cpp-tizen-client/Doxyfile.mustache diff --git a/modules/openapi-generator/src/main/resources/tizen/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/api-body.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/tizen/api-body.mustache rename to modules/openapi-generator/src/main/resources/cpp-tizen-client/api-body.mustache diff --git a/modules/openapi-generator/src/main/resources/tizen/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/api-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/tizen/api-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-tizen-client/api-header.mustache diff --git a/modules/openapi-generator/src/main/resources/tizen/doc-readme.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/doc-readme.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/tizen/doc-readme.mustache rename to modules/openapi-generator/src/main/resources/cpp-tizen-client/doc-readme.mustache diff --git a/modules/openapi-generator/src/main/resources/tizen/error-body.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/error-body.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/tizen/error-body.mustache rename to modules/openapi-generator/src/main/resources/cpp-tizen-client/error-body.mustache diff --git a/modules/openapi-generator/src/main/resources/tizen/error-header.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/error-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/tizen/error-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-tizen-client/error-header.mustache diff --git a/modules/openapi-generator/src/main/resources/tizen/generateDocumentation.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/generateDocumentation.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/tizen/generateDocumentation.mustache rename to modules/openapi-generator/src/main/resources/cpp-tizen-client/generateDocumentation.mustache diff --git a/modules/openapi-generator/src/main/resources/tizen/helpers-body.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/helpers-body.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/tizen/helpers-body.mustache rename to modules/openapi-generator/src/main/resources/cpp-tizen-client/helpers-body.mustache diff --git a/modules/openapi-generator/src/main/resources/tizen/helpers-header.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/helpers-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/tizen/helpers-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-tizen-client/helpers-header.mustache diff --git a/modules/openapi-generator/src/main/resources/tizen/model-body.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/model-body.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/tizen/model-body.mustache rename to modules/openapi-generator/src/main/resources/cpp-tizen-client/model-body.mustache diff --git a/modules/openapi-generator/src/main/resources/tizen/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/model-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/tizen/model-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-tizen-client/model-header.mustache diff --git a/modules/openapi-generator/src/main/resources/tizen/netclient-body.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/netclient-body.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/tizen/netclient-body.mustache rename to modules/openapi-generator/src/main/resources/cpp-tizen-client/netclient-body.mustache diff --git a/modules/openapi-generator/src/main/resources/tizen/netclient-header.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/netclient-header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/tizen/netclient-header.mustache rename to modules/openapi-generator/src/main/resources/cpp-tizen-client/netclient-header.mustache diff --git a/modules/openapi-generator/src/main/resources/tizen/object.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/object.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/tizen/object.mustache rename to modules/openapi-generator/src/main/resources/cpp-tizen-client/object.mustache diff --git a/modules/openapi-generator/src/main/resources/tizen/requestinfo.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/requestinfo.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/tizen/requestinfo.mustache rename to modules/openapi-generator/src/main/resources/cpp-tizen-client/requestinfo.mustache From 97bab928bd2bf99ae931d9406d0d6a7e861d6db2 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Sun, 17 Jun 2018 13:09:21 -0400 Subject: [PATCH 08/35] [cli] Enable recommendations on validate command (#292) --- .../openapitools/codegen/cmd/Validate.java | 50 ++++++++++++++++--- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Validate.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Validate.java index 4da5b318c6a..fc8624586d6 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Validate.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Validate.java @@ -21,7 +21,9 @@ import io.airlift.airline.Command; import io.airlift.airline.Option; import io.swagger.parser.OpenAPIParser; +import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.parser.core.models.SwaggerParseResult; +import org.openapitools.codegen.utils.ModelUtils; import java.util.HashSet; import java.util.List; @@ -34,26 +36,58 @@ public class Validate implements Runnable { description = "location of the OpenAPI spec, as URL or file (required)") private String spec; + @Option(name = { "--recommend"}, title = "recommend spec improvements") + private Boolean recommend; + @Override public void run() { System.out.println("Validating spec (" + spec + ")"); SwaggerParseResult result = new OpenAPIParser().readLocation(spec, null, null); List messageList = result.getMessages(); - Set messages = new HashSet(messageList); + Set errors = new HashSet(messageList); + Set warnings = new HashSet(); - if (messages.size() > 0) { - StringBuilder sb = new StringBuilder(); - sb.append(System.lineSeparator()); - for (String message : messages) { - sb.append(String.format("\t- %s%s", message, System.lineSeparator())); + StringBuilder sb = new StringBuilder(); + OpenAPI specification = result.getOpenAPI(); + + if (Boolean.TRUE.equals(recommend)) { + if (specification != null) { + // Add information about unused models to the warnings set. + List unusedModels = ModelUtils.getUnusedSchemas(specification); + if (unusedModels != null) { + unusedModels.forEach(name -> warnings.add("Unused model: " + name)); + } } + } + + if (errors.size() > 0) { + sb.append("Errors:").append(System.lineSeparator()); + errors.forEach(msg -> + sb.append("\t-").append(msg).append(System.lineSeparator()) + ); + } + + if (!warnings.isEmpty()) { + sb.append("Warnings: ").append(System.lineSeparator()); + warnings.forEach(msg -> + sb.append("\t-").append(msg).append(System.lineSeparator()) + ); + } + + if (!errors.isEmpty()) { sb.append(System.lineSeparator()); - sb.append("[error] Spec is invalid."); + sb.append("[error] Spec has ").append(errors.size()).append(" errors."); System.err.println(sb.toString()); System.exit(1); + } else if (!warnings.isEmpty()) { + sb.append(System.lineSeparator()); + sb.append("[info] Spec has ").append(warnings.size()).append(" recommendation(s)."); } else { - System.out.println("No validation errors detected."); + // we say "issues" here rather than "errors" to account for both errors and issues. + sb.append("No validation issues detected."); } + + System.out.println(sb.toString()); } } From c51986d657e1ba2e178a7512aec1c293e0ae9d7e Mon Sep 17 00:00:00 2001 From: Ben Wells Date: Sun, 17 Jun 2018 18:09:48 +0100 Subject: [PATCH 09/35] Go server clean up (#328) --- .../go-server/controller-api.mustache | 1 + .../main/resources/go-server/logger.mustache | 28 ++++++------- .../main/resources/go-server/model.mustache | 2 +- .../main/resources/go-server/routers.mustache | 4 +- .../petstore/go-api-server/go/api_pet.go | 8 ++++ .../petstore/go-api-server/go/api_store.go | 4 ++ .../petstore/go-api-server/go/api_user.go | 8 ++++ .../petstore/go-api-server/go/logger.go | 28 ++++++------- .../go-api-server/go/model_api_response.go | 2 +- .../go-api-server/go/model_category.go | 2 +- .../petstore/go-api-server/go/model_order.go | 2 +- .../petstore/go-api-server/go/model_pet.go | 2 +- .../petstore/go-api-server/go/model_tag.go | 2 +- .../petstore/go-api-server/go/model_user.go | 2 +- .../petstore/go-api-server/go/routers.go | 42 +++++++++---------- 15 files changed, 79 insertions(+), 58 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache b/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache index 528e71fa21c..bfde1e51a5b 100644 --- a/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache @@ -6,6 +6,7 @@ import ( "net/http" ){{#operation}} +// {{nickname}} - {{{summary}}} func {{nickname}}(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) diff --git a/modules/openapi-generator/src/main/resources/go-server/logger.mustache b/modules/openapi-generator/src/main/resources/go-server/logger.mustache index aa0d894d83a..e8464d6ad5f 100644 --- a/modules/openapi-generator/src/main/resources/go-server/logger.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/logger.mustache @@ -2,23 +2,23 @@ package {{packageName}} import ( - "log" - "net/http" - "time" + "log" + "net/http" + "time" ) func Logger(inner http.Handler, name string) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - start := time.Now() + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + start := time.Now() - inner.ServeHTTP(w, r) + inner.ServeHTTP(w, r) - log.Printf( - "%s %s %s %s", - r.Method, - r.RequestURI, - name, - time.Since(start), - ) - }) + log.Printf( + "%s %s %s %s", + r.Method, + r.RequestURI, + name, + time.Since(start), + ) + }) } diff --git a/modules/openapi-generator/src/main/resources/go-server/model.mustache b/modules/openapi-generator/src/main/resources/go-server/model.mustache index d6562a39eb8..d006e1aa050 100644 --- a/modules/openapi-generator/src/main/resources/go-server/model.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/model.mustache @@ -15,7 +15,7 @@ const ( {{/enumVars}} {{/allowableValues}} ){{/isEnum}}{{^isEnum}}{{#description}} -// {{{description}}}{{/description}} +// {{classname}} - {{{description}}}{{/description}} type {{classname}} struct { {{#vars}}{{#description}} // {{{description}}}{{/description}} diff --git a/modules/openapi-generator/src/main/resources/go-server/routers.mustache b/modules/openapi-generator/src/main/resources/go-server/routers.mustache index e3f5bdf3455..815fc5f75a5 100644 --- a/modules/openapi-generator/src/main/resources/go-server/routers.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/routers.mustache @@ -40,14 +40,14 @@ func Index(w http.ResponseWriter, r *http.Request) { } var routes = Routes{ - Route{ + { "Index", "GET", "{{{basePathWithoutHost}}}/", Index, },{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} - Route{ + { "{{operationId}}", strings.ToUpper("{{httpMethod}}"), "{{{basePathWithoutHost}}}{{{path}}}", diff --git a/samples/server/petstore/go-api-server/go/api_pet.go b/samples/server/petstore/go-api-server/go/api_pet.go index d57c66e5b5b..02b798ec950 100644 --- a/samples/server/petstore/go-api-server/go/api_pet.go +++ b/samples/server/petstore/go-api-server/go/api_pet.go @@ -13,41 +13,49 @@ import ( "net/http" ) +// AddPet - Add a new pet to the store func AddPet(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// DeletePet - Deletes a pet func DeletePet(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// FindPetsByStatus - Finds Pets by status func FindPetsByStatus(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// FindPetsByTags - Finds Pets by tags func FindPetsByTags(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// GetPetById - Find pet by ID func GetPetById(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// UpdatePet - Update an existing pet func UpdatePet(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// UpdatePetWithForm - Updates a pet in the store with form data func UpdatePetWithForm(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// UploadFile - uploads an image func UploadFile(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) diff --git a/samples/server/petstore/go-api-server/go/api_store.go b/samples/server/petstore/go-api-server/go/api_store.go index 85037e5b546..5174c6e7712 100644 --- a/samples/server/petstore/go-api-server/go/api_store.go +++ b/samples/server/petstore/go-api-server/go/api_store.go @@ -13,21 +13,25 @@ import ( "net/http" ) +// DeleteOrder - Delete purchase order by ID func DeleteOrder(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// GetInventory - Returns pet inventories by status func GetInventory(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// GetOrderById - Find purchase order by ID func GetOrderById(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// PlaceOrder - Place an order for a pet func PlaceOrder(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) diff --git a/samples/server/petstore/go-api-server/go/api_user.go b/samples/server/petstore/go-api-server/go/api_user.go index 3aba6e039de..460afb24c2e 100644 --- a/samples/server/petstore/go-api-server/go/api_user.go +++ b/samples/server/petstore/go-api-server/go/api_user.go @@ -13,41 +13,49 @@ import ( "net/http" ) +// CreateUser - Create user func CreateUser(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// CreateUsersWithArrayInput - Creates list of users with given input array func CreateUsersWithArrayInput(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// CreateUsersWithListInput - Creates list of users with given input array func CreateUsersWithListInput(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// DeleteUser - Delete user func DeleteUser(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// GetUserByName - Get user by user name func GetUserByName(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// LoginUser - Logs user into the system func LoginUser(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// LogoutUser - Logs out current logged in user session func LogoutUser(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } +// UpdateUser - Updated user func UpdateUser(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) diff --git a/samples/server/petstore/go-api-server/go/logger.go b/samples/server/petstore/go-api-server/go/logger.go index 186d5d18ae4..08cc0ea3f1d 100644 --- a/samples/server/petstore/go-api-server/go/logger.go +++ b/samples/server/petstore/go-api-server/go/logger.go @@ -10,23 +10,23 @@ package petstoreserver import ( - "log" - "net/http" - "time" + "log" + "net/http" + "time" ) func Logger(inner http.Handler, name string) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - start := time.Now() + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + start := time.Now() - inner.ServeHTTP(w, r) + inner.ServeHTTP(w, r) - log.Printf( - "%s %s %s %s", - r.Method, - r.RequestURI, - name, - time.Since(start), - ) - }) + log.Printf( + "%s %s %s %s", + r.Method, + r.RequestURI, + name, + time.Since(start), + ) + }) } diff --git a/samples/server/petstore/go-api-server/go/model_api_response.go b/samples/server/petstore/go-api-server/go/model_api_response.go index 48a48e715a2..2379e169080 100644 --- a/samples/server/petstore/go-api-server/go/model_api_response.go +++ b/samples/server/petstore/go-api-server/go/model_api_response.go @@ -9,7 +9,7 @@ package petstoreserver -// Describes the result of uploading an image resource +// ApiResponse - Describes the result of uploading an image resource type ApiResponse struct { Code int32 `json:"code,omitempty"` diff --git a/samples/server/petstore/go-api-server/go/model_category.go b/samples/server/petstore/go-api-server/go/model_category.go index ac0089074ee..5e6f9d247fa 100644 --- a/samples/server/petstore/go-api-server/go/model_category.go +++ b/samples/server/petstore/go-api-server/go/model_category.go @@ -9,7 +9,7 @@ package petstoreserver -// A category for a pet +// Category - A category for a pet type Category struct { Id int64 `json:"id,omitempty"` diff --git a/samples/server/petstore/go-api-server/go/model_order.go b/samples/server/petstore/go-api-server/go/model_order.go index 8a57968de18..a9d8dbb7957 100644 --- a/samples/server/petstore/go-api-server/go/model_order.go +++ b/samples/server/petstore/go-api-server/go/model_order.go @@ -13,7 +13,7 @@ import ( "time" ) -// An order for a pets from the pet store +// Order - An order for a pets from the pet store type Order struct { Id int64 `json:"id,omitempty"` diff --git a/samples/server/petstore/go-api-server/go/model_pet.go b/samples/server/petstore/go-api-server/go/model_pet.go index 011fb899ab6..ff09e500be5 100644 --- a/samples/server/petstore/go-api-server/go/model_pet.go +++ b/samples/server/petstore/go-api-server/go/model_pet.go @@ -9,7 +9,7 @@ package petstoreserver -// A pet for sale in the pet store +// Pet - A pet for sale in the pet store type Pet struct { Id int64 `json:"id,omitempty"` diff --git a/samples/server/petstore/go-api-server/go/model_tag.go b/samples/server/petstore/go-api-server/go/model_tag.go index d2194bba546..2fb07fb32c4 100644 --- a/samples/server/petstore/go-api-server/go/model_tag.go +++ b/samples/server/petstore/go-api-server/go/model_tag.go @@ -9,7 +9,7 @@ package petstoreserver -// A tag for a pet +// Tag - A tag for a pet type Tag struct { Id int64 `json:"id,omitempty"` diff --git a/samples/server/petstore/go-api-server/go/model_user.go b/samples/server/petstore/go-api-server/go/model_user.go index cb48644e59d..8f40d0ac04c 100644 --- a/samples/server/petstore/go-api-server/go/model_user.go +++ b/samples/server/petstore/go-api-server/go/model_user.go @@ -9,7 +9,7 @@ package petstoreserver -// A User who is purchasing from the pet store +// User - A User who is purchasing from the pet store type User struct { Id int64 `json:"id,omitempty"` diff --git a/samples/server/petstore/go-api-server/go/routers.go b/samples/server/petstore/go-api-server/go/routers.go index 1d6a6c0e1fb..986ce371ad0 100644 --- a/samples/server/petstore/go-api-server/go/routers.go +++ b/samples/server/petstore/go-api-server/go/routers.go @@ -48,147 +48,147 @@ func Index(w http.ResponseWriter, r *http.Request) { } var routes = Routes{ - Route{ + { "Index", "GET", "/v2/", Index, }, - Route{ + { "AddPet", strings.ToUpper("Post"), "/v2/pet", AddPet, }, - Route{ + { "DeletePet", strings.ToUpper("Delete"), "/v2/pet/{petId}", DeletePet, }, - Route{ + { "FindPetsByStatus", strings.ToUpper("Get"), "/v2/pet/findByStatus", FindPetsByStatus, }, - Route{ + { "FindPetsByTags", strings.ToUpper("Get"), "/v2/pet/findByTags", FindPetsByTags, }, - Route{ + { "GetPetById", strings.ToUpper("Get"), "/v2/pet/{petId}", GetPetById, }, - Route{ + { "UpdatePet", strings.ToUpper("Put"), "/v2/pet", UpdatePet, }, - Route{ + { "UpdatePetWithForm", strings.ToUpper("Post"), "/v2/pet/{petId}", UpdatePetWithForm, }, - Route{ + { "UploadFile", strings.ToUpper("Post"), "/v2/pet/{petId}/uploadImage", UploadFile, }, - Route{ + { "DeleteOrder", strings.ToUpper("Delete"), "/v2/store/order/{orderId}", DeleteOrder, }, - Route{ + { "GetInventory", strings.ToUpper("Get"), "/v2/store/inventory", GetInventory, }, - Route{ + { "GetOrderById", strings.ToUpper("Get"), "/v2/store/order/{orderId}", GetOrderById, }, - Route{ + { "PlaceOrder", strings.ToUpper("Post"), "/v2/store/order", PlaceOrder, }, - Route{ + { "CreateUser", strings.ToUpper("Post"), "/v2/user", CreateUser, }, - Route{ + { "CreateUsersWithArrayInput", strings.ToUpper("Post"), "/v2/user/createWithArray", CreateUsersWithArrayInput, }, - Route{ + { "CreateUsersWithListInput", strings.ToUpper("Post"), "/v2/user/createWithList", CreateUsersWithListInput, }, - Route{ + { "DeleteUser", strings.ToUpper("Delete"), "/v2/user/{username}", DeleteUser, }, - Route{ + { "GetUserByName", strings.ToUpper("Get"), "/v2/user/{username}", GetUserByName, }, - Route{ + { "LoginUser", strings.ToUpper("Get"), "/v2/user/login", LoginUser, }, - Route{ + { "LogoutUser", strings.ToUpper("Get"), "/v2/user/logout", LogoutUser, }, - Route{ + { "UpdateUser", strings.ToUpper("Put"), "/v2/user/{username}", From 30d10213ecd6e09bb320a0aa93d8650c33b2b471 Mon Sep 17 00:00:00 2001 From: John Wang Date: Sun, 17 Jun 2018 19:51:05 -0700 Subject: [PATCH 10/35] Add links for released versions in compat table (#336) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b78ffb4c5fd..6b59f99a5a5 100644 --- a/README.md +++ b/README.md @@ -86,8 +86,8 @@ OpenAPI Generator Version | Release Date | OpenAPI Spec compatibility | Notes 4.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.0.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes (no fallback) 3.1.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.1.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release with breaking changes (with fallbacks) 3.0.2 (current master, upcoming release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.0.2-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, -3.0.1 | 11.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release -3.0.0 | 01.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | First release with breaking changes +[3.0.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.1) | 11.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release +[3.0.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.0) | 01.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | First release with breaking changes ### [1.2 - Artifacts on Maven Central](#table-of-contents) From 74914b63132518fa5cdefc406c09109de2c9b798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bresson?= Date: Mon, 18 Jun 2018 07:19:53 +0200 Subject: [PATCH 11/35] Prepare release 3.0.2 (#337) --- CI/pom.xml.bash | 2 +- CI/pom.xml.circleci | 2 +- CI/pom.xml.circleci.java7 | 2 +- CI/pom.xml.ios | 2 +- README.md | 4 ++-- modules/openapi-generator-cli/pom.xml | 2 +- modules/openapi-generator-gradle-plugin/gradle.properties | 2 +- modules/openapi-generator-gradle-plugin/pom.xml | 2 +- modules/openapi-generator-maven-plugin/pom.xml | 2 +- modules/openapi-generator-online/Dockerfile | 2 +- modules/openapi-generator-online/pom.xml | 2 +- modules/openapi-generator/pom.xml | 2 +- pom.xml | 2 +- shippable.yml | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CI/pom.xml.bash b/CI/pom.xml.bash index 65f0a63a6c3..284846abd22 100644 --- a/CI/pom.xml.bash +++ b/CI/pom.xml.bash @@ -9,7 +9,7 @@ openapi-generator-project pom openapi-generator-project - 3.0.2-SNAPSHOT + 3.0.2 https://github.com/openapi-tools/openapi-generator scm:git:git@github.com:openapi-tools/openapi-generator.git diff --git a/CI/pom.xml.circleci b/CI/pom.xml.circleci index 01aae6a5f18..29b361efff0 100644 --- a/CI/pom.xml.circleci +++ b/CI/pom.xml.circleci @@ -10,7 +10,7 @@ openapi-generator-project pom openapi-generator-project - 3.0.2-SNAPSHOT + 3.0.2 https://github.com/openapitools/openapi-generator scm:git:git@github.com:openapitools/openapi-generator.git diff --git a/CI/pom.xml.circleci.java7 b/CI/pom.xml.circleci.java7 index 1cf4d90e80f..085a419756c 100644 --- a/CI/pom.xml.circleci.java7 +++ b/CI/pom.xml.circleci.java7 @@ -10,7 +10,7 @@ openapi-generator-project pom openapi-generator-project - 3.0.2-SNAPSHOT + 3.0.2 https://github.com/openapitools/openapi-generator scm:git:git@github.com:openapitools/openapi-generator.git diff --git a/CI/pom.xml.ios b/CI/pom.xml.ios index ad7e1d409b5..6727589f71c 100644 --- a/CI/pom.xml.ios +++ b/CI/pom.xml.ios @@ -9,7 +9,7 @@ openapi-generator-project pom openapi-generator-project - 3.0.2-SNAPSHOT + 3.0.2 https://github.com/openapitools/openapi-generator scm:git:git@github.com:openapitools/openapi-generator.git diff --git a/README.md b/README.md index 6b59f99a5a5..fcf72e2988b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

-[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`3.0.2-SNAPSHOT`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) +[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`3.0.2`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) [![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=master)](https://app.shippable.com/github/OpenAPITools/openapi-generator) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu) @@ -85,7 +85,7 @@ OpenAPI Generator Version | Release Date | OpenAPI Spec compatibility | Notes ---------------------------- | ------------ | -------------------------- | ----- 4.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.0.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes (no fallback) 3.1.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.1.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release with breaking changes (with fallbacks) -3.0.2 (current master, upcoming release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.0.2-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, +3.0.2 (current master, upcoming release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.0.2/)| TBD | 1.0, 1.1, 1.2, [3.0.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.1) | 11.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release [3.0.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.0) | 01.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | First release with breaking changes diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index 72eec343116..f3cf85b0709 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -3,7 +3,7 @@ org.openapitools openapi-generator-project - 3.0.2-SNAPSHOT + 3.0.2 ../.. 4.0.0 diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties index 06fa903c395..2e5eff08b63 100644 --- a/modules/openapi-generator-gradle-plugin/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/gradle.properties @@ -1,4 +1,4 @@ -openApiGeneratorVersion=3.0.2-SNAPSHOT +openApiGeneratorVersion=3.0.2 # BEGIN placeholders # these are just placeholders to allow contributors to build directly diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index 6a5d4f499c4..77f1d992e46 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -3,7 +3,7 @@ org.openapitools openapi-generator-project - 3.0.2-SNAPSHOT + 3.0.2 ../.. 4.0.0 diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index 4c86fd88928..8223fe7b78a 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 3.0.2-SNAPSHOT + 3.0.2 ../.. openapi-generator-maven-plugin diff --git a/modules/openapi-generator-online/Dockerfile b/modules/openapi-generator-online/Dockerfile index 3063a9c3e8f..cafa7d2363e 100644 --- a/modules/openapi-generator-online/Dockerfile +++ b/modules/openapi-generator-online/Dockerfile @@ -2,7 +2,7 @@ FROM openjdk:8-jre-alpine WORKDIR /generator -COPY target/openapi-generator-online-3.0.2-SNAPSHOT.jar /generator/openapi-generator-online.jar +COPY target/openapi-generator-online-3.0.2.jar /generator/openapi-generator-online.jar ENV GENERATOR_HOST=http://localhost diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml index b3ce2817cc6..83ef07904d2 100644 --- a/modules/openapi-generator-online/pom.xml +++ b/modules/openapi-generator-online/pom.xml @@ -3,7 +3,7 @@ org.openapitools openapi-generator-project - 3.0.2-SNAPSHOT + 3.0.2 ../.. openapi-generator-online diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index 10af7f48fe7..267afed90c6 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -3,7 +3,7 @@ org.openapitools openapi-generator-project - 3.0.2-SNAPSHOT + 3.0.2 ../.. 4.0.0 diff --git a/pom.xml b/pom.xml index e52007824c9..f5427e61bb6 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ openapi-generator-project pom openapi-generator-project - 3.0.2-SNAPSHOT + 3.0.2 https://github.com/openapitools/openapi-generator scm:git:git@github.com:openapitools/openapi-generator.git diff --git a/shippable.yml b/shippable.yml index 937c34b9ff3..74094c297d7 100644 --- a/shippable.yml +++ b/shippable.yml @@ -12,7 +12,7 @@ build: ci: - mvn --quiet clean install # ensure all modifications created by 'mature' generators are in the git repo - - ./bin/utils/ensure-up-to-date + # - ./bin/utils/ensure-up-to-date # prepare environment for tests - sudo apt-get update -qq # install stack From 9511586f0785d46eb9b9088eff45f2c15f098b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bresson?= Date: Mon, 18 Jun 2018 09:32:11 +0200 Subject: [PATCH 12/35] Prepare 3.0.3-SNAPSHOT (#338) --- .travis.yml | 2 +- CI/pom.xml.bash | 2 +- CI/pom.xml.circleci | 2 +- CI/pom.xml.circleci.java7 | 2 +- CI/pom.xml.ios | 2 +- README.md | 9 +++++---- modules/openapi-generator-cli/pom.xml | 2 +- modules/openapi-generator-gradle-plugin/README.adoc | 2 +- .../openapi-generator-gradle-plugin/gradle.properties | 2 +- modules/openapi-generator-gradle-plugin/pom.xml | 2 +- .../samples/local-spec/README.md | 2 +- modules/openapi-generator-maven-plugin/README.md | 2 +- modules/openapi-generator-maven-plugin/pom.xml | 2 +- modules/openapi-generator-online/Dockerfile | 2 +- modules/openapi-generator-online/pom.xml | 2 +- modules/openapi-generator/pom.xml | 2 +- pom.xml | 2 +- .../petstore/java/feign/.openapi-generator/VERSION | 2 +- .../java/google-api-client/.openapi-generator/VERSION | 2 +- .../petstore/java/jersey1/.openapi-generator/VERSION | 2 +- .../java/jersey2-java6/.openapi-generator/VERSION | 2 +- .../java/jersey2-java8/.openapi-generator/VERSION | 2 +- .../petstore/java/jersey2/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../petstore/java/okhttp-gson/.openapi-generator/VERSION | 2 +- .../java/rest-assured/.openapi-generator/VERSION | 2 +- .../petstore/java/resteasy/.openapi-generator/VERSION | 2 +- .../java/resttemplate-withXml/.openapi-generator/VERSION | 2 +- .../java/resttemplate/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit/.openapi-generator/VERSION | 2 +- .../java/retrofit2-play24/.openapi-generator/VERSION | 2 +- .../java/retrofit2-play25/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2rx/.openapi-generator/VERSION | 2 +- .../java/retrofit2rx2/.openapi-generator/VERSION | 2 +- .../petstore/java/vertx/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-string/.openapi-generator/VERSION | 2 +- .../kotlin-threetenbp/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin/.openapi-generator/VERSION | 2 +- samples/client/petstore/php/.openapi-generator/VERSION | 2 +- .../php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php | 2 +- .../lib/Api/FakeClassnameTags123Api.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/PetApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/UserApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/ApiException.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Configuration.php | 2 +- .../php/OpenAPIClient-php/lib/HeaderSelector.php | 2 +- .../lib/Model/AdditionalPropertiesClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Animal.php | 2 +- .../php/OpenAPIClient-php/lib/Model/AnimalFarm.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ApiResponse.php | 2 +- .../lib/Model/ArrayOfArrayOfNumberOnly.php | 2 +- .../OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ArrayTest.php | 2 +- .../php/OpenAPIClient-php/lib/Model/Capitalization.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Cat.php | 2 +- .../php/OpenAPIClient-php/lib/Model/Category.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ClassModel.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Client.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Dog.php | 2 +- .../php/OpenAPIClient-php/lib/Model/EnumArrays.php | 2 +- .../php/OpenAPIClient-php/lib/Model/EnumClass.php | 2 +- .../php/OpenAPIClient-php/lib/Model/EnumTest.php | 2 +- .../php/OpenAPIClient-php/lib/Model/FormatTest.php | 2 +- .../php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/MapTest.php | 2 +- .../MixedPropertiesAndAdditionalPropertiesClass.php | 2 +- .../php/OpenAPIClient-php/lib/Model/Model200Response.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ModelInterface.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ModelList.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ModelReturn.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Name.php | 2 +- .../php/OpenAPIClient-php/lib/Model/NumberOnly.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Order.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterComposite.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterEnum.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Pet.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 2 +- .../php/OpenAPIClient-php/lib/Model/SpecialModelName.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Tag.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/User.php | 2 +- .../php/OpenAPIClient-php/lib/ObjectSerializer.php | 2 +- .../OpenAPIClient-php/test/Api/AnotherFakeApiTest.php | 2 +- .../php/OpenAPIClient-php/test/Api/FakeApiTest.php | 2 +- .../test/Api/FakeClassnameTags123ApiTest.php | 2 +- .../php/OpenAPIClient-php/test/Api/PetApiTest.php | 2 +- .../php/OpenAPIClient-php/test/Api/StoreApiTest.php | 2 +- .../php/OpenAPIClient-php/test/Api/UserApiTest.php | 2 +- .../test/Model/AdditionalPropertiesClassTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/AnimalFarmTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/AnimalTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ApiResponseTest.php | 2 +- .../test/Model/ArrayOfArrayOfNumberOnlyTest.php | 2 +- .../test/Model/ArrayOfNumberOnlyTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ArrayTestTest.php | 2 +- .../OpenAPIClient-php/test/Model/CapitalizationTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/CatTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/CategoryTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ClassModelTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ClientTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/DogTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/EnumArraysTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/EnumClassTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/EnumTestTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/FormatTestTest.php | 2 +- .../OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/MapTestTest.php | 2 +- .../MixedPropertiesAndAdditionalPropertiesClassTest.php | 2 +- .../test/Model/Model200ResponseTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ModelListTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ModelReturnTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/NameTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/NumberOnlyTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/OrderTest.php | 2 +- .../OpenAPIClient-php/test/Model/OuterCompositeTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/OuterEnumTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/PetTest.php | 2 +- .../OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php | 2 +- .../test/Model/SpecialModelNameTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/TagTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/UserTest.php | 2 +- samples/client/petstore/ruby/.openapi-generator/VERSION | 2 +- samples/client/petstore/ruby/lib/petstore.rb | 2 +- .../petstore/ruby/lib/petstore/api/another_fake_api.rb | 2 +- .../client/petstore/ruby/lib/petstore/api/fake_api.rb | 2 +- .../ruby/lib/petstore/api/fake_classname_tags123_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/pet_api.rb | 2 +- .../client/petstore/ruby/lib/petstore/api/store_api.rb | 2 +- .../client/petstore/ruby/lib/petstore/api/user_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api_client.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api_error.rb | 2 +- .../client/petstore/ruby/lib/petstore/configuration.rb | 2 +- .../lib/petstore/models/additional_properties_class.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/animal.rb | 2 +- .../petstore/ruby/lib/petstore/models/animal_farm.rb | 2 +- .../petstore/ruby/lib/petstore/models/api_response.rb | 2 +- .../lib/petstore/models/array_of_array_of_number_only.rb | 2 +- .../ruby/lib/petstore/models/array_of_number_only.rb | 2 +- .../petstore/ruby/lib/petstore/models/array_test.rb | 2 +- .../petstore/ruby/lib/petstore/models/capitalization.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/cat.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/category.rb | 2 +- .../petstore/ruby/lib/petstore/models/class_model.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/client.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/dog.rb | 2 +- .../petstore/ruby/lib/petstore/models/enum_arrays.rb | 2 +- .../petstore/ruby/lib/petstore/models/enum_class.rb | 2 +- .../petstore/ruby/lib/petstore/models/enum_test.rb | 2 +- .../petstore/ruby/lib/petstore/models/format_test.rb | 2 +- .../ruby/lib/petstore/models/has_only_read_only.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/list.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/map_test.rb | 2 +- .../mixed_properties_and_additional_properties_class.rb | 2 +- .../ruby/lib/petstore/models/model200_response.rb | 2 +- .../petstore/ruby/lib/petstore/models/model_return.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/name.rb | 2 +- .../petstore/ruby/lib/petstore/models/number_only.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/order.rb | 2 +- .../petstore/ruby/lib/petstore/models/outer_composite.rb | 2 +- .../petstore/ruby/lib/petstore/models/outer_enum.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/pet.rb | 2 +- .../petstore/ruby/lib/petstore/models/read_only_first.rb | 2 +- .../ruby/lib/petstore/models/special_model_name.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/tag.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/user.rb | 2 +- samples/client/petstore/ruby/lib/petstore/version.rb | 2 +- samples/client/petstore/ruby/petstore.gemspec | 2 +- .../petstore/spring-cloud/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/spring-stubs/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../client/petstore/php/.openapi-generator/VERSION | 2 +- .../php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php | 2 +- .../lib/Api/FakeClassnameTags123Api.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/PetApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/UserApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/ApiException.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Configuration.php | 2 +- .../php/OpenAPIClient-php/lib/HeaderSelector.php | 2 +- .../lib/Model/AdditionalPropertiesClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Animal.php | 2 +- .../php/OpenAPIClient-php/lib/Model/AnimalFarm.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ApiResponse.php | 2 +- .../lib/Model/ArrayOfArrayOfNumberOnly.php | 2 +- .../OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ArrayTest.php | 2 +- .../php/OpenAPIClient-php/lib/Model/Capitalization.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Cat.php | 2 +- .../php/OpenAPIClient-php/lib/Model/Category.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ClassModel.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Client.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Dog.php | 2 +- .../php/OpenAPIClient-php/lib/Model/EnumArrays.php | 2 +- .../php/OpenAPIClient-php/lib/Model/EnumClass.php | 2 +- .../php/OpenAPIClient-php/lib/Model/EnumTest.php | 2 +- .../php/OpenAPIClient-php/lib/Model/FormatTest.php | 2 +- .../php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/MapTest.php | 2 +- .../MixedPropertiesAndAdditionalPropertiesClass.php | 2 +- .../php/OpenAPIClient-php/lib/Model/Model200Response.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ModelInterface.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ModelList.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ModelReturn.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Name.php | 2 +- .../php/OpenAPIClient-php/lib/Model/NumberOnly.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Order.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterComposite.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterEnum.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Pet.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 2 +- .../php/OpenAPIClient-php/lib/Model/SpecialModelName.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Tag.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/User.php | 2 +- .../php/OpenAPIClient-php/lib/ObjectSerializer.php | 2 +- .../OpenAPIClient-php/test/Api/AnotherFakeApiTest.php | 2 +- .../php/OpenAPIClient-php/test/Api/FakeApiTest.php | 2 +- .../test/Api/FakeClassnameTags123ApiTest.php | 2 +- .../php/OpenAPIClient-php/test/Api/PetApiTest.php | 2 +- .../php/OpenAPIClient-php/test/Api/StoreApiTest.php | 2 +- .../php/OpenAPIClient-php/test/Api/UserApiTest.php | 2 +- .../test/Model/AdditionalPropertiesClassTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/AnimalFarmTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/AnimalTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ApiResponseTest.php | 2 +- .../test/Model/ArrayOfArrayOfNumberOnlyTest.php | 2 +- .../test/Model/ArrayOfNumberOnlyTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ArrayTestTest.php | 2 +- .../OpenAPIClient-php/test/Model/CapitalizationTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/CatTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/CategoryTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ClassModelTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ClientTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/DogTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/EnumArraysTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/EnumClassTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/EnumTestTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/FormatTestTest.php | 2 +- .../OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/MapTestTest.php | 2 +- .../MixedPropertiesAndAdditionalPropertiesClassTest.php | 2 +- .../test/Model/Model200ResponseTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ModelListTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ModelReturnTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/NameTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/NumberOnlyTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/OrderTest.php | 2 +- .../OpenAPIClient-php/test/Model/OuterCompositeTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/OuterEnumTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/PetTest.php | 2 +- .../OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php | 2 +- .../test/Model/SpecialModelNameTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/TagTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/UserTest.php | 2 +- .../.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-non-spring-app/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs-cxf/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-datelib-j8/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/default/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/eap-java8/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/eap-joda/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/eap/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/joda/.openapi-generator/VERSION | 2 +- .../jaxrs-spec-interface/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-spec/.openapi-generator/VERSION | 2 +- .../jaxrs/jersey1-useTags/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs/jersey1/.openapi-generator/VERSION | 2 +- .../jaxrs/jersey2-useTags/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs/jersey2/.openapi-generator/VERSION | 2 +- .../server/petstore/php-lumen/.openapi-generator/VERSION | 2 +- .../server/petstore/php-slim/.openapi-generator/VERSION | 2 +- .../petstore/php-symfony/.openapi-generator/VERSION | 2 +- .../server/petstore/php-ze-ph/.openapi-generator/VERSION | 2 +- .../spring-mvc-j8-async/.openapi-generator/VERSION | 2 +- .../main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/spring-mvc/.openapi-generator/VERSION | 2 +- .../main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-beanvalidation/.openapi-generator/VERSION | 2 +- .../main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-delegate-j8/.openapi-generator/VERSION | 2 +- .../main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-delegate/.openapi-generator/VERSION | 2 +- .../main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-reactive/.openapi-generator/VERSION | 2 +- .../main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-useoptional/.openapi-generator/VERSION | 2 +- .../main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot/.openapi-generator/VERSION | 2 +- .../main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- shippable.yml | 2 +- 352 files changed, 356 insertions(+), 355 deletions(-) diff --git a/.travis.yml b/.travis.yml index 80f8f5fd30f..fd791ca4330 100644 --- a/.travis.yml +++ b/.travis.yml @@ -112,7 +112,7 @@ after_success: ./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="${TRAVIS_BUILD_DIR}/sec.gpg" -PossrhUsername="${SONATYPE_USERNAME}" -PossrhPassword="${SONATYPE_PASSWORD}" uploadArchives --no-daemon; echo "Finished ./gradlew uploadArchives"; popd; - else + elif ([ "$TRAVIS_BRANCH" == "3.1.x" ] || [ "$TRAVIS_BRANCH" == "4.0.x" ]) ; then mvn clean deploy --settings CI/settings.xml; echo "Finished mvn clean deploy for $TRAVIS_BRANCH"; pushd .; diff --git a/CI/pom.xml.bash b/CI/pom.xml.bash index 284846abd22..16ccb163c55 100644 --- a/CI/pom.xml.bash +++ b/CI/pom.xml.bash @@ -9,7 +9,7 @@ openapi-generator-project pom openapi-generator-project - 3.0.2 + 3.0.3-SNAPSHOT https://github.com/openapi-tools/openapi-generator scm:git:git@github.com:openapi-tools/openapi-generator.git diff --git a/CI/pom.xml.circleci b/CI/pom.xml.circleci index 29b361efff0..1d663a33a39 100644 --- a/CI/pom.xml.circleci +++ b/CI/pom.xml.circleci @@ -10,7 +10,7 @@ openapi-generator-project pom openapi-generator-project - 3.0.2 + 3.0.3-SNAPSHOT https://github.com/openapitools/openapi-generator scm:git:git@github.com:openapitools/openapi-generator.git diff --git a/CI/pom.xml.circleci.java7 b/CI/pom.xml.circleci.java7 index 085a419756c..0315b2cd8c7 100644 --- a/CI/pom.xml.circleci.java7 +++ b/CI/pom.xml.circleci.java7 @@ -10,7 +10,7 @@ openapi-generator-project pom openapi-generator-project - 3.0.2 + 3.0.3-SNAPSHOT https://github.com/openapitools/openapi-generator scm:git:git@github.com:openapitools/openapi-generator.git diff --git a/CI/pom.xml.ios b/CI/pom.xml.ios index 6727589f71c..24a69f1b6d3 100644 --- a/CI/pom.xml.ios +++ b/CI/pom.xml.ios @@ -9,7 +9,7 @@ openapi-generator-project pom openapi-generator-project - 3.0.2 + 3.0.3-SNAPSHOT https://github.com/openapitools/openapi-generator scm:git:git@github.com:openapitools/openapi-generator.git diff --git a/README.md b/README.md index fcf72e2988b..07bb58910bc 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@
-[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`3.0.2`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) +[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`3.0.3-SNAPSHOT`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) [![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=master)](https://app.shippable.com/github/OpenAPITools/openapi-generator) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu) @@ -85,7 +85,8 @@ OpenAPI Generator Version | Release Date | OpenAPI Spec compatibility | Notes ---------------------------- | ------------ | -------------------------- | ----- 4.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.0.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes (no fallback) 3.1.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.1.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release with breaking changes (with fallbacks) -3.0.2 (current master, upcoming release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.0.2/)| TBD | 1.0, 1.1, 1.2, +3.0.3 (current master, upcoming release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.0.3-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, +[3.0.2](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.2) | 18.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release [3.0.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.1) | 11.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release [3.0.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.0) | 01.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | First release with breaking changes @@ -143,12 +144,12 @@ JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generato For **Mac/Linux** users: ```sh -wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.1/openapi-generator-cli-3.0.1.jar -O openapi-generator-cli.jar +wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.2/openapi-generator-cli-3.0.2.jar -O openapi-generator-cli.jar ``` For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. ``` -Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.1/openapi-generator-cli-3.0.1.jar +Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.2/openapi-generator-cli-3.0.2.jar ``` After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage. diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index f3cf85b0709..1d897ca1c43 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -3,7 +3,7 @@ org.openapitools openapi-generator-project - 3.0.2 + 3.0.3-SNAPSHOT ../.. 4.0.0 diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc index 2abe081e5ff..ee2879db4b2 100644 --- a/modules/openapi-generator-gradle-plugin/README.adoc +++ b/modules/openapi-generator-gradle-plugin/README.adoc @@ -34,7 +34,7 @@ buildscript { mavenCentral() } dependencies { - classpath "org.openapitools:openapi-generator-gradle-plugin:3.0.1" + classpath "org.openapitools:openapi-generator-gradle-plugin:3.0.2" } } diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties index 2e5eff08b63..99cfada5e57 100644 --- a/modules/openapi-generator-gradle-plugin/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/gradle.properties @@ -1,4 +1,4 @@ -openApiGeneratorVersion=3.0.2 +openApiGeneratorVersion=3.0.3-SNAPSHOT # BEGIN placeholders # these are just placeholders to allow contributors to build directly diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index 77f1d992e46..4e85925416a 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -3,7 +3,7 @@ org.openapitools openapi-generator-project - 3.0.2 + 3.0.3-SNAPSHOT ../.. 4.0.0 diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md index d2223673c2b..ed9369357d8 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md @@ -16,5 +16,5 @@ gradle buildGoSdk The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example: ```bash -gradle -PopenApiGeneratorVersion=3.0.1 openApiValidate +gradle -PopenApiGeneratorVersion=3.0.2 openApiValidate ``` diff --git a/modules/openapi-generator-maven-plugin/README.md b/modules/openapi-generator-maven-plugin/README.md index e2326f863d6..b544a6c8a2a 100644 --- a/modules/openapi-generator-maven-plugin/README.md +++ b/modules/openapi-generator-maven-plugin/README.md @@ -11,7 +11,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase) org.openapitools openapi-generator-maven-plugin - 3.0.1 + 3.0.2 diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index 8223fe7b78a..4bc7e20ab50 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 3.0.2 + 3.0.3-SNAPSHOT ../.. openapi-generator-maven-plugin diff --git a/modules/openapi-generator-online/Dockerfile b/modules/openapi-generator-online/Dockerfile index cafa7d2363e..48c635efacf 100644 --- a/modules/openapi-generator-online/Dockerfile +++ b/modules/openapi-generator-online/Dockerfile @@ -2,7 +2,7 @@ FROM openjdk:8-jre-alpine WORKDIR /generator -COPY target/openapi-generator-online-3.0.2.jar /generator/openapi-generator-online.jar +COPY target/openapi-generator-online-3.0.3-SNAPSHOT.jar /generator/openapi-generator-online.jar ENV GENERATOR_HOST=http://localhost diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml index 83ef07904d2..ca7df291fa0 100644 --- a/modules/openapi-generator-online/pom.xml +++ b/modules/openapi-generator-online/pom.xml @@ -3,7 +3,7 @@ org.openapitools openapi-generator-project - 3.0.2 + 3.0.3-SNAPSHOT ../.. openapi-generator-online diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index 267afed90c6..7ddbfd290f3 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -3,7 +3,7 @@ org.openapitools openapi-generator-project - 3.0.2 + 3.0.3-SNAPSHOT ../.. 4.0.0 diff --git a/pom.xml b/pom.xml index f5427e61bb6..f0643cd3662 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ openapi-generator-project pom openapi-generator-project - 3.0.2 + 3.0.3-SNAPSHOT https://github.com/openapitools/openapi-generator scm:git:git@github.com:openapitools/openapi-generator.git diff --git a/samples/client/petstore/java/feign/.openapi-generator/VERSION b/samples/client/petstore/java/feign/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/feign/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/jersey2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION +++ b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/retrofit/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/vertx/.openapi-generator/VERSION b/samples/client/petstore/java/vertx/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/java/vertx/.openapi-generator/VERSION +++ b/samples/client/petstore/java/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin/.openapi-generator/VERSION b/samples/client/petstore/kotlin/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php/.openapi-generator/VERSION b/samples/client/petstore/php/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/php/.openapi-generator/VERSION +++ b/samples/client/petstore/php/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index 07db904370c..c8d5273a038 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 90e9ba30460..3409d09c62d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 34585a87cb6..911d658817c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index 05400c03e35..470cb1ca35e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index 648d872e04a..6cfeeb7a629 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index 2c05b7c521c..14668618aa4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index c8df3a1c456..a0a5b4d1caf 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index de4f29cca87..b58313a4220 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index 39bfc9e5a54..dcf3363c78b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index d14350fc2f9..ae5f3dc3de8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index 0afe71a6fdf..16aef52de05 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php index 92b6da41a7f..78c16fa1bb6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index b33a84b4a82..b8764bf3724 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index faaf0a5c98c..1fdcfffbeed 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index 2ceb2f4239a..392af57b47e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index dd9ec8077df..2a11f3de6e1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index 213a79b0c52..ff26cc123c0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index 24afb981960..665cc61a838 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 63fd421498f..e90f161fe02 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index 1296f22a7de..2dd300ddc45 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index 8b2e75e075f..82e0ee40298 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index 3aa6ae26413..c404888a0eb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index 934b95e7fb4..f12665f5e84 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php index 904cdc18036..e44e9eb161d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index 9437b3c2843..561f5593bcf 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index 5a812a6f712..265daee0ddb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index cd95c541f96..ba3d46a7238 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index 9dda9ad7b58..e0c38408559 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 1c4354e5530..920dbcf9421 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index 1f7f3d188f9..d4d0d61eab4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php index 3d5b27d5d36..c0d21323450 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index 0c387665068..8798057ca34 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index b586ae0523a..9c1d061f252 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index fdfd009209c..d42800f3a26 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index 4720e71b807..4a7c1fcc7eb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index a1f42601836..a88c4e6313a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 8d5a5b9df06..c2a7377ffa0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php index 1acb7f54d20..59c373db531 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index 713fd8d59d9..031a73710ef 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 6858e634781..ff00acc3059 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index 5a61b4f9aea..f95ca0cc817 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 1516326159f..bb725bce935 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 3679309dc83..ec4001d7182 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index db5916b2808..52fc6524d17 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php index 0dad0cd8a26..efb1f5fcc4f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php index c19ad802914..831c2c685f6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php index f7b5550d154..d45a51364a6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php index 27de7c0d8ab..0f1081c6053 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php index 633de8b71ea..668501cbf5d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php index 84f563ab326..38b46ff60d2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php index f46c4ec9b5a..367699196e6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php index 79c6a1ac5a5..9a79dce72cb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php index fbd911191e8..087bf5139b9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php index 470c1ff741d..aa4ec27b52c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php index 3b2d11224d6..6e82cd038de 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php index 716e2eb49cf..da50230be50 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php index 90a29a4a45b..6ffa97a2f5e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php index 3092d0d1435..27415e82136 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php index 238f8de40d8..1f8efed8125 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php index 3df3150c891..36e5c38b5c4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php index 25daa930ca1..fb437b3b8c0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php index e648b1e1c0e..77efed5cb06 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php index a32faa91a4f..e6f29e2cec7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php index 321227269cd..9a8f9d10ef3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php index d9b9b5f05e7..a9d6cd7fac6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php index 324735bb08a..eefd2eb83f5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php index 078cf09064e..c5161755b52 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php index 61c2864920e..bb698360fff 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php index 15229ac69ec..c3f347e1bda 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php index 18c5ebbcdcc..35d7a9f5205 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php index 557069b814c..532d8251699 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php index 53f1c67e169..66650ee5bf5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php index 325e694ffcb..226a12786fe 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php index 0b79c41ddd2..978ee08944b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php index f6b0d481a72..479ed393069 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php index 137347b2b2a..953fe0a7654 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php index 9601db42a06..736bcebb1c7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php index a32b9bccaa8..fd20e51d581 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php index a67a7dbfd60..e6b5d5e9742 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php index ff2852af02b..226fb97b060 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php index 93745c7a00a..17baa78ef02 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php index b811e675777..68734c49de2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php index be5e689b825..3e4a4822df6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/client/petstore/ruby/.openapi-generator/VERSION b/samples/client/petstore/ruby/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/ruby/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 09bcfeb519b..2a86f13e4d9 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb index 737258fc6ae..187b736a24d 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index 37fce044295..0946ee27cea 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb index 5168dc4bc3c..d0864b4b7ab 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb index ccd79c8fc38..1f9a68f2a70 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb index 7793872ef52..49da8298567 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb index 311cbf8bb2a..5ecbdfd50e2 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index fc2a4a672a1..4e771e8a2b3 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_error.rb b/samples/client/petstore/ruby/lib/petstore/api_error.rb index 3ca90109abd..7fcd202fce2 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index d9e84be0f36..9ff22371967 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index 0ec9d24fd6c..3ddfd105b77 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb index 8553b0190f5..a0c80f7c9ae 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb b/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb index 1dec9b52862..bb616184137 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb index 7438394bd82..e9362b5f0cb 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index 371ff41cc82..203e2ac4e4f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index 3774811858d..a2a00019fdf 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb index 13a4ce83d11..e5a3dca4283 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb index c5ec7cf7ebf..b38681f0a48 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb index 5b8f3f458a1..c98a8a1bf0b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb index 3f2b1c4d872..5ef3ab0c05f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb index e6621d49add..3bfd6c21c51 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/client.rb b/samples/client/petstore/ruby/lib/petstore/models/client.rb index e82c43b26f5..b2132d0b342 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb index 6c044252baf..8a22808a792 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index 288745d388d..bd96b8c9415 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb index a880bf01535..52c11823e70 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb index ad82902877d..2917701281f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb index 49105b1267c..fb6ec93fbb1 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index 48c7769a973..fefc61d11fc 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/list.rb b/samples/client/petstore/ruby/lib/petstore/models/list.rb index 13041599219..565efc08f79 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb index 7ebba067fb6..080986f43c9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 82e0d2716de..c2708ce6e66 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb index 64cdebc3fa4..9461275477e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb index 32d74e8ab03..33db52e9b8f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb index cdb73e06916..6ec761db2cd 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb index 21391b0fa09..9cb549a9bf6 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb index c0132b5a5a6..15c5bf89e91 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb index f400b9183f6..023acf4fbde 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb index 6b276f02809..d85af07c524 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb index 4797cef3119..1bc456006fb 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb index 2155aa9505f..b5da2959fa7 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb index dbaf27758a7..f5992f5f356 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb index 6d063274f8b..d8a5a00cf60 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb index d346de90974..3d890741aa4 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/version.rb b/samples/client/petstore/ruby/lib/petstore/version.rb index df39e054040..1afecd51de6 100644 --- a/samples/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/client/petstore/ruby/lib/petstore/version.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/petstore.gemspec b/samples/client/petstore/ruby/petstore.gemspec index 0efd72d011a..4c466dd232a 100644 --- a/samples/client/petstore/ruby/petstore.gemspec +++ b/samples/client/petstore/ruby/petstore.gemspec @@ -8,7 +8,7 @@ OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.2-SNAPSHOT +OpenAPI Generator version: 3.0.3-SNAPSHOT =end diff --git a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index 774c99d205b..896fb02af72 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index 4abca1e5f2a..f175d2a42ad 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index 25f0e1011ef..1a18bd11998 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index 8afb080d947..5d11918504b 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index 144108e0489..9f4feecd01a 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index eb02b7458e0..ff7b38263c8 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/openapi3/client/petstore/php/.openapi-generator/VERSION b/samples/openapi3/client/petstore/php/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/openapi3/client/petstore/php/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/php/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index 07db904370c..c8d5273a038 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index b0b3db3012b..a5d1a75aa22 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 34585a87cb6..911d658817c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index 05400c03e35..470cb1ca35e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index 07f3bcd9f57..58233ffb6b2 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index f685a03029f..346ad00fcd7 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index c8df3a1c456..a0a5b4d1caf 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index de4f29cca87..b58313a4220 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index 39bfc9e5a54..dcf3363c78b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index d14350fc2f9..ae5f3dc3de8 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index 0afe71a6fdf..16aef52de05 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php index 92b6da41a7f..78c16fa1bb6 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index b33a84b4a82..b8764bf3724 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index faaf0a5c98c..1fdcfffbeed 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index 2ceb2f4239a..392af57b47e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index dd9ec8077df..2a11f3de6e1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index 213a79b0c52..ff26cc123c0 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index 24afb981960..665cc61a838 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 63fd421498f..e90f161fe02 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index 1296f22a7de..2dd300ddc45 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index 8b2e75e075f..82e0ee40298 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index 3aa6ae26413..c404888a0eb 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index 934b95e7fb4..f12665f5e84 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php index 904cdc18036..e44e9eb161d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index 9437b3c2843..561f5593bcf 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index 1f2a22ca71c..07005c3df40 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index cd95c541f96..ba3d46a7238 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index 9dda9ad7b58..e0c38408559 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 1c4354e5530..920dbcf9421 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index 1f7f3d188f9..d4d0d61eab4 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php index 3d5b27d5d36..c0d21323450 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index 0c387665068..8798057ca34 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index b586ae0523a..9c1d061f252 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 6bef54db97a..50f2f974d95 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index 4720e71b807..4a7c1fcc7eb 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index a1f42601836..a88c4e6313a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 8d5a5b9df06..c2a7377ffa0 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php index 1acb7f54d20..59c373db531 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index 713fd8d59d9..031a73710ef 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 6858e634781..ff00acc3059 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index af6b453c730..4ed4aac61c8 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 1516326159f..bb725bce935 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 3679309dc83..ec4001d7182 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index db5916b2808..52fc6524d17 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php index 0dad0cd8a26..efb1f5fcc4f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php index fa88b0b7ea1..28e53278f60 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php index f7b5550d154..d45a51364a6 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php index 27de7c0d8ab..0f1081c6053 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php index 633de8b71ea..668501cbf5d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php index 84f563ab326..38b46ff60d2 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php index f46c4ec9b5a..367699196e6 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php index 79c6a1ac5a5..9a79dce72cb 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php index fbd911191e8..087bf5139b9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php index 470c1ff741d..aa4ec27b52c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php index 3b2d11224d6..6e82cd038de 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php index 716e2eb49cf..da50230be50 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php index 90a29a4a45b..6ffa97a2f5e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php index 3092d0d1435..27415e82136 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php index 238f8de40d8..1f8efed8125 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php index 3df3150c891..36e5c38b5c4 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php index 25daa930ca1..fb437b3b8c0 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php index e648b1e1c0e..77efed5cb06 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php index a32faa91a4f..e6f29e2cec7 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php index 321227269cd..9a8f9d10ef3 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php index d9b9b5f05e7..a9d6cd7fac6 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php index 324735bb08a..eefd2eb83f5 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php index 078cf09064e..c5161755b52 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php index 61c2864920e..bb698360fff 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php index 15229ac69ec..c3f347e1bda 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php index 18c5ebbcdcc..35d7a9f5205 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php index 557069b814c..532d8251699 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php index 53f1c67e169..66650ee5bf5 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php index 325e694ffcb..226a12786fe 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php index 0b79c41ddd2..978ee08944b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php index f6b0d481a72..479ed393069 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php index 137347b2b2a..953fe0a7654 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php index 9601db42a06..736bcebb1c7 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php index a32b9bccaa8..fd20e51d581 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php index a67a7dbfd60..e6b5d5e9742 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php index ff2852af02b..226fb97b060 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php index 93745c7a00a..17baa78ef02 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php index b811e675777..68734c49de2 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php index be5e689b825..3e4a4822df6 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.2-SNAPSHOT + * OpenAPI Generator version: 3.0.3-SNAPSHOT */ /** diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-lumen/.openapi-generator/VERSION b/samples/server/petstore/php-lumen/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/php-lumen/.openapi-generator/VERSION +++ b/samples/server/petstore/php-lumen/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-slim/.openapi-generator/VERSION b/samples/server/petstore/php-slim/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/php-slim/.openapi-generator/VERSION +++ b/samples/server/petstore/php-slim/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-symfony/.openapi-generator/VERSION b/samples/server/petstore/php-symfony/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/php-symfony/.openapi-generator/VERSION +++ b/samples/server/petstore/php-symfony/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION b/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION +++ b/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java index 3e14a358b1f..018ec6b3116 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index e057c1a398e..fccd5b762e5 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 9b4ab845fcf..ffc52ee082a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java index b08fc1b3c76..e7a52ac550a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java index 1a5a92ec3c3..b3ca47c6f83 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java index f929898c7b4..08f87ef9658 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java index f1ce8b2275a..8a2d6e46d73 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index 1aa6bb2a4e1..a88e32d6cf4 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e06b69ec78e..b98ac904a92 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java index 8d47a3a9d6d..7d63bc420b3 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java index f8b24358d21..7c2302a18de 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java index 75c1d37122a..6ea4b10cea8 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java index 30cacec0b78..481e407e260 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index 118cbe67190..71dea109bbb 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 90c0f1cadd3..8d5594fd61c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java index 616f6337911..0d6081e3d86 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java index d003a25322e..937f19ffceb 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java index 474c0055c99..971fb6286a2 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java index 30cacec0b78..481e407e260 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 118cbe67190..71dea109bbb 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 90c0f1cadd3..8d5594fd61c 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index 616f6337911..0d6081e3d86 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java index d003a25322e..937f19ffceb 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index 474c0055c99..971fb6286a2 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index 3881b4f6be8..b7c97b058e2 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index e99c73bf776..58d37498311 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f1bdd52568a..e29cbe9af76 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index 67e539fb27c..4e7c03ba98a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java index c72e3a6e377..47828f51138 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index ae94136dad4..d9a9950856b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index 30cacec0b78..481e407e260 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 118cbe67190..71dea109bbb 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 90c0f1cadd3..8d5594fd61c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index 616f6337911..0d6081e3d86 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index d003a25322e..937f19ffceb 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index 474c0055c99..971fb6286a2 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index 3ed7012d6fb..37de57e4262 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 315b3ba8bb6..adb3b874c03 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d99f2a22340..03ee8b6e7bd 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index d7d25b67e24..0c77c3af100 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 4a904b2e1e8..b4f08f7c600 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index 7e377ffbe7a..38c6fe1250f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index 887f2af5d6f..65f258ae85b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 32aca62a51e..3aae8bea82a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 6fddcca4a3b..b50b7f1b88d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index c4ecd1b2c10..2c799a542e9 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index d0f237ff60b..dd9dabe662a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index e9437f61096..a269ee888cf 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index f1ce8b2275a..8a2d6e46d73 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index b057314b0d1..efe8b6a49fd 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e06b69ec78e..b98ac904a92 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index 79346fe033e..b9a6469ab1e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index f8b24358d21..7c2302a18de 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index 75c1d37122a..6ea4b10cea8 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/.openapi-generator/VERSION b/samples/server/petstore/springboot/.openapi-generator/VERSION index 1c00c518154..82602aa4190 100644 --- a/samples/server/petstore/springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.2-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index f1ce8b2275a..8a2d6e46d73 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 38e7113611b..f184edac387 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e06b69ec78e..b98ac904a92 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index 8d47a3a9d6d..7d63bc420b3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index f8b24358d21..7c2302a18de 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 75c1d37122a..6ea4b10cea8 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.2-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/shippable.yml b/shippable.yml index 74094c297d7..937c34b9ff3 100644 --- a/shippable.yml +++ b/shippable.yml @@ -12,7 +12,7 @@ build: ci: - mvn --quiet clean install # ensure all modifications created by 'mature' generators are in the git repo - # - ./bin/utils/ensure-up-to-date + - ./bin/utils/ensure-up-to-date # prepare environment for tests - sudo apt-get update -qq # install stack From 9151f65702764aa6dac275f0fbe7dfa3a9163ca0 Mon Sep 17 00:00:00 2001 From: developersteve Date: Wed, 20 Jun 2018 13:59:25 +1000 Subject: [PATCH 13/35] Adding in Telstra (#357) as a company using openapi-generator --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 07bb58910bc..f5c7c52b393 100644 --- a/README.md +++ b/README.md @@ -413,6 +413,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [GMO Pepabo](https://pepabo.com/en/) - [Raiffeisen Schweiz Genossenschaft](https://www.raiffeisen.ch) - [REST United](https://restunited.com) +- [Telstra](https://dev.telstra.com) - [unblu inc.](https://www.unblu.com/) From 231202d0a3b4602e5b20e853c62a49446c1db200 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Wed, 20 Jun 2018 00:29:17 -0400 Subject: [PATCH 14/35] Initial roadmap (#295) * Initial roadmap --- docs/roadmap.adoc | 79 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 docs/roadmap.adoc diff --git a/docs/roadmap.adoc b/docs/roadmap.adoc new file mode 100644 index 00000000000..e6d1a0af6ac --- /dev/null +++ b/docs/roadmap.adoc @@ -0,0 +1,79 @@ +== Roadmap + +This document lists short-term, medium-term, and long-term goals for the project. + +[NOTE] +==== +These are goals, not necessarily commitments. The sections are not intended to represent exclusive focus during these terms. For example, when you start at a college or university you may have a long-term goal to graduate and a short-term goal to find a job for supplemental income. We will similarly work toward many of our medium-term and long-term goals in the near future as we move toward meeting our short-term goals. +==== + +=== Short-term + +> Usability, stability, and marketing. + +Short term are focused on improving contributor and user productivity (part of this is getting the word out). + +* CLI improvements +** Search functionality (e.g. what generators support retrofit, what generators are available for kotlin) +* Build automation improvements +** Discuss consolidating current third-party build systems +** Investigate custom docker containerization for prepared build environments +** Automated release stability +* General +** OAS3.0 features support: anyOf, oneOf, callbacks, etc +** Consider opt-in telemetry about generators being used, limited to a counter of invocations by generator name). This would allow us to make prioritization decisions based on statistics. +** Code clean up +*** centralize build scripts +*** organize samples/bin scripts according to new generator names +*** consolidate typescript generators +*** jaxrs => use Swagger core v3 (see https://github.com/OpenAPITools/openapi-generator/issues/27[#27]) +* Documentation +** Static pages, preferably on gh-pages, devoted to each generator +** Explain generator options +** Centralized docs on generated code usage/examples/configuration + +=== Medium-term + +> Feature set, well-defined API (code and templates), and extensibility improvements. + +* API +** Typed representation of the model bound to our templates. As it is, everything is treated an an Object, and this can lead to changes in the interface which might be unexpected from the template perspective. +* Feature set (potential generators to add; not an exhaustive list) +** Azure functions (node.js, server) +** Finagle HTTP Client (Scala, client) +** Finagle Http Server (Scala, server) +** Finatra (Scala, server) +** Kotlin Spring MVC/Springboot (server) +** C++ Server, any framework (server) +* General +** Migrate from Maven to Gradle +** Java 9+ support +* Feature set (other options to investigate) +** SPI plugins +*** Templating engine +*** Language extensions +*** Custom extensions (e.g. allowing users to load support for https://github.com/Azure/azure-rest-api-specs[azure-rest-api-specs]) +** Customizable templating engines (handlebars support) +** Unit-testing templates (to previously mentioned explicit type as an interface to the template) +* Reduce coupling +** Make types extending `CodegenConfig` become the generation entrypoint +** Allow current `CodegenConfig` types to define templating engine +** Allow current `CodegenConfig` types to modify workflow (currently encapsulated in `DefaultGenerator` and tightly coupled to the template engine +** Clearer reuse of "language" features, outside of "generator" types. That is, rather than enforcing polymorphic sharing of "language" which currently allows the super type to redefine framework-specific mapping functionality, generators could compose one or more language support types. +* Define template deprecation/removal process + +=== Long-term + +> Expanding tooling offered, integrations, potentially SaaS offering to partially fund efforts. + +* Generator UI wrappers +** Move jimschubert/intellij-swagger-codegen plugin under the org, and rename +** Look into an Eclipse UI wrapper around the generator +** Look at Visual Studio Code (and/or Atom, sublime text) integration +* Provide a native GUI for viewing/editing specs. Most tools are currently geared toward developers, but often times it may be non-technical business users who are interested in an API. +* A paid service (SaaS) for generation may be enticing for some users. Such a service would allow for statistics (mentioned earlier in telemetry) +* Additional tools +** node.js build system(s) integration (grunt/gulp/webpack/etc) +** ruby gem +** others (which may require previously mentioned SaaS API) + From 3c9cf1dcd6f328f9698a70b79fdf8cc56921bc8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bresson?= Date: Wed, 20 Jun 2018 09:40:58 +0200 Subject: [PATCH 15/35] Restore unit test (#346) * Restore test classes to commit 5340c35ce123c18daa82f62131b3d1606bd1ceab * Fix samples/client/petstore/java/feign * Fix samples/client/petstore/java/jersey1 * Fix samples/client/petstore/java/jersey2-java8 * Fix samples/client/petstore/java/jersey2 * Fix samples/client/petstore/java/okhttp-gson * Fix samples/client/petstore/java/resttemplate/src/test/java * Move "StringUtilTest.java" to "samples.ci" and add copy command in *.sh scripts * Fix echo line * Move tests to 'test-manual/common/' * Move "ApiClientTest.java" to "samples.ci" and add copy command in *.sh scripts * Move "ConfigurationTest.java" to "samples.ci" and add copy command in *.sh scripts * Move "auth/ApiKeyAuthTest.java" to "samples.ci" and add copy command in *.sh scripts * Move "auth/HttpBasicAuthTest.java" to "samples.ci" and add copy command in *.sh scripts * Move "model/EnumValueTest.java" to "samples.ci" and add copy command in *.sh scripts * Move "JSONTest.java" to "samples.ci" and add copy command in *.sh scripts * Replace "cp" => "mkdir & cp" * JSONTest.java is java8 specific * Run bin/java-petstore-all.sh * "$_" does not work on Shippable --- .../test-manual/common/ConfigurationTest.java | 15 + .../test-manual/common/StringUtilTest.java | 33 ++ .../test-manual/jersey1/ApiClientTest.java | 292 ++++++++++++++++ .../jersey1/auth/ApiKeyAuthTest.java | 47 +++ .../jersey1/auth/HttpBasicAuthTest.java | 52 +++ .../jersey1/model/EnumValueTest.java | 63 ++++ .../test-manual/jersey2-java8/JSONTest.java | 45 +++ .../test-manual/jersey2/ApiClientTest.java | 250 +++++++++++++ .../java/test-manual/jersey2/JSONTest.java | 58 +++ .../jersey2/auth/ApiKeyAuthTest.java | 47 +++ .../jersey2/auth/HttpBasicAuthTest.java | 52 +++ .../jersey2/model/EnumValueTest.java | 63 ++++ .../okhttp-gson/ApiClientTest.java | 330 ++++++++++++++++++ .../test-manual/okhttp-gson/JSONTest.java | 201 +++++++++++ .../okhttp-gson/auth/ApiKeyAuthTest.java | 76 ++++ .../okhttp-gson/auth/HttpBasicAuthTest.java | 62 ++++ .../okhttp-gson/model/EnumValueTest.java | 56 +++ .../resttemplate/ApiClientTest.java | 254 ++++++++++++++ .../resttemplate/auth/ApiKeyAuthTest.java | 47 +++ .../resttemplate/auth/HttpBasicAuthTest.java | 54 +++ .../resttemplate/model/EnumValueTest.java | 63 ++++ bin/java-petstore-feign.sh | 5 + bin/java-petstore-jersey1.sh | 12 + bin/java-petstore-jersey2-java6.sh | 2 +- bin/java-petstore-jersey2.sh | 13 + bin/java-petstore-okhttp-gson.sh | 13 + bin/java-petstore-resttemplate.sh | 10 + bin/java8-petstore-jersey2.sh | 13 + .../openapitools/client/StringUtilTest.java | 33 ++ .../openapitools/client/ApiClientTest.java | 292 ++++++++++++++++ .../client/ConfigurationTest.java | 15 + .../openapitools/client/StringUtilTest.java | 33 ++ .../client/auth/ApiKeyAuthTest.java | 47 +++ .../client/auth/HttpBasicAuthTest.java | 52 +++ .../client/model/EnumValueTest.java | 63 ++++ .../openapitools/client/ApiClientTest.java | 250 +++++++++++++ .../client/ConfigurationTest.java | 15 + .../org/openapitools/client/JSONTest.java | 45 +++ .../openapitools/client/StringUtilTest.java | 33 ++ .../client/auth/ApiKeyAuthTest.java | 47 +++ .../client/auth/HttpBasicAuthTest.java | 52 +++ .../client/model/EnumValueTest.java | 63 ++++ .../openapitools/client/ApiClientTest.java | 250 +++++++++++++ .../client/ConfigurationTest.java | 15 + .../org/openapitools/client/JSONTest.java | 58 +++ .../openapitools/client/StringUtilTest.java | 33 ++ .../client/auth/ApiKeyAuthTest.java | 47 +++ .../client/auth/HttpBasicAuthTest.java | 52 +++ .../client/model/EnumValueTest.java | 63 ++++ .../openapitools/client/ApiClientTest.java | 330 ++++++++++++++++++ .../client/ConfigurationTest.java | 15 + .../org/openapitools/client/JSONTest.java | 201 +++++++++++ .../openapitools/client/StringUtilTest.java | 33 ++ .../client/auth/ApiKeyAuthTest.java | 76 ++++ .../client/auth/HttpBasicAuthTest.java | 62 ++++ .../client/model/EnumValueTest.java | 56 +++ .../openapitools/client/ApiClientTest.java | 254 ++++++++++++++ .../client/auth/ApiKeyAuthTest.java | 47 +++ .../client/auth/HttpBasicAuthTest.java | 54 +++ .../client/model/EnumValueTest.java | 63 ++++ 60 files changed, 4976 insertions(+), 1 deletion(-) create mode 100644 CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/jersey1/ApiClientTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/ApiKeyAuthTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/HttpBasicAuthTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/jersey1/model/EnumValueTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/jersey2/JSONTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/ApiKeyAuthTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/HttpBasicAuthTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/jersey2/model/EnumValueTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/ApiClientTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/JSONTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/ApiKeyAuthTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/HttpBasicAuthTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/EnumValueTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/resttemplate/ApiClientTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/ApiKeyAuthTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/HttpBasicAuthTest.java create mode 100644 CI/samples.ci/client/petstore/java/test-manual/resttemplate/model/EnumValueTest.java create mode 100644 samples/client/petstore/java/feign/src/test/java/org/openapitools/client/StringUtilTest.java create mode 100644 samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/ApiClientTest.java create mode 100644 samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/ConfigurationTest.java create mode 100644 samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/StringUtilTest.java create mode 100644 samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java create mode 100644 samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java create mode 100644 samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/EnumValueTest.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ConfigurationTest.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/StringUtilTest.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumValueTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/ApiClientTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/ConfigurationTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/JSONTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/StringUtilTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumValueTest.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ConfigurationTest.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/StringUtilTest.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumValueTest.java create mode 100644 samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/ApiClientTest.java create mode 100644 samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java create mode 100644 samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java create mode 100644 samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/EnumValueTest.java diff --git a/CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java b/CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java new file mode 100644 index 00000000000..f05c230dc75 --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java @@ -0,0 +1,15 @@ +package org.openapitools.client; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class ConfigurationTest { + @Test + public void testDefaultApiClient() { + ApiClient apiClient = Configuration.getDefaultApiClient(); + assertNotNull(apiClient); + assertEquals("http://petstore.swagger.io:80/v2", apiClient.getBasePath()); + assertFalse(apiClient.isDebugging()); + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java b/CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java new file mode 100644 index 00000000000..aa7c81759ec --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java @@ -0,0 +1,33 @@ +package org.openapitools.client; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class StringUtilTest { + @Test + public void testContainsIgnoreCase() { + assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "abc")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "ABC")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{"ABC"}, "abc")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, "ABC")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, null)); + + assertFalse(StringUtil.containsIgnoreCase(new String[]{"abc"}, "def")); + assertFalse(StringUtil.containsIgnoreCase(new String[]{}, "ABC")); + assertFalse(StringUtil.containsIgnoreCase(new String[]{}, null)); + } + + @Test + public void testJoin() { + String[] array = {"aa", "bb", "cc"}; + assertEquals("aa,bb,cc", StringUtil.join(array, ",")); + assertEquals("aa, bb, cc", StringUtil.join(array, ", ")); + assertEquals("aabbcc", StringUtil.join(array, "")); + assertEquals("aa bb cc", StringUtil.join(array, " ")); + assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); + + assertEquals("", StringUtil.join(new String[]{}, ",")); + assertEquals("abc", StringUtil.join(new String[]{"abc"}, ",")); + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey1/ApiClientTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey1/ApiClientTest.java new file mode 100644 index 00000000000..a890ead935f --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/jersey1/ApiClientTest.java @@ -0,0 +1,292 @@ +package org.openapitools.client; + +import org.openapitools.client.auth.*; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.*; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class ApiClientTest { + ApiClient apiClient = null; + + @Before + public void setup() { + apiClient = new ApiClient(); + } + + @Test + public void testParseAndFormatDate() { + // default date format + String dateStr = "2015-11-07T03:49:09.356Z"; + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00"))); + + // custom date format: without milli-seconds, custom time zone + DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); + format.setTimeZone(TimeZone.getTimeZone("GMT+10")); + apiClient.setDateFormat(format); + dateStr = "2015-11-07T13:49:09+10:00"; + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00"))); + } + + @Test + public void testIsJsonMime() { + assertFalse(apiClient.isJsonMime(null)); + assertFalse(apiClient.isJsonMime("")); + assertFalse(apiClient.isJsonMime("text/plain")); + assertFalse(apiClient.isJsonMime("application/xml")); + assertFalse(apiClient.isJsonMime("application/jsonp")); + assertFalse(apiClient.isJsonMime("example/json")); + assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); + assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); + + assertTrue(apiClient.isJsonMime("application/json")); + assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); + assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); + + assertTrue(apiClient.isJsonMime("application/problem+json")); + assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); + assertTrue(apiClient.isJsonMime("application/json\t")); + assertTrue(apiClient.isJsonMime("example/foo+bar+json")); + assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); + assertTrue(apiClient.isJsonMime("example/foo+json\t;")); + assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); + } + + @Test + public void testSelectHeaderAccept() { + String[] accepts = {"application/json", "application/xml"}; + assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; + assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"text/plain", "application/xml"}; + assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{}; + assertNull(apiClient.selectHeaderAccept(accepts)); + } + + @Test + public void testSelectHeaderContentType() { + String[] contentTypes = {"application/json", "application/xml"}; + assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; + assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"text/plain", "application/xml"}; + assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{}; + assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); + } + + @Test + public void testGetAuthentications() { + Map auths = apiClient.getAuthentications(); + + Authentication auth = auths.get("api_key"); + assertNotNull(auth); + assertTrue(auth instanceof ApiKeyAuth); + ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; + assertEquals("header", apiKeyAuth.getLocation()); + assertEquals("api_key", apiKeyAuth.getParamName()); + + auth = auths.get("petstore_auth"); + assertTrue(auth instanceof OAuth); + assertSame(auth, apiClient.getAuthentication("petstore_auth")); + + assertNull(auths.get("unknown")); + + try { + auths.put("my_auth", new HttpBasicAuth()); + fail("the authentications returned should not be modifiable"); + } catch (UnsupportedOperationException e) { + } + } + + @Ignore("There is no more basic auth in petstore security definitions") + @Test + public void testSetUsernameAndPassword() { + HttpBasicAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof HttpBasicAuth) { + auth = (HttpBasicAuth) _auth; + break; + } + } + auth.setUsername(null); + auth.setPassword(null); + + apiClient.setUsername("my-username"); + apiClient.setPassword("my-password"); + assertEquals("my-username", auth.getUsername()); + assertEquals("my-password", auth.getPassword()); + + // reset values + auth.setUsername(null); + auth.setPassword(null); + } + + @Test + public void testSetApiKeyAndPrefix() { + ApiKeyAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof ApiKeyAuth) { + auth = (ApiKeyAuth) _auth; + break; + } + } + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + + apiClient.setApiKey("my-api-key"); + apiClient.setApiKeyPrefix("Token"); + assertEquals("my-api-key", auth.getApiKey()); + assertEquals("Token", auth.getApiKeyPrefix()); + + // reset values + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + } + + @Test + public void testParameterToPairWhenNameIsInvalid() throws Exception { + List pairs_a = apiClient.parameterToPair(null, new Integer(1)); + List pairs_b = apiClient.parameterToPair("", new Integer(1)); + + assertTrue(pairs_a.isEmpty()); + assertTrue(pairs_b.isEmpty()); + } + + @Test + public void testParameterToPairWhenValueIsNull() throws Exception { + List pairs = apiClient.parameterToPair("param-a", null); + + assertTrue(pairs.isEmpty()); + } + + @Test + public void testParameterToPairWhenValueIsEmptyString() throws Exception { + // single empty string + List pairs = apiClient.parameterToPair("param-a", " "); + assertEquals(1, pairs.size()); + } + + @Test + public void testParameterToPairWhenValueIsNotCollection() throws Exception { + String name = "param-a"; + Integer value = 1; + + List pairs = apiClient.parameterToPair(name, value); + + assertEquals(1, pairs.size()); + assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); + } + + @Test + public void testParameterToPairWhenValueIsCollection() throws Exception { + List values = new ArrayList(); + values.add("value-a"); + values.add(123); + values.add(new Date()); + + List pairs = apiClient.parameterToPair("param-a", values); + assertEquals(0, pairs.size()); + } + + @Test + public void testParameterToPairsWhenNameIsInvalid() throws Exception { + List objects = new ArrayList(); + objects.add(new Integer(1)); + + List pairs_a = apiClient.parameterToPairs("csv", null, objects); + List pairs_b = apiClient.parameterToPairs("csv", "", objects); + + assertTrue(pairs_a.isEmpty()); + assertTrue(pairs_b.isEmpty()); + } + + @Test + public void testParameterToPairsWhenValueIsNull() throws Exception { + List pairs = apiClient.parameterToPairs("csv", "param-a", null); + + assertTrue(pairs.isEmpty()); + } + + @Test + public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { + // list of empty strings + List strs = new ArrayList(); + strs.add(" "); + strs.add(" "); + strs.add(" "); + + List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); + + assertEquals(1, concatStrings.size()); + assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters + } + + @Test + public void testParameterToPairsWhenValueIsCollection() throws Exception { + Map collectionFormatMap = new HashMap(); + collectionFormatMap.put("csv", ","); + collectionFormatMap.put("tsv", "\t"); + collectionFormatMap.put("ssv", " "); + collectionFormatMap.put("pipes", "|"); + collectionFormatMap.put("", ","); // no format, must default to csv + collectionFormatMap.put("unknown", ","); // all other formats, must default to csv + + String name = "param-a"; + + List values = new ArrayList(); + values.add("value-a"); + values.add(123); + values.add(new Date()); + + // check for multi separately + List multiPairs = apiClient.parameterToPairs("multi", name, values); + assertEquals(values.size(), multiPairs.size()); + for (int i = 0; i < values.size(); i++) { + assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), multiPairs.get(i).getValue()); + } + + // all other formats + for (String collectionFormat : collectionFormatMap.keySet()) { + List pairs = apiClient.parameterToPairs(collectionFormat, name, values); + + assertEquals(1, pairs.size()); + + String delimiter = collectionFormatMap.get(collectionFormat); + if (!delimiter.equals(",")) { + // commas are not escaped because they are reserved characters in URIs + delimiter = apiClient.escapeString(delimiter); + } + String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); + + // must equal input values + assertEquals(values.size(), pairValueSplit.length); + for (int i = 0; i < values.size(); i++) { + assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), pairValueSplit[i]); + } + } + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/ApiKeyAuthTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/ApiKeyAuthTest.java new file mode 100644 index 00000000000..d9b17065f7c --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/ApiKeyAuthTest.java @@ -0,0 +1,47 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.openapitools.client.Pair; +import org.junit.*; +import static org.junit.Assert.*; + + +public class ApiKeyAuthTest { + @Test + public void testApplyToParamsInQuery() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); + auth.setApiKey("my-api-key"); + auth.applyToParams(queryParams, headerParams); + + assertEquals(1, queryParams.size()); + for (Pair queryParam : queryParams) { + assertEquals("my-api-key", queryParam.getValue()); + } + + // no changes to header parameters + assertEquals(0, headerParams.size()); + } + + @Test + public void testApplyToParamsInHeaderWithPrefix() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); + auth.setApiKey("my-api-token"); + auth.setApiKeyPrefix("Token"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/HttpBasicAuthTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/HttpBasicAuthTest.java new file mode 100644 index 00000000000..668342d96d7 --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/HttpBasicAuthTest.java @@ -0,0 +1,52 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.openapitools.client.Pair; +import org.junit.*; +import static org.junit.Assert.*; + + +public class HttpBasicAuthTest { + HttpBasicAuth auth = null; + + @Before + public void setup() { + auth = new HttpBasicAuth(); + } + + @Test + public void testApplyToParams() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + auth.setUsername("my-username"); + auth.setPassword("my-password"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix + String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; + assertEquals(expected, headerParams.get("Authorization")); + + // null username should be treated as empty string + auth.setUsername(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of ":my-password" with the "Basic " prefix + expected = "Basic Om15LXBhc3N3b3Jk"; + assertEquals(expected, headerParams.get("Authorization")); + + // null password should be treated as empty string + auth.setUsername("my-username"); + auth.setPassword(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of "my-username:" with the "Basic " prefix + expected = "Basic bXktdXNlcm5hbWU6"; + assertEquals(expected, headerParams.get("Authorization")); + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey1/model/EnumValueTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey1/model/EnumValueTest.java new file mode 100644 index 00000000000..47bfe940d3c --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/jersey1/model/EnumValueTest.java @@ -0,0 +1,63 @@ +package org.openapitools.client.model; + +import org.junit.Test; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectWriter; +import com.fasterxml.jackson.databind.SerializationFeature; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class EnumValueTest { + + @Test + public void testEnumClass() { + assertEquals(EnumClass._ABC.toString(), "_abc"); + assertEquals(EnumClass._EFG.toString(), "-efg"); + assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); + } + + @Test + public void testEnumTest() { + // test enum value + EnumTest enumTest = new EnumTest(); + enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); + enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); + enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); + + assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); + assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); + + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); + + assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); + assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); + + try { + // test serialization (object => json) + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + ObjectWriter ow = mapper.writer(); + String json = ow.writeValueAsString(enumTest); + assertEquals(json, "{\"enum_string\":\"lower\",\"enum_string_required\":null,\"enum_integer\":1,\"enum_number\":1.1,\"outerEnum\":null}"); + + // test deserialization (json => object) + EnumTest fromString = mapper.readValue(json, EnumTest.class); + assertEquals(fromString.getEnumString().toString(), "lower"); + assertEquals(fromString.getEnumInteger().toString(), "1"); + assertEquals(fromString.getEnumNumber().toString(), "1.1"); + + } catch (Exception e) { + fail("Exception thrown during serialization/deserialzation of JSON: " + e.getMessage()); + } + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONTest.java new file mode 100644 index 00000000000..7fb307a3df8 --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONTest.java @@ -0,0 +1,45 @@ +package org.openapitools.client; + +import org.openapitools.client.model.Order; + +import java.lang.Exception; + +import java.time.OffsetDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import org.junit.*; +import static org.junit.Assert.*; + + +public class JSONTest { + JSON json = null; + Order order = null; + + @Before + public void setup() { + json = new JSON(); + order = new Order(); + } + + @Test + public void testDefaultDate() throws Exception { + final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + final String dateStr = "2015-11-07T14:11:05.267Z"; + order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime::from)); + + String str = json.getContext(null).writeValueAsString(order); + Order o = json.getContext(null).readValue(str, Order.class); + assertEquals(dateStr, dateFormat.format(o.getShipDate())); + } + + @Test + public void testCustomDate() throws Exception { + final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); + final String dateStr = "2015-11-07T14:11:05-02:00"; + order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime::from)); + + String str = json.getContext(null).writeValueAsString(order); + Order o = json.getContext(null).readValue(str, Order.class); + assertEquals(dateStr, dateFormat.format(o.getShipDate())); + } +} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java new file mode 100644 index 00000000000..6fb1e54b679 --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java @@ -0,0 +1,250 @@ +package org.openapitools.client; + +import org.openapitools.client.auth.*; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.*; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class ApiClientTest { + ApiClient apiClient = null; + + @Before + public void setup() { + apiClient = new ApiClient(); + } + + @Test + public void testParseAndFormatDate() { + // default date format + String dateStr = "2015-11-07T03:49:09.356Z"; + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00"))); + + // custom date format: without milli-seconds, custom time zone + DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); + format.setTimeZone(TimeZone.getTimeZone("GMT+10")); + apiClient.setDateFormat(format); + dateStr = "2015-11-07T13:49:09+10:00"; + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00"))); + } + + @Test + public void testIsJsonMime() { + assertFalse(apiClient.isJsonMime(null)); + assertFalse(apiClient.isJsonMime("")); + assertFalse(apiClient.isJsonMime("text/plain")); + assertFalse(apiClient.isJsonMime("application/xml")); + assertFalse(apiClient.isJsonMime("application/jsonp")); + assertFalse(apiClient.isJsonMime("example/json")); + assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); + assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); + + assertTrue(apiClient.isJsonMime("application/json")); + assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); + assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); + + assertTrue(apiClient.isJsonMime("application/problem+json")); + assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); + assertTrue(apiClient.isJsonMime("application/json\t")); + assertTrue(apiClient.isJsonMime("example/foo+bar+json")); + assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); + assertTrue(apiClient.isJsonMime("example/foo+json\t;")); + assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); + } + + @Test + public void testSelectHeaderAccept() { + String[] accepts = {"application/json", "application/xml"}; + assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; + assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"text/plain", "application/xml"}; + assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{}; + assertNull(apiClient.selectHeaderAccept(accepts)); + } + + @Test + public void testSelectHeaderContentType() { + String[] contentTypes = {"application/json", "application/xml"}; + assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; + assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"text/plain", "application/xml"}; + assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{}; + assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); + } + + @Test + public void testGetAuthentications() { + Map auths = apiClient.getAuthentications(); + + Authentication auth = auths.get("api_key"); + assertNotNull(auth); + assertTrue(auth instanceof ApiKeyAuth); + ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; + assertEquals("header", apiKeyAuth.getLocation()); + assertEquals("api_key", apiKeyAuth.getParamName()); + + auth = auths.get("petstore_auth"); + assertTrue(auth instanceof OAuth); + assertSame(auth, apiClient.getAuthentication("petstore_auth")); + + assertNull(auths.get("unknown")); + + try { + auths.put("my_auth", new HttpBasicAuth()); + fail("the authentications returned should not be modifiable"); + } catch (UnsupportedOperationException e) { + } + } + + @Ignore("There is no more basic auth in petstore security definitions") + @Test + public void testSetUsernameAndPassword() { + HttpBasicAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof HttpBasicAuth) { + auth = (HttpBasicAuth) _auth; + break; + } + } + auth.setUsername(null); + auth.setPassword(null); + + apiClient.setUsername("my-username"); + apiClient.setPassword("my-password"); + assertEquals("my-username", auth.getUsername()); + assertEquals("my-password", auth.getPassword()); + + // reset values + auth.setUsername(null); + auth.setPassword(null); + } + + @Test + public void testSetApiKeyAndPrefix() { + ApiKeyAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof ApiKeyAuth) { + auth = (ApiKeyAuth) _auth; + break; + } + } + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + + apiClient.setApiKey("my-api-key"); + apiClient.setApiKeyPrefix("Token"); + assertEquals("my-api-key", auth.getApiKey()); + assertEquals("Token", auth.getApiKeyPrefix()); + + // reset values + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + } + + @Test + public void testParameterToPairsWhenNameIsInvalid() throws Exception { + List pairs_a = apiClient.parameterToPairs("csv", null, new Integer(1)); + List pairs_b = apiClient.parameterToPairs("csv", "", new Integer(1)); + + assertTrue(pairs_a.isEmpty()); + assertTrue(pairs_b.isEmpty()); + } + + @Test + public void testParameterToPairsWhenValueIsNull() throws Exception { + List pairs = apiClient.parameterToPairs("csv", "param-a", null); + + assertTrue(pairs.isEmpty()); + } + + @Test + public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { + + // single empty string + List pairs = apiClient.parameterToPairs("csv", "param-a", " "); + assertEquals(1, pairs.size()); + + // list of empty strings + List strs = new ArrayList(); + strs.add(" "); + strs.add(" "); + strs.add(" "); + + List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); + + assertEquals(1, concatStrings.size()); + assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters + } + + @Test + public void testParameterToPairsWhenValueIsNotCollection() throws Exception { + String name = "param-a"; + Integer value = 1; + + List pairs = apiClient.parameterToPairs("csv", name, value); + + assertEquals(1, pairs.size()); + assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); + } + + @Test + public void testParameterToPairsWhenValueIsCollection() throws Exception { + Map collectionFormatMap = new HashMap(); + collectionFormatMap.put("csv", ","); + collectionFormatMap.put("tsv", "\t"); + collectionFormatMap.put("ssv", " "); + collectionFormatMap.put("pipes", "\\|"); + collectionFormatMap.put("", ","); // no format, must default to csv + collectionFormatMap.put("unknown", ","); // all other formats, must default to csv + + String name = "param-a"; + + List values = new ArrayList(); + values.add("value-a"); + values.add(123); + values.add(new Date()); + + // check for multi separately + List multiPairs = apiClient.parameterToPairs("multi", name, values); + assertEquals(values.size(), multiPairs.size()); + + // all other formats + for (String collectionFormat : collectionFormatMap.keySet()) { + List pairs = apiClient.parameterToPairs(collectionFormat, name, values); + + assertEquals(1, pairs.size()); + + String delimiter = collectionFormatMap.get(collectionFormat); + String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); + + // must equal input values + assertEquals(values.size(), pairValueSplit.length); + } + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey2/JSONTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey2/JSONTest.java new file mode 100644 index 00000000000..f21b852065c --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/jersey2/JSONTest.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import org.openapitools.client.model.Order; +import org.junit.Before; +import org.junit.Test; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.format.DateTimeFormatter; + +import static org.junit.Assert.*; + + +public class JSONTest { + private JSON json = null; + private Order order = null; + + @Before + public void setup() { + json = new ApiClient().getJSON(); + order = new Order(); + } + + @Test + public void testDefaultDate() throws Exception { + final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + final String dateStr = "2015-11-07T14:11:05.267Z"; + order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime.FROM)); + + String str = json.getContext(null).writeValueAsString(order); + Order o = json.getContext(null).readValue(str, Order.class); + assertEquals(dateStr, dateFormat.format(o.getShipDate())); + } + + @Test + public void testCustomDate() throws Exception { + final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); + final String dateStr = "2015-11-07T14:11:05-02:00"; + order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime.FROM)); + + String str = json.getContext(null).writeValueAsString(order); + Order o = json.getContext(null).readValue(str, Order.class); + assertEquals(dateStr, dateFormat.format(o.getShipDate())); + } + + @Test + public void testSqlDateSerialization() throws Exception { + String str = json.getContext(null).writeValueAsString(new java.sql.Date(10)); + assertEquals("\"1970-01-01\"", str); + } + + @Test + public void testSqlDateDeserialization() throws Exception { + final String str = "1970-01-01"; + java.sql.Date date = json.getContext(null).readValue("\"" + str + "\"", java.sql.Date.class); + assertEquals(date.toString(), str); + } + +} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/ApiKeyAuthTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/ApiKeyAuthTest.java new file mode 100644 index 00000000000..d9b17065f7c --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/ApiKeyAuthTest.java @@ -0,0 +1,47 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.openapitools.client.Pair; +import org.junit.*; +import static org.junit.Assert.*; + + +public class ApiKeyAuthTest { + @Test + public void testApplyToParamsInQuery() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); + auth.setApiKey("my-api-key"); + auth.applyToParams(queryParams, headerParams); + + assertEquals(1, queryParams.size()); + for (Pair queryParam : queryParams) { + assertEquals("my-api-key", queryParam.getValue()); + } + + // no changes to header parameters + assertEquals(0, headerParams.size()); + } + + @Test + public void testApplyToParamsInHeaderWithPrefix() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); + auth.setApiKey("my-api-token"); + auth.setApiKeyPrefix("Token"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/HttpBasicAuthTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/HttpBasicAuthTest.java new file mode 100644 index 00000000000..668342d96d7 --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/HttpBasicAuthTest.java @@ -0,0 +1,52 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.openapitools.client.Pair; +import org.junit.*; +import static org.junit.Assert.*; + + +public class HttpBasicAuthTest { + HttpBasicAuth auth = null; + + @Before + public void setup() { + auth = new HttpBasicAuth(); + } + + @Test + public void testApplyToParams() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + auth.setUsername("my-username"); + auth.setPassword("my-password"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix + String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; + assertEquals(expected, headerParams.get("Authorization")); + + // null username should be treated as empty string + auth.setUsername(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of ":my-password" with the "Basic " prefix + expected = "Basic Om15LXBhc3N3b3Jk"; + assertEquals(expected, headerParams.get("Authorization")); + + // null password should be treated as empty string + auth.setUsername("my-username"); + auth.setPassword(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of "my-username:" with the "Basic " prefix + expected = "Basic bXktdXNlcm5hbWU6"; + assertEquals(expected, headerParams.get("Authorization")); + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey2/model/EnumValueTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey2/model/EnumValueTest.java new file mode 100644 index 00000000000..47bfe940d3c --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/jersey2/model/EnumValueTest.java @@ -0,0 +1,63 @@ +package org.openapitools.client.model; + +import org.junit.Test; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectWriter; +import com.fasterxml.jackson.databind.SerializationFeature; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class EnumValueTest { + + @Test + public void testEnumClass() { + assertEquals(EnumClass._ABC.toString(), "_abc"); + assertEquals(EnumClass._EFG.toString(), "-efg"); + assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); + } + + @Test + public void testEnumTest() { + // test enum value + EnumTest enumTest = new EnumTest(); + enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); + enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); + enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); + + assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); + assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); + + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); + + assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); + assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); + + try { + // test serialization (object => json) + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + ObjectWriter ow = mapper.writer(); + String json = ow.writeValueAsString(enumTest); + assertEquals(json, "{\"enum_string\":\"lower\",\"enum_string_required\":null,\"enum_integer\":1,\"enum_number\":1.1,\"outerEnum\":null}"); + + // test deserialization (json => object) + EnumTest fromString = mapper.readValue(json, EnumTest.class); + assertEquals(fromString.getEnumString().toString(), "lower"); + assertEquals(fromString.getEnumInteger().toString(), "1"); + assertEquals(fromString.getEnumNumber().toString(), "1.1"); + + } catch (Exception e) { + fail("Exception thrown during serialization/deserialzation of JSON: " + e.getMessage()); + } + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/ApiClientTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/ApiClientTest.java new file mode 100644 index 00000000000..5167afc326b --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/ApiClientTest.java @@ -0,0 +1,330 @@ +package org.openapitools.client; + +import org.openapitools.client.auth.*; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.TimeZone; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class ApiClientTest { + ApiClient apiClient; + JSON json; + + @Before + public void setup() { + apiClient = new ApiClient(); + json = apiClient.getJSON(); + } + + @Test + public void testIsJsonMime() { + assertFalse(apiClient.isJsonMime(null)); + assertFalse(apiClient.isJsonMime("")); + assertFalse(apiClient.isJsonMime("text/plain")); + assertFalse(apiClient.isJsonMime("application/xml")); + assertFalse(apiClient.isJsonMime("application/jsonp")); + assertFalse(apiClient.isJsonMime("example/json")); + assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); + assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); + + assertTrue(apiClient.isJsonMime("application/json")); + assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); + assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); + + assertTrue(apiClient.isJsonMime("application/problem+json")); + assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); + assertTrue(apiClient.isJsonMime("application/json\t")); + assertTrue(apiClient.isJsonMime("example/foo+bar+json")); + assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); + assertTrue(apiClient.isJsonMime("example/foo+json\t;")); + assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); + + assertTrue(apiClient.isJsonMime("application/json-patch+json")); + } + + @Test + public void testSelectHeaderAccept() { + String[] accepts = {"application/json", "application/xml"}; + assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; + assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"text/plain", "application/xml"}; + assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{}; + assertNull(apiClient.selectHeaderAccept(accepts)); + } + + @Test + public void testSelectHeaderContentType() { + String[] contentTypes = {"application/json", "application/xml"}; + assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; + assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"text/plain", "application/xml"}; + assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{}; + assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); + } + + @Test + public void testGetAuthentications() { + Map auths = apiClient.getAuthentications(); + + Authentication auth = auths.get("api_key"); + assertNotNull(auth); + assertTrue(auth instanceof ApiKeyAuth); + ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; + assertEquals("header", apiKeyAuth.getLocation()); + assertEquals("api_key", apiKeyAuth.getParamName()); + + auth = auths.get("petstore_auth"); + assertTrue(auth instanceof OAuth); + assertSame(auth, apiClient.getAuthentication("petstore_auth")); + + assertNull(auths.get("unknown")); + + try { + auths.put("my_auth", new HttpBasicAuth()); + fail("the authentications returned should not be modifiable"); + } catch (UnsupportedOperationException e) { + } + } + + /* + @Test + public void testSetUsernameAndPassword() { + HttpBasicAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof HttpBasicAuth) { + auth = (HttpBasicAuth) _auth; + break; + } + } + auth.setUsername(null); + auth.setPassword(null); + + apiClient.setUsername("my-username"); + apiClient.setPassword("my-password"); + assertEquals("my-username", auth.getUsername()); + assertEquals("my-password", auth.getPassword()); + + // reset values + auth.setUsername(null); + auth.setPassword(null); + } + */ + + @Test + public void testSetApiKeyAndPrefix() { + ApiKeyAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof ApiKeyAuth) { + auth = (ApiKeyAuth) _auth; + break; + } + } + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + + apiClient.setApiKey("my-api-key"); + apiClient.setApiKeyPrefix("Token"); + assertEquals("my-api-key", auth.getApiKey()); + assertEquals("Token", auth.getApiKeyPrefix()); + + // reset values + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + } + + @Test + public void testGetAndSetConnectTimeout() { + // connect timeout defaults to 10 seconds + assertEquals(10000, apiClient.getConnectTimeout()); + assertEquals(10000, apiClient.getHttpClient().getConnectTimeout()); + + apiClient.setConnectTimeout(0); + assertEquals(0, apiClient.getConnectTimeout()); + assertEquals(0, apiClient.getHttpClient().getConnectTimeout()); + + apiClient.setConnectTimeout(10000); + } + + @Test + public void testGetAndSetReadTimeout() { + // read timeout defaults to 10 seconds + assertEquals(10000, apiClient.getReadTimeout()); + assertEquals(10000, apiClient.getHttpClient().getReadTimeout()); + + apiClient.setReadTimeout(0); + assertEquals(0, apiClient.getReadTimeout()); + assertEquals(0, apiClient.getHttpClient().getReadTimeout()); + + apiClient.setReadTimeout(10000); + } + + @Test + public void testGetAndSetWriteTimeout() { + // write timeout defaults to 10 seconds + assertEquals(10000, apiClient.getWriteTimeout()); + assertEquals(10000, apiClient.getHttpClient().getWriteTimeout()); + + apiClient.setWriteTimeout(0); + assertEquals(0, apiClient.getWriteTimeout()); + assertEquals(0, apiClient.getHttpClient().getWriteTimeout()); + + apiClient.setWriteTimeout(10000); + } + + @Test + public void testParameterToPairWhenNameIsInvalid() throws Exception { + List pairs_a = apiClient.parameterToPair(null, new Integer(1)); + List pairs_b = apiClient.parameterToPair("", new Integer(1)); + + assertTrue(pairs_a.isEmpty()); + assertTrue(pairs_b.isEmpty()); + } + + @Test + public void testParameterToPairWhenValueIsNull() throws Exception { + List pairs = apiClient.parameterToPair("param-a", null); + + assertTrue(pairs.isEmpty()); + } + + @Test + public void testParameterToPairWhenValueIsEmptyString() throws Exception { + // single empty string + List pairs = apiClient.parameterToPair("param-a", " "); + assertEquals(1, pairs.size()); + } + + @Test + public void testParameterToPairWhenValueIsNotCollection() throws Exception { + String name = "param-a"; + Integer value = 1; + + List pairs = apiClient.parameterToPair(name, value); + + assertEquals(1, pairs.size()); + assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); + } + + @Test + public void testParameterToPairWhenValueIsCollection() throws Exception { + List values = new ArrayList(); + values.add("value-a"); + values.add(123); + values.add(new Date()); + + List pairs = apiClient.parameterToPair("param-a", values); + assertEquals(0, pairs.size()); + } + + @Test + public void testParameterToPairsWhenNameIsInvalid() throws Exception { + List objects = new ArrayList(); + objects.add(new Integer(1)); + + List pairs_a = apiClient.parameterToPairs("csv", null, objects); + List pairs_b = apiClient.parameterToPairs("csv", "", objects); + + assertTrue(pairs_a.isEmpty()); + assertTrue(pairs_b.isEmpty()); + } + + @Test + public void testParameterToPairsWhenValueIsNull() throws Exception { + List pairs = apiClient.parameterToPairs("csv", "param-a", null); + + assertTrue(pairs.isEmpty()); + } + + @Test + public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { + // list of empty strings + List strs = new ArrayList(); + strs.add(" "); + strs.add(" "); + strs.add(" "); + + List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); + + assertEquals(1, concatStrings.size()); + assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters + } + + @Test + public void testParameterToPairsWhenValueIsCollection() throws Exception { + Map collectionFormatMap = new HashMap(); + collectionFormatMap.put("csv", ","); + collectionFormatMap.put("tsv", "\t"); + collectionFormatMap.put("ssv", " "); + collectionFormatMap.put("pipes", "|"); + collectionFormatMap.put("", ","); // no format, must default to csv + collectionFormatMap.put("unknown", ","); // all other formats, must default to csv + + String name = "param-a"; + + List values = new ArrayList(); + values.add("value-a"); + values.add(123); + values.add(new Date()); + + // check for multi separately + List multiPairs = apiClient.parameterToPairs("multi", name, values); + assertEquals(values.size(), multiPairs.size()); + for (int i = 0; i < values.size(); i++) { + assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), multiPairs.get(i).getValue()); + } + + // all other formats + for (String collectionFormat : collectionFormatMap.keySet()) { + List pairs = apiClient.parameterToPairs(collectionFormat, name, values); + + assertEquals(1, pairs.size()); + + String delimiter = collectionFormatMap.get(collectionFormat); + if (!delimiter.equals(",")) { + // commas are not escaped because they are reserved characters in URIs + delimiter = apiClient.escapeString(delimiter); + } + String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); + + // must equal input values + assertEquals(values.size(), pairValueSplit.length); + for (int i = 0; i < values.size(); i++) { + assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), pairValueSplit[i]); + } + } + } + + @Test + public void testSanitizeFilename() { + assertEquals("sun", apiClient.sanitizeFilename("sun")); + assertEquals("sun.gif", apiClient.sanitizeFilename("sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("../sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("/var/tmp/sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("./sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("..\\sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("\\var\\tmp\\sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("c:\\var\\tmp\\sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename(".\\sun.gif")); + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/JSONTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/JSONTest.java new file mode 100644 index 00000000000..e7687d0b33b --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/JSONTest.java @@ -0,0 +1,201 @@ +package org.openapitools.client; + +import com.google.gson.reflect.TypeToken; + +import org.openapitools.client.model.Order; + +import java.lang.Exception; +import java.lang.reflect.Type; +import java.nio.charset.StandardCharsets; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +import okio.ByteString; +import org.junit.*; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.ZoneOffset; +import org.threeten.bp.format.DateTimeFormatter; + +import static org.junit.Assert.*; + +public class JSONTest { + private ApiClient apiClient = null; + private JSON json = null; + private Order order = null; + + @Before + public void setup() { + apiClient = new ApiClient(); + json = apiClient.getJSON(); + order = new Order(); + } + + @Test + public void testSqlDateTypeAdapter() { + final String str = "\"2015-11-07\""; + final java.sql.Date date = java.sql.Date.valueOf("2015-11-07"); + + assertEquals(str, json.serialize(date)); + assertEquals(json.deserialize(str, java.sql.Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.356" + getCurrentTimezoneOffset() + "\"", java.sql.Date.class).toString(), date.toString()); + + // custom date format: without day + DateFormat format = new SimpleDateFormat("yyyy-MM"); + apiClient.setSqlDateFormat(format); + String dateStr = "\"2015-11\""; + assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", java.sql.Date.class))); + assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11\"", java.sql.Date.class))); + } + + @Test + public void testDateTypeAdapter() { + Calendar cal = new GregorianCalendar(2015, 10, 7, 3, 49, 9); + cal.setTimeZone(TimeZone.getTimeZone("UTC")); + + assertEquals(json.deserialize("\"2015-11-07T05:49:09+02\"", Date.class), cal.getTime()); + + cal.set(Calendar.MILLISECOND, 300); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.3Z\"", Date.class), cal.getTime()); + + cal.set(Calendar.MILLISECOND, 356); + Date date = cal.getTime(); + + final String utcDate = "\"2015-11-07T03:49:09.356Z\""; + assertEquals(json.deserialize(utcDate, Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.356+00:00\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T05:49:09.356+02:00\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T02:49:09.356-01:00\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.356Z\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.356+00\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T02:49:09.356-0100\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.356456789Z\"", Date.class), date); + + assertEquals(utcDate, json.serialize(date)); + + // custom datetime format: without milli-seconds, custom time zone + DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); + format.setTimeZone(TimeZone.getTimeZone("GMT+10")); + apiClient.setDateFormat(format); + + String dateStr = "\"2015-11-07T13:49:09+10:00\""; + assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09+00:00\"", Date.class))); + assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", Date.class))); + assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T00:49:09-03:00\"", Date.class))); + + try { + // invalid time zone format + json.deserialize("\"2015-11-07T03:49:09+00\"", Date.class); + fail("json parsing should fail"); + } catch (RuntimeException e) { + // OK + } + try { + // unexpected miliseconds + json.deserialize("\"2015-11-07T03:49:09.000Z\"", Date.class); + fail("json parsing should fail"); + } catch (RuntimeException e) { + // OK + } + + } + + @Test + public void testOffsetDateTimeTypeAdapter() { + final String str = "\"2016-09-09T08:02:03.123-03:00\""; + OffsetDateTime date = OffsetDateTime.of(2016, 9, 9, 8, 2, 3, 123000000, ZoneOffset.of("-3")); + + assertEquals(str, json.serialize(date)); + //Use toString() instead of isEqual to verify that the offset is preserved + assertEquals(json.deserialize(str, OffsetDateTime.class).toString(), date.toString()); + } + + @Test + public void testLocalDateTypeAdapter() { + final String str = "\"2016-09-09\""; + final LocalDate date = LocalDate.of(2016, 9, 9); + + assertEquals(str, json.serialize(date)); + assertEquals(json.deserialize(str, LocalDate.class), date); + } + + + @Test + public void testDefaultDate() throws Exception { + final DateTimeFormatter datetimeFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + final String dateStr = "2015-11-07T14:11:05.267Z"; + order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); + + String str = json.serialize(order); + Type type = new TypeToken() { }.getType(); + Order o = json.deserialize(str, type); + assertEquals(dateStr, datetimeFormat.format(o.getShipDate())); + } + + @Test + public void testCustomDate() throws Exception { + final DateTimeFormatter datetimeFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); + final String dateStr = "2015-11-07T14:11:05-02:00"; + order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); + + String str = json.serialize(order); + Type type = new TypeToken() { }.getType(); + Order o = json.deserialize(str, type); + assertEquals(dateStr, datetimeFormat.format(o.getShipDate())); + } + + @Test + public void testByteArrayTypeAdapterSerialization() { + // Arrange + final String expectedBytesAsString = "Let's pretend this a jpg or something"; + final byte[] expectedBytes = expectedBytesAsString.getBytes(StandardCharsets.UTF_8); + + // Act + String serializedBytesWithQuotes = json.serialize(expectedBytes); + + // Assert + String serializedBytes = serializedBytesWithQuotes.substring(1, serializedBytesWithQuotes.length() - 1); + if (json.getGson().htmlSafe()) { + serializedBytes = serializedBytes.replaceAll("\\\\u003d", "="); + } + ByteString actualAsByteString = ByteString.decodeBase64(serializedBytes); + byte[] actualBytes = actualAsByteString.toByteArray(); + assertEquals(expectedBytesAsString, new String(actualBytes, StandardCharsets.UTF_8)); + } + + @Test + public void testByteArrayTypeAdapterDeserialization() { + // Arrange + final String expectedBytesAsString = "Let's pretend this a jpg or something"; + final byte[] expectedBytes = expectedBytesAsString.getBytes(StandardCharsets.UTF_8); + final ByteString expectedByteString = ByteString.of(expectedBytes); + final String serializedBytes = expectedByteString.base64(); + final String serializedBytesWithQuotes = "\"" + serializedBytes + "\""; + Type type = new TypeToken() { }.getType(); + + // Act + byte[] actualDeserializedBytes = json.deserialize(serializedBytesWithQuotes, type); + + // Assert + assertEquals(expectedBytesAsString, new String(actualDeserializedBytes, StandardCharsets.UTF_8)); + } + + // Obtained 22JAN2018 from stackoverflow answer by PuguaSoft https://stackoverflow.com/questions/11399491/java-timezone-offset + // Direct link https://stackoverflow.com/a/16680815/3166133 + public static String getCurrentTimezoneOffset() { + + TimeZone tz = TimeZone.getDefault(); + Calendar cal = GregorianCalendar.getInstance(tz); + int offsetInMillis = tz.getOffset(cal.getTimeInMillis()); + + String offset = String.format("%02d:%02d", Math.abs(offsetInMillis / 3600000), Math.abs((offsetInMillis / 60000) % 60)); + offset = (offsetInMillis >= 0 ? "+" : "-") + offset; + + return offset; + } +} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/ApiKeyAuthTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/ApiKeyAuthTest.java new file mode 100644 index 00000000000..d5a88132307 --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/ApiKeyAuthTest.java @@ -0,0 +1,76 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.openapitools.client.Pair; +import org.junit.*; +import static org.junit.Assert.*; + + +public class ApiKeyAuthTest { + @Test + public void testApplyToParamsInQuery() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); + auth.setApiKey("my-api-key"); + auth.applyToParams(queryParams, headerParams); + + assertEquals(1, queryParams.size()); + for (Pair queryParam : queryParams) { + assertEquals("my-api-key", queryParam.getValue()); + } + + // no changes to header parameters + assertEquals(0, headerParams.size()); + } + + @Test + public void testApplyToParamsInQueryWithNullValue() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); + auth.setApiKey(null); + auth.applyToParams(queryParams, headerParams); + + // no changes to parameters + assertEquals(0, queryParams.size()); + assertEquals(0, headerParams.size()); + } + + @Test + public void testApplyToParamsInHeaderWithPrefix() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); + auth.setApiKey("my-api-token"); + auth.setApiKeyPrefix("Token"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); + } + + @Test + public void testApplyToParamsInHeaderWithNullValue() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); + auth.setApiKey(null); + auth.setApiKeyPrefix("Token"); + auth.applyToParams(queryParams, headerParams); + + // no changes to parameters + assertEquals(0, queryParams.size()); + assertEquals(0, headerParams.size()); + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/HttpBasicAuthTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/HttpBasicAuthTest.java new file mode 100644 index 00000000000..d27a15f4dc0 --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/HttpBasicAuthTest.java @@ -0,0 +1,62 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.openapitools.client.Pair; +import org.junit.*; +import static org.junit.Assert.*; + + +public class HttpBasicAuthTest { + HttpBasicAuth auth = null; + + @Before + public void setup() { + auth = new HttpBasicAuth(); + } + + @Test + public void testApplyToParams() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + auth.setUsername("my-username"); + auth.setPassword("my-password"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix + String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; + assertEquals(expected, headerParams.get("Authorization")); + + // null username should be treated as empty string + auth.setUsername(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of ":my-password" with the "Basic " prefix + expected = "Basic Om15LXBhc3N3b3Jk"; + assertEquals(expected, headerParams.get("Authorization")); + + // null password should be treated as empty string + auth.setUsername("my-username"); + auth.setPassword(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of "my-username:" with the "Basic " prefix + expected = "Basic bXktdXNlcm5hbWU6"; + assertEquals(expected, headerParams.get("Authorization")); + + // null username and password should be ignored + queryParams = new ArrayList(); + headerParams = new HashMap(); + auth.setUsername(null); + auth.setPassword(null); + auth.applyToParams(queryParams, headerParams); + // no changes to parameters + assertEquals(0, queryParams.size()); + assertEquals(0, headerParams.size()); + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/EnumValueTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/EnumValueTest.java new file mode 100644 index 00000000000..73440e547b2 --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/EnumValueTest.java @@ -0,0 +1,56 @@ +package org.openapitools.client.model; + +import org.junit.Test; + +import com.google.gson.Gson; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class EnumValueTest { + + @Test + public void testEnumClass() { + assertEquals(EnumClass._ABC.toString(), "_abc"); + assertEquals(EnumClass._EFG.toString(), "-efg"); + assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); + } + + @Test + public void testEnumTest() { + // test enum value + EnumTest enumTest = new EnumTest(); + enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); + enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); + enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); + + assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); + assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); + + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); + + assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); + assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); + + // test serialization + Gson gson = new Gson(); + String json = gson.toJson(enumTest); + assertEquals(json, "{\"enum_string\":\"lower\",\"enum_integer\":1,\"enum_number\":1.1}"); + + // test deserialization + EnumTest fromString = gson.fromJson(json, EnumTest.class); + assertEquals(fromString.getEnumString().toString(), "lower"); + assertEquals(fromString.getEnumString().getValue(), "lower"); + assertEquals(fromString.getEnumInteger().toString(), "1"); + assertTrue(fromString.getEnumInteger().getValue() == 1); + assertEquals(fromString.getEnumNumber().toString(), "1.1"); + assertTrue(fromString.getEnumNumber().getValue() == 1.1); + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/resttemplate/ApiClientTest.java b/CI/samples.ci/client/petstore/java/test-manual/resttemplate/ApiClientTest.java new file mode 100644 index 00000000000..2113f5d2453 --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/resttemplate/ApiClientTest.java @@ -0,0 +1,254 @@ +package org.openapitools.client; + +import org.openapitools.client.auth.*; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.*; + +import org.junit.*; +import org.springframework.http.MediaType; +import org.springframework.util.MultiValueMap; + +import static org.junit.Assert.*; + + +public class ApiClientTest { + ApiClient apiClient = null; + + @Before + public void setup() { + apiClient = new ApiClient(); + } + + /** + * + */ + @Test + public void testParseAndFormatDate() { + // default date format + String dateStr = "2015-11-07T03:49:09.356Z"; + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00"))); + + // custom date format: without milli-seconds, custom time zone + DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); + format.setTimeZone(TimeZone.getTimeZone("GMT+10")); + apiClient.setDateFormat(format); + dateStr = "2015-11-07T13:49:09+10:00"; + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00"))); + } + + @Test + public void testIsJsonMime() { + assertFalse(apiClient.isJsonMime((String) null)); + assertFalse(apiClient.isJsonMime("")); + assertFalse(apiClient.isJsonMime("text/plain")); + assertFalse(apiClient.isJsonMime("application/xml")); + assertFalse(apiClient.isJsonMime("application/jsonp")); + assertFalse(apiClient.isJsonMime("example/json")); + assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); + assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); + + assertTrue(apiClient.isJsonMime("application/json")); + assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); + assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); + + assertTrue(apiClient.isJsonMime("application/problem+json")); + assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); + assertTrue(apiClient.isJsonMime("application/json\t")); + assertTrue(apiClient.isJsonMime("example/foo+bar+json")); + assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); + assertTrue(apiClient.isJsonMime("example/foo+json\t;")); + assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); + } + + @Test + public void testSelectHeaderAccept() { + String[] accepts = {"application/json", "application/xml"}; + assertEquals(Arrays.asList(MediaType.parseMediaType("application/json")), apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; + assertEquals(Arrays.asList(MediaType.parseMediaType("APPLICATION/JSON")), apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals(Arrays.asList(MediaType.parseMediaType("application/json; charset=UTF8")), apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"text/plain", "application/xml"}; + assertEquals(Arrays.asList(MediaType.parseMediaType("text/plain"),MediaType.parseMediaType("application/xml")), apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{}; + assertNull(apiClient.selectHeaderAccept(accepts)); + } + + @Test + public void testSelectHeaderContentType() { + String[] contentTypes = {"application/json", "application/xml"}; + assertEquals(MediaType.parseMediaType("application/json"), apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; + assertEquals(MediaType.parseMediaType("APPLICATION/JSON"), apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals(MediaType.parseMediaType("application/json; charset=UTF8"), apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"text/plain", "application/xml"}; + assertEquals(MediaType.parseMediaType("text/plain"), apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{}; + assertEquals(MediaType.parseMediaType("application/json"), apiClient.selectHeaderContentType(contentTypes)); + } + + @Test + public void testGetAuthentications() { + Map auths = apiClient.getAuthentications(); + + Authentication auth = auths.get("api_key"); + assertNotNull(auth); + assertTrue(auth instanceof ApiKeyAuth); + ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; + assertEquals("header", apiKeyAuth.getLocation()); + assertEquals("api_key", apiKeyAuth.getParamName()); + + auth = auths.get("petstore_auth"); + assertTrue(auth instanceof OAuth); + assertSame(auth, apiClient.getAuthentication("petstore_auth")); + + assertNull(auths.get("unknown")); + + try { + auths.put("my_auth", new HttpBasicAuth()); + fail("the authentications returned should not be modifiable"); + } catch (UnsupportedOperationException e) { + } + } + + @Ignore("There is no more basic auth in petstore security definitions") + @Test + public void testSetUsernameAndPassword() { + HttpBasicAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof HttpBasicAuth) { + auth = (HttpBasicAuth) _auth; + break; + } + } + auth.setUsername(null); + auth.setPassword(null); + + apiClient.setUsername("my-username"); + apiClient.setPassword("my-password"); + assertEquals("my-username", auth.getUsername()); + assertEquals("my-password", auth.getPassword()); + + // reset values + auth.setUsername(null); + auth.setPassword(null); + } + + @Test + public void testSetApiKeyAndPrefix() { + ApiKeyAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof ApiKeyAuth) { + auth = (ApiKeyAuth) _auth; + break; + } + } + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + + apiClient.setApiKey("my-api-key"); + apiClient.setApiKeyPrefix("Token"); + assertEquals("my-api-key", auth.getApiKey()); + assertEquals("Token", auth.getApiKeyPrefix()); + + // reset values + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + } + + @Test + public void testParameterToMultiValueMapWhenNameIsInvalid() throws Exception { + MultiValueMap pairs_a = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, null, new Integer(1)); + MultiValueMap pairs_b = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "", new Integer(1)); + + assertTrue(pairs_a.isEmpty()); + assertTrue(pairs_b.isEmpty()); + } + + @Test + public void testParameterToMultiValueMapWhenValueIsNull() throws Exception { + MultiValueMap pairs = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "param-a", null); + + assertTrue(pairs.isEmpty()); + } + + @Test + public void testParameterToMultiValueMapWhenValueIsEmptyStrings() throws Exception { + + // single empty string + MultiValueMap pairs = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "param-a", " "); + assertEquals(1, pairs.size()); + + // list of empty strings + List strs = new ArrayList(); + strs.add(" "); + strs.add(" "); + strs.add(" "); + + MultiValueMap concatStrings = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "param-a", strs); + + assertEquals(1, concatStrings.get("param-a").size()); + assertFalse(concatStrings.get("param-a").isEmpty()); // should contain some delimiters + } + + @Test + public void testParameterToMultiValueMapWhenValueIsNotCollection() throws Exception { + String name = "param-a"; + Integer value = 1; + + MultiValueMap pairs = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, name, value); + + assertEquals(1, pairs.get(name).size()); + assertEquals(value, Integer.valueOf(pairs.get(name).get(0))); + } + + @Test + public void testParameterToMultiValueMapWhenValueIsCollection() throws Exception { + Map collectionFormatMap = new HashMap(); + collectionFormatMap.put(ApiClient.CollectionFormat.CSV, ","); + collectionFormatMap.put(ApiClient.CollectionFormat.TSV, "\t"); + collectionFormatMap.put(ApiClient.CollectionFormat.SSV, " "); + collectionFormatMap.put(ApiClient.CollectionFormat.PIPES, "\\|"); + collectionFormatMap.put(null, ","); // no format, must default to csv + + String name = "param-a"; + + List values = new ArrayList(); + values.add("value-a"); + values.add(123); + values.add(new Date()); + + // check for multi separately + MultiValueMap multiValueMap = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.MULTI, name, values); + assertEquals(values.size(), multiValueMap.get(name).size()); + + // all other formats + for (ApiClient.CollectionFormat collectionFormat : collectionFormatMap.keySet()) { + MultiValueMap pairs = apiClient.parameterToMultiValueMap(collectionFormat, name, values); + + assertEquals(1, pairs.size()); + + String delimiter = collectionFormatMap.get(collectionFormat); + String[] pairValueSplit = pairs.get(name).get(0).split(delimiter); + + assertEquals(values.size(), pairValueSplit.length); + } + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/ApiKeyAuthTest.java b/CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/ApiKeyAuthTest.java new file mode 100644 index 00000000000..eef07a5309c --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/ApiKeyAuthTest.java @@ -0,0 +1,47 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.junit.*; +import org.springframework.http.HttpHeaders; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; + +import static org.junit.Assert.*; + +public class ApiKeyAuthTest { + @Test + public void testApplyToParamsInQuery() { + MultiValueMap queryParams = new LinkedMultiValueMap(); + HttpHeaders headerParams = new HttpHeaders(); + + ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); + auth.setApiKey("my-api-key"); + auth.applyToParams(queryParams, headerParams); + + assertEquals(1, queryParams.size()); + assertEquals("my-api-key", queryParams.get("api_key").get(0)); + + // no changes to header parameters + assertEquals(0, headerParams.size()); + } + + @Test + public void testApplyToParamsInHeaderWithPrefix() { + MultiValueMap queryParams = new LinkedMultiValueMap(); + HttpHeaders headerParams = new HttpHeaders(); + + ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); + auth.setApiKey("my-api-token"); + auth.setApiKeyPrefix("Token"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN").get(0)); + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/HttpBasicAuthTest.java b/CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/HttpBasicAuthTest.java new file mode 100644 index 00000000000..04522ec56c5 --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/HttpBasicAuthTest.java @@ -0,0 +1,54 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.junit.*; +import org.springframework.http.HttpHeaders; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; + +import static org.junit.Assert.*; + +public class HttpBasicAuthTest { + HttpBasicAuth auth = null; + + @Before + public void setup() { + auth = new HttpBasicAuth(); + } + + @Test + public void testApplyToParams() { + MultiValueMap queryParams = new LinkedMultiValueMap(); + HttpHeaders headerParams = new HttpHeaders(); + + auth.setUsername("my-username"); + auth.setPassword("my-password"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix + String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; + assertEquals(expected, headerParams.get("Authorization").get(0)); + + // null username should be treated as empty string + auth.setUsername(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of ":my-password" with the "Basic " prefix + expected = "Basic Om15LXBhc3N3b3Jk"; + assertEquals(expected, headerParams.get("Authorization").get(1)); + + // null password should be treated as empty string + auth.setUsername("my-username"); + auth.setPassword(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of "my-username:" with the "Basic " prefix + expected = "Basic bXktdXNlcm5hbWU6"; + assertEquals(expected, headerParams.get("Authorization").get(2)); + } +} diff --git a/CI/samples.ci/client/petstore/java/test-manual/resttemplate/model/EnumValueTest.java b/CI/samples.ci/client/petstore/java/test-manual/resttemplate/model/EnumValueTest.java new file mode 100644 index 00000000000..47bfe940d3c --- /dev/null +++ b/CI/samples.ci/client/petstore/java/test-manual/resttemplate/model/EnumValueTest.java @@ -0,0 +1,63 @@ +package org.openapitools.client.model; + +import org.junit.Test; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectWriter; +import com.fasterxml.jackson.databind.SerializationFeature; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class EnumValueTest { + + @Test + public void testEnumClass() { + assertEquals(EnumClass._ABC.toString(), "_abc"); + assertEquals(EnumClass._EFG.toString(), "-efg"); + assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); + } + + @Test + public void testEnumTest() { + // test enum value + EnumTest enumTest = new EnumTest(); + enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); + enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); + enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); + + assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); + assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); + + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); + + assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); + assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); + + try { + // test serialization (object => json) + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + ObjectWriter ow = mapper.writer(); + String json = ow.writeValueAsString(enumTest); + assertEquals(json, "{\"enum_string\":\"lower\",\"enum_string_required\":null,\"enum_integer\":1,\"enum_number\":1.1,\"outerEnum\":null}"); + + // test deserialization (json => object) + EnumTest fromString = mapper.readValue(json, EnumTest.class); + assertEquals(fromString.getEnumString().toString(), "lower"); + assertEquals(fromString.getEnumInteger().toString(), "1"); + assertEquals(fromString.getEnumNumber().toString(), "1.1"); + + } catch (Exception e) { + fail("Exception thrown during serialization/deserialzation of JSON: " + e.getMessage()); + } + } +} diff --git a/bin/java-petstore-feign.sh b/bin/java-petstore-feign.sh index 5acd593dfcd..d60d977be73 100755 --- a/bin/java-petstore-feign.sh +++ b/bin/java-petstore-feign.sh @@ -33,3 +33,8 @@ echo "Removing files and folders under samples/client/petstore/java/feign/src/ma rm -rf samples/client/petstore/java/feign/src/main find samples/client/petstore/java/feign -maxdepth 1 -type f ! -name "README.md" -exec rm {} + java $JAVA_OPTS -jar $executable $ags + +# copy additional manually written unit-tests +mkdir samples/client/petstore/java/feign/src/test/java/org/openapitools/client + +cp CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java samples/client/petstore/java/feign/src/test/java/org/openapitools/client/StringUtilTest.java \ No newline at end of file diff --git a/bin/java-petstore-jersey1.sh b/bin/java-petstore-jersey1.sh index 5ea0947fc6d..caa69adfafb 100755 --- a/bin/java-petstore-jersey1.sh +++ b/bin/java-petstore-jersey1.sh @@ -33,3 +33,15 @@ echo "Removing files and folders under samples/client/petstore/java/jersey1/src/ rm -rf samples/client/petstore/java/jersey1/src/main find samples/client/petstore/java/jersey1 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + java $JAVA_OPTS -jar $executable $ags + +# copy additional manually written unit-tests +mkdir samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client +mkdir samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/auth +mkdir samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model + +cp CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/StringUtilTest.java +cp CI/samples.ci/client/petstore/java/test-manual/jersey1/ApiClientTest.java samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/ApiClientTest.java +cp CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/ConfigurationTest.java +cp CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/ApiKeyAuthTest.java samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java +cp CI/samples.ci/client/petstore/java/test-manual/jersey1/auth/HttpBasicAuthTest.java samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java +cp CI/samples.ci/client/petstore/java/test-manual/jersey1/model/EnumValueTest.java samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/EnumValueTest.java diff --git a/bin/java-petstore-jersey2-java6.sh b/bin/java-petstore-jersey2-java6.sh index fb887669a2a..c9e71d722c7 100755 --- a/bin/java-petstore-jersey2-java6.sh +++ b/bin/java-petstore-jersey2-java6.sh @@ -29,7 +29,7 @@ fi export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" ags="generate --artifact-id petstore-jersey2-java6 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-jersey2.json -o samples/client/petstore/java/jersey2-java6 -DhideGenerationTimestamp=true,supportJava6=true $@" -echo "Removing files and folders under samples/client/petstore/java/jersey2/src/main" +echo "Removing files and folders under samples/client/petstore/java/jersey2-java6/src/main" rm -rf samples/client/petstore/java/jersey2-java6/src/main find samples/client/petstore/java/jersey2-java6 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-jersey2.sh b/bin/java-petstore-jersey2.sh index 6b37fa31940..dda1a2da8c2 100755 --- a/bin/java-petstore-jersey2.sh +++ b/bin/java-petstore-jersey2.sh @@ -33,3 +33,16 @@ echo "Removing files and folders under samples/client/petstore/java/jersey2/src/ rm -rf samples/client/petstore/java/jersey2/src/main find samples/client/petstore/java/jersey2 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + java $JAVA_OPTS -jar $executable $ags + +# copy additional manually written unit-tests +mkdir samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client +mkdir samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth +mkdir samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model + +cp CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/StringUtilTest.java +cp CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/ApiClientTest.java +cp CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/ConfigurationTest.java +cp CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/ApiKeyAuthTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java +cp CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/HttpBasicAuthTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java +cp CI/samples.ci/client/petstore/java/test-manual/jersey2/model/EnumValueTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumValueTest.java +cp CI/samples.ci/client/petstore/java/test-manual/jersey2/JSONTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/JSONTest.java diff --git a/bin/java-petstore-okhttp-gson.sh b/bin/java-petstore-okhttp-gson.sh index 755267573fe..33a3c1903d2 100755 --- a/bin/java-petstore-okhttp-gson.sh +++ b/bin/java-petstore-okhttp-gson.sh @@ -32,3 +32,16 @@ ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/okh rm -rf samples/client/petstore/java/okhttp-gson/src/main find samples/client/petstore/java/okhttp-gson -maxdepth 1 -type f ! -name "README.md" -exec rm {} + java $JAVA_OPTS -jar $executable $ags + +# copy additional manually written unit-tests +mkdir samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client +mkdir samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth +mkdir samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model + +cp CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/StringUtilTest.java +cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/ApiClientTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java +cp CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ConfigurationTest.java +cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/ApiKeyAuthTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java +cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/auth/HttpBasicAuthTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java +cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/model/EnumValueTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumValueTest.java +cp CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/JSONTest.java samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java diff --git a/bin/java-petstore-resttemplate.sh b/bin/java-petstore-resttemplate.sh index 3ff4a22189e..dbf04c44cc3 100755 --- a/bin/java-petstore-resttemplate.sh +++ b/bin/java-petstore-resttemplate.sh @@ -33,3 +33,13 @@ echo "Removing files and folders under samples/client/petstore/java/resttemplate rm -rf samples/client/petstore/java/resttemplate/src/main find samples/client/petstore/java/resttemplate -maxdepth 1 -type f ! -name "README.md" -exec rm {} + java $JAVA_OPTS -jar $executable $ags + +# copy additional manually written unit-tests +mkdir samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client +mkdir samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/auth +mkdir samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model + +cp CI/samples.ci/client/petstore/java/test-manual/resttemplate/ApiClientTest.java samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/ApiClientTest.java +cp CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/ApiKeyAuthTest.java samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java +cp CI/samples.ci/client/petstore/java/test-manual/resttemplate/auth/HttpBasicAuthTest.java samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java +cp CI/samples.ci/client/petstore/java/test-manual/resttemplate/model/EnumValueTest.java samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/EnumValueTest.java diff --git a/bin/java8-petstore-jersey2.sh b/bin/java8-petstore-jersey2.sh index 93338d9ad64..8f32b341209 100755 --- a/bin/java8-petstore-jersey2.sh +++ b/bin/java8-petstore-jersey2.sh @@ -33,3 +33,16 @@ echo "Removing files and folders under samples/client/petstore/java/jersey2-java rm -rf samples/client/petstore/java/jersey2-java8/src/main find samples/client/petstore/java/jersey2-java8 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + java $JAVA_OPTS -jar $executable $ags + +# copy additional manually written unit-tests +mkdir samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client +mkdir samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth +mkdir samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model + +cp CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/StringUtilTest.java +cp CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java +cp CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ConfigurationTest.java +cp CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/ApiKeyAuthTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java +cp CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/HttpBasicAuthTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java +cp CI/samples.ci/client/petstore/java/test-manual/jersey2/model/EnumValueTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumValueTest.java +cp CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java \ No newline at end of file diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/StringUtilTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/StringUtilTest.java new file mode 100644 index 00000000000..aa7c81759ec --- /dev/null +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/StringUtilTest.java @@ -0,0 +1,33 @@ +package org.openapitools.client; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class StringUtilTest { + @Test + public void testContainsIgnoreCase() { + assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "abc")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "ABC")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{"ABC"}, "abc")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, "ABC")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, null)); + + assertFalse(StringUtil.containsIgnoreCase(new String[]{"abc"}, "def")); + assertFalse(StringUtil.containsIgnoreCase(new String[]{}, "ABC")); + assertFalse(StringUtil.containsIgnoreCase(new String[]{}, null)); + } + + @Test + public void testJoin() { + String[] array = {"aa", "bb", "cc"}; + assertEquals("aa,bb,cc", StringUtil.join(array, ",")); + assertEquals("aa, bb, cc", StringUtil.join(array, ", ")); + assertEquals("aabbcc", StringUtil.join(array, "")); + assertEquals("aa bb cc", StringUtil.join(array, " ")); + assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); + + assertEquals("", StringUtil.join(new String[]{}, ",")); + assertEquals("abc", StringUtil.join(new String[]{"abc"}, ",")); + } +} diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/ApiClientTest.java new file mode 100644 index 00000000000..a890ead935f --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/ApiClientTest.java @@ -0,0 +1,292 @@ +package org.openapitools.client; + +import org.openapitools.client.auth.*; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.*; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class ApiClientTest { + ApiClient apiClient = null; + + @Before + public void setup() { + apiClient = new ApiClient(); + } + + @Test + public void testParseAndFormatDate() { + // default date format + String dateStr = "2015-11-07T03:49:09.356Z"; + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00"))); + + // custom date format: without milli-seconds, custom time zone + DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); + format.setTimeZone(TimeZone.getTimeZone("GMT+10")); + apiClient.setDateFormat(format); + dateStr = "2015-11-07T13:49:09+10:00"; + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00"))); + } + + @Test + public void testIsJsonMime() { + assertFalse(apiClient.isJsonMime(null)); + assertFalse(apiClient.isJsonMime("")); + assertFalse(apiClient.isJsonMime("text/plain")); + assertFalse(apiClient.isJsonMime("application/xml")); + assertFalse(apiClient.isJsonMime("application/jsonp")); + assertFalse(apiClient.isJsonMime("example/json")); + assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); + assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); + + assertTrue(apiClient.isJsonMime("application/json")); + assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); + assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); + + assertTrue(apiClient.isJsonMime("application/problem+json")); + assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); + assertTrue(apiClient.isJsonMime("application/json\t")); + assertTrue(apiClient.isJsonMime("example/foo+bar+json")); + assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); + assertTrue(apiClient.isJsonMime("example/foo+json\t;")); + assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); + } + + @Test + public void testSelectHeaderAccept() { + String[] accepts = {"application/json", "application/xml"}; + assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; + assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"text/plain", "application/xml"}; + assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{}; + assertNull(apiClient.selectHeaderAccept(accepts)); + } + + @Test + public void testSelectHeaderContentType() { + String[] contentTypes = {"application/json", "application/xml"}; + assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; + assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"text/plain", "application/xml"}; + assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{}; + assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); + } + + @Test + public void testGetAuthentications() { + Map auths = apiClient.getAuthentications(); + + Authentication auth = auths.get("api_key"); + assertNotNull(auth); + assertTrue(auth instanceof ApiKeyAuth); + ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; + assertEquals("header", apiKeyAuth.getLocation()); + assertEquals("api_key", apiKeyAuth.getParamName()); + + auth = auths.get("petstore_auth"); + assertTrue(auth instanceof OAuth); + assertSame(auth, apiClient.getAuthentication("petstore_auth")); + + assertNull(auths.get("unknown")); + + try { + auths.put("my_auth", new HttpBasicAuth()); + fail("the authentications returned should not be modifiable"); + } catch (UnsupportedOperationException e) { + } + } + + @Ignore("There is no more basic auth in petstore security definitions") + @Test + public void testSetUsernameAndPassword() { + HttpBasicAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof HttpBasicAuth) { + auth = (HttpBasicAuth) _auth; + break; + } + } + auth.setUsername(null); + auth.setPassword(null); + + apiClient.setUsername("my-username"); + apiClient.setPassword("my-password"); + assertEquals("my-username", auth.getUsername()); + assertEquals("my-password", auth.getPassword()); + + // reset values + auth.setUsername(null); + auth.setPassword(null); + } + + @Test + public void testSetApiKeyAndPrefix() { + ApiKeyAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof ApiKeyAuth) { + auth = (ApiKeyAuth) _auth; + break; + } + } + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + + apiClient.setApiKey("my-api-key"); + apiClient.setApiKeyPrefix("Token"); + assertEquals("my-api-key", auth.getApiKey()); + assertEquals("Token", auth.getApiKeyPrefix()); + + // reset values + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + } + + @Test + public void testParameterToPairWhenNameIsInvalid() throws Exception { + List pairs_a = apiClient.parameterToPair(null, new Integer(1)); + List pairs_b = apiClient.parameterToPair("", new Integer(1)); + + assertTrue(pairs_a.isEmpty()); + assertTrue(pairs_b.isEmpty()); + } + + @Test + public void testParameterToPairWhenValueIsNull() throws Exception { + List pairs = apiClient.parameterToPair("param-a", null); + + assertTrue(pairs.isEmpty()); + } + + @Test + public void testParameterToPairWhenValueIsEmptyString() throws Exception { + // single empty string + List pairs = apiClient.parameterToPair("param-a", " "); + assertEquals(1, pairs.size()); + } + + @Test + public void testParameterToPairWhenValueIsNotCollection() throws Exception { + String name = "param-a"; + Integer value = 1; + + List pairs = apiClient.parameterToPair(name, value); + + assertEquals(1, pairs.size()); + assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); + } + + @Test + public void testParameterToPairWhenValueIsCollection() throws Exception { + List values = new ArrayList(); + values.add("value-a"); + values.add(123); + values.add(new Date()); + + List pairs = apiClient.parameterToPair("param-a", values); + assertEquals(0, pairs.size()); + } + + @Test + public void testParameterToPairsWhenNameIsInvalid() throws Exception { + List objects = new ArrayList(); + objects.add(new Integer(1)); + + List pairs_a = apiClient.parameterToPairs("csv", null, objects); + List pairs_b = apiClient.parameterToPairs("csv", "", objects); + + assertTrue(pairs_a.isEmpty()); + assertTrue(pairs_b.isEmpty()); + } + + @Test + public void testParameterToPairsWhenValueIsNull() throws Exception { + List pairs = apiClient.parameterToPairs("csv", "param-a", null); + + assertTrue(pairs.isEmpty()); + } + + @Test + public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { + // list of empty strings + List strs = new ArrayList(); + strs.add(" "); + strs.add(" "); + strs.add(" "); + + List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); + + assertEquals(1, concatStrings.size()); + assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters + } + + @Test + public void testParameterToPairsWhenValueIsCollection() throws Exception { + Map collectionFormatMap = new HashMap(); + collectionFormatMap.put("csv", ","); + collectionFormatMap.put("tsv", "\t"); + collectionFormatMap.put("ssv", " "); + collectionFormatMap.put("pipes", "|"); + collectionFormatMap.put("", ","); // no format, must default to csv + collectionFormatMap.put("unknown", ","); // all other formats, must default to csv + + String name = "param-a"; + + List values = new ArrayList(); + values.add("value-a"); + values.add(123); + values.add(new Date()); + + // check for multi separately + List multiPairs = apiClient.parameterToPairs("multi", name, values); + assertEquals(values.size(), multiPairs.size()); + for (int i = 0; i < values.size(); i++) { + assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), multiPairs.get(i).getValue()); + } + + // all other formats + for (String collectionFormat : collectionFormatMap.keySet()) { + List pairs = apiClient.parameterToPairs(collectionFormat, name, values); + + assertEquals(1, pairs.size()); + + String delimiter = collectionFormatMap.get(collectionFormat); + if (!delimiter.equals(",")) { + // commas are not escaped because they are reserved characters in URIs + delimiter = apiClient.escapeString(delimiter); + } + String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); + + // must equal input values + assertEquals(values.size(), pairValueSplit.length); + for (int i = 0; i < values.size(); i++) { + assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), pairValueSplit[i]); + } + } + } +} diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/ConfigurationTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/ConfigurationTest.java new file mode 100644 index 00000000000..f05c230dc75 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/ConfigurationTest.java @@ -0,0 +1,15 @@ +package org.openapitools.client; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class ConfigurationTest { + @Test + public void testDefaultApiClient() { + ApiClient apiClient = Configuration.getDefaultApiClient(); + assertNotNull(apiClient); + assertEquals("http://petstore.swagger.io:80/v2", apiClient.getBasePath()); + assertFalse(apiClient.isDebugging()); + } +} diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/StringUtilTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/StringUtilTest.java new file mode 100644 index 00000000000..aa7c81759ec --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/StringUtilTest.java @@ -0,0 +1,33 @@ +package org.openapitools.client; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class StringUtilTest { + @Test + public void testContainsIgnoreCase() { + assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "abc")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "ABC")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{"ABC"}, "abc")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, "ABC")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, null)); + + assertFalse(StringUtil.containsIgnoreCase(new String[]{"abc"}, "def")); + assertFalse(StringUtil.containsIgnoreCase(new String[]{}, "ABC")); + assertFalse(StringUtil.containsIgnoreCase(new String[]{}, null)); + } + + @Test + public void testJoin() { + String[] array = {"aa", "bb", "cc"}; + assertEquals("aa,bb,cc", StringUtil.join(array, ",")); + assertEquals("aa, bb, cc", StringUtil.join(array, ", ")); + assertEquals("aabbcc", StringUtil.join(array, "")); + assertEquals("aa bb cc", StringUtil.join(array, " ")); + assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); + + assertEquals("", StringUtil.join(new String[]{}, ",")); + assertEquals("abc", StringUtil.join(new String[]{"abc"}, ",")); + } +} diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java new file mode 100644 index 00000000000..d9b17065f7c --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java @@ -0,0 +1,47 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.openapitools.client.Pair; +import org.junit.*; +import static org.junit.Assert.*; + + +public class ApiKeyAuthTest { + @Test + public void testApplyToParamsInQuery() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); + auth.setApiKey("my-api-key"); + auth.applyToParams(queryParams, headerParams); + + assertEquals(1, queryParams.size()); + for (Pair queryParam : queryParams) { + assertEquals("my-api-key", queryParam.getValue()); + } + + // no changes to header parameters + assertEquals(0, headerParams.size()); + } + + @Test + public void testApplyToParamsInHeaderWithPrefix() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); + auth.setApiKey("my-api-token"); + auth.setApiKeyPrefix("Token"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); + } +} diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java new file mode 100644 index 00000000000..668342d96d7 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java @@ -0,0 +1,52 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.openapitools.client.Pair; +import org.junit.*; +import static org.junit.Assert.*; + + +public class HttpBasicAuthTest { + HttpBasicAuth auth = null; + + @Before + public void setup() { + auth = new HttpBasicAuth(); + } + + @Test + public void testApplyToParams() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + auth.setUsername("my-username"); + auth.setPassword("my-password"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix + String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; + assertEquals(expected, headerParams.get("Authorization")); + + // null username should be treated as empty string + auth.setUsername(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of ":my-password" with the "Basic " prefix + expected = "Basic Om15LXBhc3N3b3Jk"; + assertEquals(expected, headerParams.get("Authorization")); + + // null password should be treated as empty string + auth.setUsername("my-username"); + auth.setPassword(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of "my-username:" with the "Basic " prefix + expected = "Basic bXktdXNlcm5hbWU6"; + assertEquals(expected, headerParams.get("Authorization")); + } +} diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/EnumValueTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/EnumValueTest.java new file mode 100644 index 00000000000..47bfe940d3c --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/EnumValueTest.java @@ -0,0 +1,63 @@ +package org.openapitools.client.model; + +import org.junit.Test; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectWriter; +import com.fasterxml.jackson.databind.SerializationFeature; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class EnumValueTest { + + @Test + public void testEnumClass() { + assertEquals(EnumClass._ABC.toString(), "_abc"); + assertEquals(EnumClass._EFG.toString(), "-efg"); + assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); + } + + @Test + public void testEnumTest() { + // test enum value + EnumTest enumTest = new EnumTest(); + enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); + enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); + enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); + + assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); + assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); + + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); + + assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); + assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); + + try { + // test serialization (object => json) + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + ObjectWriter ow = mapper.writer(); + String json = ow.writeValueAsString(enumTest); + assertEquals(json, "{\"enum_string\":\"lower\",\"enum_string_required\":null,\"enum_integer\":1,\"enum_number\":1.1,\"outerEnum\":null}"); + + // test deserialization (json => object) + EnumTest fromString = mapper.readValue(json, EnumTest.class); + assertEquals(fromString.getEnumString().toString(), "lower"); + assertEquals(fromString.getEnumInteger().toString(), "1"); + assertEquals(fromString.getEnumNumber().toString(), "1.1"); + + } catch (Exception e) { + fail("Exception thrown during serialization/deserialzation of JSON: " + e.getMessage()); + } + } +} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java new file mode 100644 index 00000000000..6fb1e54b679 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java @@ -0,0 +1,250 @@ +package org.openapitools.client; + +import org.openapitools.client.auth.*; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.*; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class ApiClientTest { + ApiClient apiClient = null; + + @Before + public void setup() { + apiClient = new ApiClient(); + } + + @Test + public void testParseAndFormatDate() { + // default date format + String dateStr = "2015-11-07T03:49:09.356Z"; + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00"))); + + // custom date format: without milli-seconds, custom time zone + DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); + format.setTimeZone(TimeZone.getTimeZone("GMT+10")); + apiClient.setDateFormat(format); + dateStr = "2015-11-07T13:49:09+10:00"; + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00"))); + } + + @Test + public void testIsJsonMime() { + assertFalse(apiClient.isJsonMime(null)); + assertFalse(apiClient.isJsonMime("")); + assertFalse(apiClient.isJsonMime("text/plain")); + assertFalse(apiClient.isJsonMime("application/xml")); + assertFalse(apiClient.isJsonMime("application/jsonp")); + assertFalse(apiClient.isJsonMime("example/json")); + assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); + assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); + + assertTrue(apiClient.isJsonMime("application/json")); + assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); + assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); + + assertTrue(apiClient.isJsonMime("application/problem+json")); + assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); + assertTrue(apiClient.isJsonMime("application/json\t")); + assertTrue(apiClient.isJsonMime("example/foo+bar+json")); + assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); + assertTrue(apiClient.isJsonMime("example/foo+json\t;")); + assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); + } + + @Test + public void testSelectHeaderAccept() { + String[] accepts = {"application/json", "application/xml"}; + assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; + assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"text/plain", "application/xml"}; + assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{}; + assertNull(apiClient.selectHeaderAccept(accepts)); + } + + @Test + public void testSelectHeaderContentType() { + String[] contentTypes = {"application/json", "application/xml"}; + assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; + assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"text/plain", "application/xml"}; + assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{}; + assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); + } + + @Test + public void testGetAuthentications() { + Map auths = apiClient.getAuthentications(); + + Authentication auth = auths.get("api_key"); + assertNotNull(auth); + assertTrue(auth instanceof ApiKeyAuth); + ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; + assertEquals("header", apiKeyAuth.getLocation()); + assertEquals("api_key", apiKeyAuth.getParamName()); + + auth = auths.get("petstore_auth"); + assertTrue(auth instanceof OAuth); + assertSame(auth, apiClient.getAuthentication("petstore_auth")); + + assertNull(auths.get("unknown")); + + try { + auths.put("my_auth", new HttpBasicAuth()); + fail("the authentications returned should not be modifiable"); + } catch (UnsupportedOperationException e) { + } + } + + @Ignore("There is no more basic auth in petstore security definitions") + @Test + public void testSetUsernameAndPassword() { + HttpBasicAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof HttpBasicAuth) { + auth = (HttpBasicAuth) _auth; + break; + } + } + auth.setUsername(null); + auth.setPassword(null); + + apiClient.setUsername("my-username"); + apiClient.setPassword("my-password"); + assertEquals("my-username", auth.getUsername()); + assertEquals("my-password", auth.getPassword()); + + // reset values + auth.setUsername(null); + auth.setPassword(null); + } + + @Test + public void testSetApiKeyAndPrefix() { + ApiKeyAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof ApiKeyAuth) { + auth = (ApiKeyAuth) _auth; + break; + } + } + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + + apiClient.setApiKey("my-api-key"); + apiClient.setApiKeyPrefix("Token"); + assertEquals("my-api-key", auth.getApiKey()); + assertEquals("Token", auth.getApiKeyPrefix()); + + // reset values + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + } + + @Test + public void testParameterToPairsWhenNameIsInvalid() throws Exception { + List pairs_a = apiClient.parameterToPairs("csv", null, new Integer(1)); + List pairs_b = apiClient.parameterToPairs("csv", "", new Integer(1)); + + assertTrue(pairs_a.isEmpty()); + assertTrue(pairs_b.isEmpty()); + } + + @Test + public void testParameterToPairsWhenValueIsNull() throws Exception { + List pairs = apiClient.parameterToPairs("csv", "param-a", null); + + assertTrue(pairs.isEmpty()); + } + + @Test + public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { + + // single empty string + List pairs = apiClient.parameterToPairs("csv", "param-a", " "); + assertEquals(1, pairs.size()); + + // list of empty strings + List strs = new ArrayList(); + strs.add(" "); + strs.add(" "); + strs.add(" "); + + List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); + + assertEquals(1, concatStrings.size()); + assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters + } + + @Test + public void testParameterToPairsWhenValueIsNotCollection() throws Exception { + String name = "param-a"; + Integer value = 1; + + List pairs = apiClient.parameterToPairs("csv", name, value); + + assertEquals(1, pairs.size()); + assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); + } + + @Test + public void testParameterToPairsWhenValueIsCollection() throws Exception { + Map collectionFormatMap = new HashMap(); + collectionFormatMap.put("csv", ","); + collectionFormatMap.put("tsv", "\t"); + collectionFormatMap.put("ssv", " "); + collectionFormatMap.put("pipes", "\\|"); + collectionFormatMap.put("", ","); // no format, must default to csv + collectionFormatMap.put("unknown", ","); // all other formats, must default to csv + + String name = "param-a"; + + List values = new ArrayList(); + values.add("value-a"); + values.add(123); + values.add(new Date()); + + // check for multi separately + List multiPairs = apiClient.parameterToPairs("multi", name, values); + assertEquals(values.size(), multiPairs.size()); + + // all other formats + for (String collectionFormat : collectionFormatMap.keySet()) { + List pairs = apiClient.parameterToPairs(collectionFormat, name, values); + + assertEquals(1, pairs.size()); + + String delimiter = collectionFormatMap.get(collectionFormat); + String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); + + // must equal input values + assertEquals(values.size(), pairValueSplit.length); + } + } +} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ConfigurationTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ConfigurationTest.java new file mode 100644 index 00000000000..f05c230dc75 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ConfigurationTest.java @@ -0,0 +1,15 @@ +package org.openapitools.client; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class ConfigurationTest { + @Test + public void testDefaultApiClient() { + ApiClient apiClient = Configuration.getDefaultApiClient(); + assertNotNull(apiClient); + assertEquals("http://petstore.swagger.io:80/v2", apiClient.getBasePath()); + assertFalse(apiClient.isDebugging()); + } +} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java new file mode 100644 index 00000000000..7fb307a3df8 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java @@ -0,0 +1,45 @@ +package org.openapitools.client; + +import org.openapitools.client.model.Order; + +import java.lang.Exception; + +import java.time.OffsetDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import org.junit.*; +import static org.junit.Assert.*; + + +public class JSONTest { + JSON json = null; + Order order = null; + + @Before + public void setup() { + json = new JSON(); + order = new Order(); + } + + @Test + public void testDefaultDate() throws Exception { + final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + final String dateStr = "2015-11-07T14:11:05.267Z"; + order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime::from)); + + String str = json.getContext(null).writeValueAsString(order); + Order o = json.getContext(null).readValue(str, Order.class); + assertEquals(dateStr, dateFormat.format(o.getShipDate())); + } + + @Test + public void testCustomDate() throws Exception { + final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); + final String dateStr = "2015-11-07T14:11:05-02:00"; + order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime::from)); + + String str = json.getContext(null).writeValueAsString(order); + Order o = json.getContext(null).readValue(str, Order.class); + assertEquals(dateStr, dateFormat.format(o.getShipDate())); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/StringUtilTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/StringUtilTest.java new file mode 100644 index 00000000000..aa7c81759ec --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/StringUtilTest.java @@ -0,0 +1,33 @@ +package org.openapitools.client; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class StringUtilTest { + @Test + public void testContainsIgnoreCase() { + assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "abc")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "ABC")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{"ABC"}, "abc")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, "ABC")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, null)); + + assertFalse(StringUtil.containsIgnoreCase(new String[]{"abc"}, "def")); + assertFalse(StringUtil.containsIgnoreCase(new String[]{}, "ABC")); + assertFalse(StringUtil.containsIgnoreCase(new String[]{}, null)); + } + + @Test + public void testJoin() { + String[] array = {"aa", "bb", "cc"}; + assertEquals("aa,bb,cc", StringUtil.join(array, ",")); + assertEquals("aa, bb, cc", StringUtil.join(array, ", ")); + assertEquals("aabbcc", StringUtil.join(array, "")); + assertEquals("aa bb cc", StringUtil.join(array, " ")); + assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); + + assertEquals("", StringUtil.join(new String[]{}, ",")); + assertEquals("abc", StringUtil.join(new String[]{"abc"}, ",")); + } +} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java new file mode 100644 index 00000000000..d9b17065f7c --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java @@ -0,0 +1,47 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.openapitools.client.Pair; +import org.junit.*; +import static org.junit.Assert.*; + + +public class ApiKeyAuthTest { + @Test + public void testApplyToParamsInQuery() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); + auth.setApiKey("my-api-key"); + auth.applyToParams(queryParams, headerParams); + + assertEquals(1, queryParams.size()); + for (Pair queryParam : queryParams) { + assertEquals("my-api-key", queryParam.getValue()); + } + + // no changes to header parameters + assertEquals(0, headerParams.size()); + } + + @Test + public void testApplyToParamsInHeaderWithPrefix() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); + auth.setApiKey("my-api-token"); + auth.setApiKeyPrefix("Token"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); + } +} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java new file mode 100644 index 00000000000..668342d96d7 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java @@ -0,0 +1,52 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.openapitools.client.Pair; +import org.junit.*; +import static org.junit.Assert.*; + + +public class HttpBasicAuthTest { + HttpBasicAuth auth = null; + + @Before + public void setup() { + auth = new HttpBasicAuth(); + } + + @Test + public void testApplyToParams() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + auth.setUsername("my-username"); + auth.setPassword("my-password"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix + String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; + assertEquals(expected, headerParams.get("Authorization")); + + // null username should be treated as empty string + auth.setUsername(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of ":my-password" with the "Basic " prefix + expected = "Basic Om15LXBhc3N3b3Jk"; + assertEquals(expected, headerParams.get("Authorization")); + + // null password should be treated as empty string + auth.setUsername("my-username"); + auth.setPassword(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of "my-username:" with the "Basic " prefix + expected = "Basic bXktdXNlcm5hbWU6"; + assertEquals(expected, headerParams.get("Authorization")); + } +} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumValueTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumValueTest.java new file mode 100644 index 00000000000..47bfe940d3c --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/EnumValueTest.java @@ -0,0 +1,63 @@ +package org.openapitools.client.model; + +import org.junit.Test; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectWriter; +import com.fasterxml.jackson.databind.SerializationFeature; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class EnumValueTest { + + @Test + public void testEnumClass() { + assertEquals(EnumClass._ABC.toString(), "_abc"); + assertEquals(EnumClass._EFG.toString(), "-efg"); + assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); + } + + @Test + public void testEnumTest() { + // test enum value + EnumTest enumTest = new EnumTest(); + enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); + enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); + enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); + + assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); + assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); + + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); + + assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); + assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); + + try { + // test serialization (object => json) + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + ObjectWriter ow = mapper.writer(); + String json = ow.writeValueAsString(enumTest); + assertEquals(json, "{\"enum_string\":\"lower\",\"enum_string_required\":null,\"enum_integer\":1,\"enum_number\":1.1,\"outerEnum\":null}"); + + // test deserialization (json => object) + EnumTest fromString = mapper.readValue(json, EnumTest.class); + assertEquals(fromString.getEnumString().toString(), "lower"); + assertEquals(fromString.getEnumInteger().toString(), "1"); + assertEquals(fromString.getEnumNumber().toString(), "1.1"); + + } catch (Exception e) { + fail("Exception thrown during serialization/deserialzation of JSON: " + e.getMessage()); + } + } +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/ApiClientTest.java new file mode 100644 index 00000000000..6fb1e54b679 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/ApiClientTest.java @@ -0,0 +1,250 @@ +package org.openapitools.client; + +import org.openapitools.client.auth.*; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.*; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class ApiClientTest { + ApiClient apiClient = null; + + @Before + public void setup() { + apiClient = new ApiClient(); + } + + @Test + public void testParseAndFormatDate() { + // default date format + String dateStr = "2015-11-07T03:49:09.356Z"; + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00"))); + + // custom date format: without milli-seconds, custom time zone + DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); + format.setTimeZone(TimeZone.getTimeZone("GMT+10")); + apiClient.setDateFormat(format); + dateStr = "2015-11-07T13:49:09+10:00"; + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00"))); + } + + @Test + public void testIsJsonMime() { + assertFalse(apiClient.isJsonMime(null)); + assertFalse(apiClient.isJsonMime("")); + assertFalse(apiClient.isJsonMime("text/plain")); + assertFalse(apiClient.isJsonMime("application/xml")); + assertFalse(apiClient.isJsonMime("application/jsonp")); + assertFalse(apiClient.isJsonMime("example/json")); + assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); + assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); + + assertTrue(apiClient.isJsonMime("application/json")); + assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); + assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); + + assertTrue(apiClient.isJsonMime("application/problem+json")); + assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); + assertTrue(apiClient.isJsonMime("application/json\t")); + assertTrue(apiClient.isJsonMime("example/foo+bar+json")); + assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); + assertTrue(apiClient.isJsonMime("example/foo+json\t;")); + assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); + } + + @Test + public void testSelectHeaderAccept() { + String[] accepts = {"application/json", "application/xml"}; + assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; + assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"text/plain", "application/xml"}; + assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{}; + assertNull(apiClient.selectHeaderAccept(accepts)); + } + + @Test + public void testSelectHeaderContentType() { + String[] contentTypes = {"application/json", "application/xml"}; + assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; + assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"text/plain", "application/xml"}; + assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{}; + assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); + } + + @Test + public void testGetAuthentications() { + Map auths = apiClient.getAuthentications(); + + Authentication auth = auths.get("api_key"); + assertNotNull(auth); + assertTrue(auth instanceof ApiKeyAuth); + ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; + assertEquals("header", apiKeyAuth.getLocation()); + assertEquals("api_key", apiKeyAuth.getParamName()); + + auth = auths.get("petstore_auth"); + assertTrue(auth instanceof OAuth); + assertSame(auth, apiClient.getAuthentication("petstore_auth")); + + assertNull(auths.get("unknown")); + + try { + auths.put("my_auth", new HttpBasicAuth()); + fail("the authentications returned should not be modifiable"); + } catch (UnsupportedOperationException e) { + } + } + + @Ignore("There is no more basic auth in petstore security definitions") + @Test + public void testSetUsernameAndPassword() { + HttpBasicAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof HttpBasicAuth) { + auth = (HttpBasicAuth) _auth; + break; + } + } + auth.setUsername(null); + auth.setPassword(null); + + apiClient.setUsername("my-username"); + apiClient.setPassword("my-password"); + assertEquals("my-username", auth.getUsername()); + assertEquals("my-password", auth.getPassword()); + + // reset values + auth.setUsername(null); + auth.setPassword(null); + } + + @Test + public void testSetApiKeyAndPrefix() { + ApiKeyAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof ApiKeyAuth) { + auth = (ApiKeyAuth) _auth; + break; + } + } + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + + apiClient.setApiKey("my-api-key"); + apiClient.setApiKeyPrefix("Token"); + assertEquals("my-api-key", auth.getApiKey()); + assertEquals("Token", auth.getApiKeyPrefix()); + + // reset values + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + } + + @Test + public void testParameterToPairsWhenNameIsInvalid() throws Exception { + List pairs_a = apiClient.parameterToPairs("csv", null, new Integer(1)); + List pairs_b = apiClient.parameterToPairs("csv", "", new Integer(1)); + + assertTrue(pairs_a.isEmpty()); + assertTrue(pairs_b.isEmpty()); + } + + @Test + public void testParameterToPairsWhenValueIsNull() throws Exception { + List pairs = apiClient.parameterToPairs("csv", "param-a", null); + + assertTrue(pairs.isEmpty()); + } + + @Test + public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { + + // single empty string + List pairs = apiClient.parameterToPairs("csv", "param-a", " "); + assertEquals(1, pairs.size()); + + // list of empty strings + List strs = new ArrayList(); + strs.add(" "); + strs.add(" "); + strs.add(" "); + + List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); + + assertEquals(1, concatStrings.size()); + assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters + } + + @Test + public void testParameterToPairsWhenValueIsNotCollection() throws Exception { + String name = "param-a"; + Integer value = 1; + + List pairs = apiClient.parameterToPairs("csv", name, value); + + assertEquals(1, pairs.size()); + assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); + } + + @Test + public void testParameterToPairsWhenValueIsCollection() throws Exception { + Map collectionFormatMap = new HashMap(); + collectionFormatMap.put("csv", ","); + collectionFormatMap.put("tsv", "\t"); + collectionFormatMap.put("ssv", " "); + collectionFormatMap.put("pipes", "\\|"); + collectionFormatMap.put("", ","); // no format, must default to csv + collectionFormatMap.put("unknown", ","); // all other formats, must default to csv + + String name = "param-a"; + + List values = new ArrayList(); + values.add("value-a"); + values.add(123); + values.add(new Date()); + + // check for multi separately + List multiPairs = apiClient.parameterToPairs("multi", name, values); + assertEquals(values.size(), multiPairs.size()); + + // all other formats + for (String collectionFormat : collectionFormatMap.keySet()) { + List pairs = apiClient.parameterToPairs(collectionFormat, name, values); + + assertEquals(1, pairs.size()); + + String delimiter = collectionFormatMap.get(collectionFormat); + String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); + + // must equal input values + assertEquals(values.size(), pairValueSplit.length); + } + } +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/ConfigurationTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/ConfigurationTest.java new file mode 100644 index 00000000000..f05c230dc75 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/ConfigurationTest.java @@ -0,0 +1,15 @@ +package org.openapitools.client; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class ConfigurationTest { + @Test + public void testDefaultApiClient() { + ApiClient apiClient = Configuration.getDefaultApiClient(); + assertNotNull(apiClient); + assertEquals("http://petstore.swagger.io:80/v2", apiClient.getBasePath()); + assertFalse(apiClient.isDebugging()); + } +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/JSONTest.java new file mode 100644 index 00000000000..f21b852065c --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/JSONTest.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import org.openapitools.client.model.Order; +import org.junit.Before; +import org.junit.Test; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.format.DateTimeFormatter; + +import static org.junit.Assert.*; + + +public class JSONTest { + private JSON json = null; + private Order order = null; + + @Before + public void setup() { + json = new ApiClient().getJSON(); + order = new Order(); + } + + @Test + public void testDefaultDate() throws Exception { + final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + final String dateStr = "2015-11-07T14:11:05.267Z"; + order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime.FROM)); + + String str = json.getContext(null).writeValueAsString(order); + Order o = json.getContext(null).readValue(str, Order.class); + assertEquals(dateStr, dateFormat.format(o.getShipDate())); + } + + @Test + public void testCustomDate() throws Exception { + final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); + final String dateStr = "2015-11-07T14:11:05-02:00"; + order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime.FROM)); + + String str = json.getContext(null).writeValueAsString(order); + Order o = json.getContext(null).readValue(str, Order.class); + assertEquals(dateStr, dateFormat.format(o.getShipDate())); + } + + @Test + public void testSqlDateSerialization() throws Exception { + String str = json.getContext(null).writeValueAsString(new java.sql.Date(10)); + assertEquals("\"1970-01-01\"", str); + } + + @Test + public void testSqlDateDeserialization() throws Exception { + final String str = "1970-01-01"; + java.sql.Date date = json.getContext(null).readValue("\"" + str + "\"", java.sql.Date.class); + assertEquals(date.toString(), str); + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/StringUtilTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/StringUtilTest.java new file mode 100644 index 00000000000..aa7c81759ec --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/StringUtilTest.java @@ -0,0 +1,33 @@ +package org.openapitools.client; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class StringUtilTest { + @Test + public void testContainsIgnoreCase() { + assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "abc")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "ABC")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{"ABC"}, "abc")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, "ABC")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, null)); + + assertFalse(StringUtil.containsIgnoreCase(new String[]{"abc"}, "def")); + assertFalse(StringUtil.containsIgnoreCase(new String[]{}, "ABC")); + assertFalse(StringUtil.containsIgnoreCase(new String[]{}, null)); + } + + @Test + public void testJoin() { + String[] array = {"aa", "bb", "cc"}; + assertEquals("aa,bb,cc", StringUtil.join(array, ",")); + assertEquals("aa, bb, cc", StringUtil.join(array, ", ")); + assertEquals("aabbcc", StringUtil.join(array, "")); + assertEquals("aa bb cc", StringUtil.join(array, " ")); + assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); + + assertEquals("", StringUtil.join(new String[]{}, ",")); + assertEquals("abc", StringUtil.join(new String[]{"abc"}, ",")); + } +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java new file mode 100644 index 00000000000..d9b17065f7c --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java @@ -0,0 +1,47 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.openapitools.client.Pair; +import org.junit.*; +import static org.junit.Assert.*; + + +public class ApiKeyAuthTest { + @Test + public void testApplyToParamsInQuery() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); + auth.setApiKey("my-api-key"); + auth.applyToParams(queryParams, headerParams); + + assertEquals(1, queryParams.size()); + for (Pair queryParam : queryParams) { + assertEquals("my-api-key", queryParam.getValue()); + } + + // no changes to header parameters + assertEquals(0, headerParams.size()); + } + + @Test + public void testApplyToParamsInHeaderWithPrefix() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); + auth.setApiKey("my-api-token"); + auth.setApiKeyPrefix("Token"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); + } +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java new file mode 100644 index 00000000000..668342d96d7 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java @@ -0,0 +1,52 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.openapitools.client.Pair; +import org.junit.*; +import static org.junit.Assert.*; + + +public class HttpBasicAuthTest { + HttpBasicAuth auth = null; + + @Before + public void setup() { + auth = new HttpBasicAuth(); + } + + @Test + public void testApplyToParams() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + auth.setUsername("my-username"); + auth.setPassword("my-password"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix + String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; + assertEquals(expected, headerParams.get("Authorization")); + + // null username should be treated as empty string + auth.setUsername(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of ":my-password" with the "Basic " prefix + expected = "Basic Om15LXBhc3N3b3Jk"; + assertEquals(expected, headerParams.get("Authorization")); + + // null password should be treated as empty string + auth.setUsername("my-username"); + auth.setPassword(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of "my-username:" with the "Basic " prefix + expected = "Basic bXktdXNlcm5hbWU6"; + assertEquals(expected, headerParams.get("Authorization")); + } +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumValueTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumValueTest.java new file mode 100644 index 00000000000..47bfe940d3c --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumValueTest.java @@ -0,0 +1,63 @@ +package org.openapitools.client.model; + +import org.junit.Test; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectWriter; +import com.fasterxml.jackson.databind.SerializationFeature; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class EnumValueTest { + + @Test + public void testEnumClass() { + assertEquals(EnumClass._ABC.toString(), "_abc"); + assertEquals(EnumClass._EFG.toString(), "-efg"); + assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); + } + + @Test + public void testEnumTest() { + // test enum value + EnumTest enumTest = new EnumTest(); + enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); + enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); + enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); + + assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); + assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); + + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); + + assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); + assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); + + try { + // test serialization (object => json) + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + ObjectWriter ow = mapper.writer(); + String json = ow.writeValueAsString(enumTest); + assertEquals(json, "{\"enum_string\":\"lower\",\"enum_string_required\":null,\"enum_integer\":1,\"enum_number\":1.1,\"outerEnum\":null}"); + + // test deserialization (json => object) + EnumTest fromString = mapper.readValue(json, EnumTest.class); + assertEquals(fromString.getEnumString().toString(), "lower"); + assertEquals(fromString.getEnumInteger().toString(), "1"); + assertEquals(fromString.getEnumNumber().toString(), "1.1"); + + } catch (Exception e) { + fail("Exception thrown during serialization/deserialzation of JSON: " + e.getMessage()); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java new file mode 100644 index 00000000000..5167afc326b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java @@ -0,0 +1,330 @@ +package org.openapitools.client; + +import org.openapitools.client.auth.*; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.TimeZone; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class ApiClientTest { + ApiClient apiClient; + JSON json; + + @Before + public void setup() { + apiClient = new ApiClient(); + json = apiClient.getJSON(); + } + + @Test + public void testIsJsonMime() { + assertFalse(apiClient.isJsonMime(null)); + assertFalse(apiClient.isJsonMime("")); + assertFalse(apiClient.isJsonMime("text/plain")); + assertFalse(apiClient.isJsonMime("application/xml")); + assertFalse(apiClient.isJsonMime("application/jsonp")); + assertFalse(apiClient.isJsonMime("example/json")); + assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); + assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); + + assertTrue(apiClient.isJsonMime("application/json")); + assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); + assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); + + assertTrue(apiClient.isJsonMime("application/problem+json")); + assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); + assertTrue(apiClient.isJsonMime("application/json\t")); + assertTrue(apiClient.isJsonMime("example/foo+bar+json")); + assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); + assertTrue(apiClient.isJsonMime("example/foo+json\t;")); + assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); + + assertTrue(apiClient.isJsonMime("application/json-patch+json")); + } + + @Test + public void testSelectHeaderAccept() { + String[] accepts = {"application/json", "application/xml"}; + assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; + assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"text/plain", "application/xml"}; + assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{}; + assertNull(apiClient.selectHeaderAccept(accepts)); + } + + @Test + public void testSelectHeaderContentType() { + String[] contentTypes = {"application/json", "application/xml"}; + assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; + assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"text/plain", "application/xml"}; + assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{}; + assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); + } + + @Test + public void testGetAuthentications() { + Map auths = apiClient.getAuthentications(); + + Authentication auth = auths.get("api_key"); + assertNotNull(auth); + assertTrue(auth instanceof ApiKeyAuth); + ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; + assertEquals("header", apiKeyAuth.getLocation()); + assertEquals("api_key", apiKeyAuth.getParamName()); + + auth = auths.get("petstore_auth"); + assertTrue(auth instanceof OAuth); + assertSame(auth, apiClient.getAuthentication("petstore_auth")); + + assertNull(auths.get("unknown")); + + try { + auths.put("my_auth", new HttpBasicAuth()); + fail("the authentications returned should not be modifiable"); + } catch (UnsupportedOperationException e) { + } + } + + /* + @Test + public void testSetUsernameAndPassword() { + HttpBasicAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof HttpBasicAuth) { + auth = (HttpBasicAuth) _auth; + break; + } + } + auth.setUsername(null); + auth.setPassword(null); + + apiClient.setUsername("my-username"); + apiClient.setPassword("my-password"); + assertEquals("my-username", auth.getUsername()); + assertEquals("my-password", auth.getPassword()); + + // reset values + auth.setUsername(null); + auth.setPassword(null); + } + */ + + @Test + public void testSetApiKeyAndPrefix() { + ApiKeyAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof ApiKeyAuth) { + auth = (ApiKeyAuth) _auth; + break; + } + } + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + + apiClient.setApiKey("my-api-key"); + apiClient.setApiKeyPrefix("Token"); + assertEquals("my-api-key", auth.getApiKey()); + assertEquals("Token", auth.getApiKeyPrefix()); + + // reset values + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + } + + @Test + public void testGetAndSetConnectTimeout() { + // connect timeout defaults to 10 seconds + assertEquals(10000, apiClient.getConnectTimeout()); + assertEquals(10000, apiClient.getHttpClient().getConnectTimeout()); + + apiClient.setConnectTimeout(0); + assertEquals(0, apiClient.getConnectTimeout()); + assertEquals(0, apiClient.getHttpClient().getConnectTimeout()); + + apiClient.setConnectTimeout(10000); + } + + @Test + public void testGetAndSetReadTimeout() { + // read timeout defaults to 10 seconds + assertEquals(10000, apiClient.getReadTimeout()); + assertEquals(10000, apiClient.getHttpClient().getReadTimeout()); + + apiClient.setReadTimeout(0); + assertEquals(0, apiClient.getReadTimeout()); + assertEquals(0, apiClient.getHttpClient().getReadTimeout()); + + apiClient.setReadTimeout(10000); + } + + @Test + public void testGetAndSetWriteTimeout() { + // write timeout defaults to 10 seconds + assertEquals(10000, apiClient.getWriteTimeout()); + assertEquals(10000, apiClient.getHttpClient().getWriteTimeout()); + + apiClient.setWriteTimeout(0); + assertEquals(0, apiClient.getWriteTimeout()); + assertEquals(0, apiClient.getHttpClient().getWriteTimeout()); + + apiClient.setWriteTimeout(10000); + } + + @Test + public void testParameterToPairWhenNameIsInvalid() throws Exception { + List pairs_a = apiClient.parameterToPair(null, new Integer(1)); + List pairs_b = apiClient.parameterToPair("", new Integer(1)); + + assertTrue(pairs_a.isEmpty()); + assertTrue(pairs_b.isEmpty()); + } + + @Test + public void testParameterToPairWhenValueIsNull() throws Exception { + List pairs = apiClient.parameterToPair("param-a", null); + + assertTrue(pairs.isEmpty()); + } + + @Test + public void testParameterToPairWhenValueIsEmptyString() throws Exception { + // single empty string + List pairs = apiClient.parameterToPair("param-a", " "); + assertEquals(1, pairs.size()); + } + + @Test + public void testParameterToPairWhenValueIsNotCollection() throws Exception { + String name = "param-a"; + Integer value = 1; + + List pairs = apiClient.parameterToPair(name, value); + + assertEquals(1, pairs.size()); + assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); + } + + @Test + public void testParameterToPairWhenValueIsCollection() throws Exception { + List values = new ArrayList(); + values.add("value-a"); + values.add(123); + values.add(new Date()); + + List pairs = apiClient.parameterToPair("param-a", values); + assertEquals(0, pairs.size()); + } + + @Test + public void testParameterToPairsWhenNameIsInvalid() throws Exception { + List objects = new ArrayList(); + objects.add(new Integer(1)); + + List pairs_a = apiClient.parameterToPairs("csv", null, objects); + List pairs_b = apiClient.parameterToPairs("csv", "", objects); + + assertTrue(pairs_a.isEmpty()); + assertTrue(pairs_b.isEmpty()); + } + + @Test + public void testParameterToPairsWhenValueIsNull() throws Exception { + List pairs = apiClient.parameterToPairs("csv", "param-a", null); + + assertTrue(pairs.isEmpty()); + } + + @Test + public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { + // list of empty strings + List strs = new ArrayList(); + strs.add(" "); + strs.add(" "); + strs.add(" "); + + List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); + + assertEquals(1, concatStrings.size()); + assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters + } + + @Test + public void testParameterToPairsWhenValueIsCollection() throws Exception { + Map collectionFormatMap = new HashMap(); + collectionFormatMap.put("csv", ","); + collectionFormatMap.put("tsv", "\t"); + collectionFormatMap.put("ssv", " "); + collectionFormatMap.put("pipes", "|"); + collectionFormatMap.put("", ","); // no format, must default to csv + collectionFormatMap.put("unknown", ","); // all other formats, must default to csv + + String name = "param-a"; + + List values = new ArrayList(); + values.add("value-a"); + values.add(123); + values.add(new Date()); + + // check for multi separately + List multiPairs = apiClient.parameterToPairs("multi", name, values); + assertEquals(values.size(), multiPairs.size()); + for (int i = 0; i < values.size(); i++) { + assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), multiPairs.get(i).getValue()); + } + + // all other formats + for (String collectionFormat : collectionFormatMap.keySet()) { + List pairs = apiClient.parameterToPairs(collectionFormat, name, values); + + assertEquals(1, pairs.size()); + + String delimiter = collectionFormatMap.get(collectionFormat); + if (!delimiter.equals(",")) { + // commas are not escaped because they are reserved characters in URIs + delimiter = apiClient.escapeString(delimiter); + } + String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); + + // must equal input values + assertEquals(values.size(), pairValueSplit.length); + for (int i = 0; i < values.size(); i++) { + assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), pairValueSplit[i]); + } + } + } + + @Test + public void testSanitizeFilename() { + assertEquals("sun", apiClient.sanitizeFilename("sun")); + assertEquals("sun.gif", apiClient.sanitizeFilename("sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("../sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("/var/tmp/sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("./sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("..\\sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("\\var\\tmp\\sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename("c:\\var\\tmp\\sun.gif")); + assertEquals("sun.gif", apiClient.sanitizeFilename(".\\sun.gif")); + } +} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ConfigurationTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ConfigurationTest.java new file mode 100644 index 00000000000..f05c230dc75 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ConfigurationTest.java @@ -0,0 +1,15 @@ +package org.openapitools.client; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class ConfigurationTest { + @Test + public void testDefaultApiClient() { + ApiClient apiClient = Configuration.getDefaultApiClient(); + assertNotNull(apiClient); + assertEquals("http://petstore.swagger.io:80/v2", apiClient.getBasePath()); + assertFalse(apiClient.isDebugging()); + } +} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java new file mode 100644 index 00000000000..e7687d0b33b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java @@ -0,0 +1,201 @@ +package org.openapitools.client; + +import com.google.gson.reflect.TypeToken; + +import org.openapitools.client.model.Order; + +import java.lang.Exception; +import java.lang.reflect.Type; +import java.nio.charset.StandardCharsets; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +import okio.ByteString; +import org.junit.*; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.ZoneOffset; +import org.threeten.bp.format.DateTimeFormatter; + +import static org.junit.Assert.*; + +public class JSONTest { + private ApiClient apiClient = null; + private JSON json = null; + private Order order = null; + + @Before + public void setup() { + apiClient = new ApiClient(); + json = apiClient.getJSON(); + order = new Order(); + } + + @Test + public void testSqlDateTypeAdapter() { + final String str = "\"2015-11-07\""; + final java.sql.Date date = java.sql.Date.valueOf("2015-11-07"); + + assertEquals(str, json.serialize(date)); + assertEquals(json.deserialize(str, java.sql.Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.356" + getCurrentTimezoneOffset() + "\"", java.sql.Date.class).toString(), date.toString()); + + // custom date format: without day + DateFormat format = new SimpleDateFormat("yyyy-MM"); + apiClient.setSqlDateFormat(format); + String dateStr = "\"2015-11\""; + assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", java.sql.Date.class))); + assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11\"", java.sql.Date.class))); + } + + @Test + public void testDateTypeAdapter() { + Calendar cal = new GregorianCalendar(2015, 10, 7, 3, 49, 9); + cal.setTimeZone(TimeZone.getTimeZone("UTC")); + + assertEquals(json.deserialize("\"2015-11-07T05:49:09+02\"", Date.class), cal.getTime()); + + cal.set(Calendar.MILLISECOND, 300); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.3Z\"", Date.class), cal.getTime()); + + cal.set(Calendar.MILLISECOND, 356); + Date date = cal.getTime(); + + final String utcDate = "\"2015-11-07T03:49:09.356Z\""; + assertEquals(json.deserialize(utcDate, Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.356+00:00\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T05:49:09.356+02:00\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T02:49:09.356-01:00\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.356Z\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.356+00\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T02:49:09.356-0100\"", Date.class), date); + assertEquals(json.deserialize("\"2015-11-07T03:49:09.356456789Z\"", Date.class), date); + + assertEquals(utcDate, json.serialize(date)); + + // custom datetime format: without milli-seconds, custom time zone + DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); + format.setTimeZone(TimeZone.getTimeZone("GMT+10")); + apiClient.setDateFormat(format); + + String dateStr = "\"2015-11-07T13:49:09+10:00\""; + assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09+00:00\"", Date.class))); + assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", Date.class))); + assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T00:49:09-03:00\"", Date.class))); + + try { + // invalid time zone format + json.deserialize("\"2015-11-07T03:49:09+00\"", Date.class); + fail("json parsing should fail"); + } catch (RuntimeException e) { + // OK + } + try { + // unexpected miliseconds + json.deserialize("\"2015-11-07T03:49:09.000Z\"", Date.class); + fail("json parsing should fail"); + } catch (RuntimeException e) { + // OK + } + + } + + @Test + public void testOffsetDateTimeTypeAdapter() { + final String str = "\"2016-09-09T08:02:03.123-03:00\""; + OffsetDateTime date = OffsetDateTime.of(2016, 9, 9, 8, 2, 3, 123000000, ZoneOffset.of("-3")); + + assertEquals(str, json.serialize(date)); + //Use toString() instead of isEqual to verify that the offset is preserved + assertEquals(json.deserialize(str, OffsetDateTime.class).toString(), date.toString()); + } + + @Test + public void testLocalDateTypeAdapter() { + final String str = "\"2016-09-09\""; + final LocalDate date = LocalDate.of(2016, 9, 9); + + assertEquals(str, json.serialize(date)); + assertEquals(json.deserialize(str, LocalDate.class), date); + } + + + @Test + public void testDefaultDate() throws Exception { + final DateTimeFormatter datetimeFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + final String dateStr = "2015-11-07T14:11:05.267Z"; + order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); + + String str = json.serialize(order); + Type type = new TypeToken() { }.getType(); + Order o = json.deserialize(str, type); + assertEquals(dateStr, datetimeFormat.format(o.getShipDate())); + } + + @Test + public void testCustomDate() throws Exception { + final DateTimeFormatter datetimeFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); + final String dateStr = "2015-11-07T14:11:05-02:00"; + order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); + + String str = json.serialize(order); + Type type = new TypeToken() { }.getType(); + Order o = json.deserialize(str, type); + assertEquals(dateStr, datetimeFormat.format(o.getShipDate())); + } + + @Test + public void testByteArrayTypeAdapterSerialization() { + // Arrange + final String expectedBytesAsString = "Let's pretend this a jpg or something"; + final byte[] expectedBytes = expectedBytesAsString.getBytes(StandardCharsets.UTF_8); + + // Act + String serializedBytesWithQuotes = json.serialize(expectedBytes); + + // Assert + String serializedBytes = serializedBytesWithQuotes.substring(1, serializedBytesWithQuotes.length() - 1); + if (json.getGson().htmlSafe()) { + serializedBytes = serializedBytes.replaceAll("\\\\u003d", "="); + } + ByteString actualAsByteString = ByteString.decodeBase64(serializedBytes); + byte[] actualBytes = actualAsByteString.toByteArray(); + assertEquals(expectedBytesAsString, new String(actualBytes, StandardCharsets.UTF_8)); + } + + @Test + public void testByteArrayTypeAdapterDeserialization() { + // Arrange + final String expectedBytesAsString = "Let's pretend this a jpg or something"; + final byte[] expectedBytes = expectedBytesAsString.getBytes(StandardCharsets.UTF_8); + final ByteString expectedByteString = ByteString.of(expectedBytes); + final String serializedBytes = expectedByteString.base64(); + final String serializedBytesWithQuotes = "\"" + serializedBytes + "\""; + Type type = new TypeToken() { }.getType(); + + // Act + byte[] actualDeserializedBytes = json.deserialize(serializedBytesWithQuotes, type); + + // Assert + assertEquals(expectedBytesAsString, new String(actualDeserializedBytes, StandardCharsets.UTF_8)); + } + + // Obtained 22JAN2018 from stackoverflow answer by PuguaSoft https://stackoverflow.com/questions/11399491/java-timezone-offset + // Direct link https://stackoverflow.com/a/16680815/3166133 + public static String getCurrentTimezoneOffset() { + + TimeZone tz = TimeZone.getDefault(); + Calendar cal = GregorianCalendar.getInstance(tz); + int offsetInMillis = tz.getOffset(cal.getTimeInMillis()); + + String offset = String.format("%02d:%02d", Math.abs(offsetInMillis / 3600000), Math.abs((offsetInMillis / 60000) % 60)); + offset = (offsetInMillis >= 0 ? "+" : "-") + offset; + + return offset; + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/StringUtilTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/StringUtilTest.java new file mode 100644 index 00000000000..aa7c81759ec --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/StringUtilTest.java @@ -0,0 +1,33 @@ +package org.openapitools.client; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class StringUtilTest { + @Test + public void testContainsIgnoreCase() { + assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "abc")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "ABC")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{"ABC"}, "abc")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, "ABC")); + assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, null)); + + assertFalse(StringUtil.containsIgnoreCase(new String[]{"abc"}, "def")); + assertFalse(StringUtil.containsIgnoreCase(new String[]{}, "ABC")); + assertFalse(StringUtil.containsIgnoreCase(new String[]{}, null)); + } + + @Test + public void testJoin() { + String[] array = {"aa", "bb", "cc"}; + assertEquals("aa,bb,cc", StringUtil.join(array, ",")); + assertEquals("aa, bb, cc", StringUtil.join(array, ", ")); + assertEquals("aabbcc", StringUtil.join(array, "")); + assertEquals("aa bb cc", StringUtil.join(array, " ")); + assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); + + assertEquals("", StringUtil.join(new String[]{}, ",")); + assertEquals("abc", StringUtil.join(new String[]{"abc"}, ",")); + } +} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java new file mode 100644 index 00000000000..d5a88132307 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java @@ -0,0 +1,76 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.openapitools.client.Pair; +import org.junit.*; +import static org.junit.Assert.*; + + +public class ApiKeyAuthTest { + @Test + public void testApplyToParamsInQuery() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); + auth.setApiKey("my-api-key"); + auth.applyToParams(queryParams, headerParams); + + assertEquals(1, queryParams.size()); + for (Pair queryParam : queryParams) { + assertEquals("my-api-key", queryParam.getValue()); + } + + // no changes to header parameters + assertEquals(0, headerParams.size()); + } + + @Test + public void testApplyToParamsInQueryWithNullValue() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); + auth.setApiKey(null); + auth.applyToParams(queryParams, headerParams); + + // no changes to parameters + assertEquals(0, queryParams.size()); + assertEquals(0, headerParams.size()); + } + + @Test + public void testApplyToParamsInHeaderWithPrefix() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); + auth.setApiKey("my-api-token"); + auth.setApiKeyPrefix("Token"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); + } + + @Test + public void testApplyToParamsInHeaderWithNullValue() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); + auth.setApiKey(null); + auth.setApiKeyPrefix("Token"); + auth.applyToParams(queryParams, headerParams); + + // no changes to parameters + assertEquals(0, queryParams.size()); + assertEquals(0, headerParams.size()); + } +} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java new file mode 100644 index 00000000000..d27a15f4dc0 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java @@ -0,0 +1,62 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.openapitools.client.Pair; +import org.junit.*; +import static org.junit.Assert.*; + + +public class HttpBasicAuthTest { + HttpBasicAuth auth = null; + + @Before + public void setup() { + auth = new HttpBasicAuth(); + } + + @Test + public void testApplyToParams() { + List queryParams = new ArrayList(); + Map headerParams = new HashMap(); + + auth.setUsername("my-username"); + auth.setPassword("my-password"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix + String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; + assertEquals(expected, headerParams.get("Authorization")); + + // null username should be treated as empty string + auth.setUsername(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of ":my-password" with the "Basic " prefix + expected = "Basic Om15LXBhc3N3b3Jk"; + assertEquals(expected, headerParams.get("Authorization")); + + // null password should be treated as empty string + auth.setUsername("my-username"); + auth.setPassword(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of "my-username:" with the "Basic " prefix + expected = "Basic bXktdXNlcm5hbWU6"; + assertEquals(expected, headerParams.get("Authorization")); + + // null username and password should be ignored + queryParams = new ArrayList(); + headerParams = new HashMap(); + auth.setUsername(null); + auth.setPassword(null); + auth.applyToParams(queryParams, headerParams); + // no changes to parameters + assertEquals(0, queryParams.size()); + assertEquals(0, headerParams.size()); + } +} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumValueTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumValueTest.java new file mode 100644 index 00000000000..73440e547b2 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/EnumValueTest.java @@ -0,0 +1,56 @@ +package org.openapitools.client.model; + +import org.junit.Test; + +import com.google.gson.Gson; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class EnumValueTest { + + @Test + public void testEnumClass() { + assertEquals(EnumClass._ABC.toString(), "_abc"); + assertEquals(EnumClass._EFG.toString(), "-efg"); + assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); + } + + @Test + public void testEnumTest() { + // test enum value + EnumTest enumTest = new EnumTest(); + enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); + enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); + enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); + + assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); + assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); + + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); + + assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); + assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); + + // test serialization + Gson gson = new Gson(); + String json = gson.toJson(enumTest); + assertEquals(json, "{\"enum_string\":\"lower\",\"enum_integer\":1,\"enum_number\":1.1}"); + + // test deserialization + EnumTest fromString = gson.fromJson(json, EnumTest.class); + assertEquals(fromString.getEnumString().toString(), "lower"); + assertEquals(fromString.getEnumString().getValue(), "lower"); + assertEquals(fromString.getEnumInteger().toString(), "1"); + assertTrue(fromString.getEnumInteger().getValue() == 1); + assertEquals(fromString.getEnumNumber().toString(), "1.1"); + assertTrue(fromString.getEnumNumber().getValue() == 1.1); + } +} diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/ApiClientTest.java new file mode 100644 index 00000000000..2113f5d2453 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/ApiClientTest.java @@ -0,0 +1,254 @@ +package org.openapitools.client; + +import org.openapitools.client.auth.*; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.*; + +import org.junit.*; +import org.springframework.http.MediaType; +import org.springframework.util.MultiValueMap; + +import static org.junit.Assert.*; + + +public class ApiClientTest { + ApiClient apiClient = null; + + @Before + public void setup() { + apiClient = new ApiClient(); + } + + /** + * + */ + @Test + public void testParseAndFormatDate() { + // default date format + String dateStr = "2015-11-07T03:49:09.356Z"; + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00"))); + + // custom date format: without milli-seconds, custom time zone + DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); + format.setTimeZone(TimeZone.getTimeZone("GMT+10")); + apiClient.setDateFormat(format); + dateStr = "2015-11-07T13:49:09+10:00"; + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00"))); + assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00"))); + } + + @Test + public void testIsJsonMime() { + assertFalse(apiClient.isJsonMime((String) null)); + assertFalse(apiClient.isJsonMime("")); + assertFalse(apiClient.isJsonMime("text/plain")); + assertFalse(apiClient.isJsonMime("application/xml")); + assertFalse(apiClient.isJsonMime("application/jsonp")); + assertFalse(apiClient.isJsonMime("example/json")); + assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); + assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); + + assertTrue(apiClient.isJsonMime("application/json")); + assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); + assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); + + assertTrue(apiClient.isJsonMime("application/problem+json")); + assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); + assertTrue(apiClient.isJsonMime("application/json\t")); + assertTrue(apiClient.isJsonMime("example/foo+bar+json")); + assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); + assertTrue(apiClient.isJsonMime("example/foo+json\t;")); + assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); + } + + @Test + public void testSelectHeaderAccept() { + String[] accepts = {"application/json", "application/xml"}; + assertEquals(Arrays.asList(MediaType.parseMediaType("application/json")), apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; + assertEquals(Arrays.asList(MediaType.parseMediaType("APPLICATION/JSON")), apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals(Arrays.asList(MediaType.parseMediaType("application/json; charset=UTF8")), apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{"text/plain", "application/xml"}; + assertEquals(Arrays.asList(MediaType.parseMediaType("text/plain"),MediaType.parseMediaType("application/xml")), apiClient.selectHeaderAccept(accepts)); + + accepts = new String[]{}; + assertNull(apiClient.selectHeaderAccept(accepts)); + } + + @Test + public void testSelectHeaderContentType() { + String[] contentTypes = {"application/json", "application/xml"}; + assertEquals(MediaType.parseMediaType("application/json"), apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; + assertEquals(MediaType.parseMediaType("APPLICATION/JSON"), apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; + assertEquals(MediaType.parseMediaType("application/json; charset=UTF8"), apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{"text/plain", "application/xml"}; + assertEquals(MediaType.parseMediaType("text/plain"), apiClient.selectHeaderContentType(contentTypes)); + + contentTypes = new String[]{}; + assertEquals(MediaType.parseMediaType("application/json"), apiClient.selectHeaderContentType(contentTypes)); + } + + @Test + public void testGetAuthentications() { + Map auths = apiClient.getAuthentications(); + + Authentication auth = auths.get("api_key"); + assertNotNull(auth); + assertTrue(auth instanceof ApiKeyAuth); + ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; + assertEquals("header", apiKeyAuth.getLocation()); + assertEquals("api_key", apiKeyAuth.getParamName()); + + auth = auths.get("petstore_auth"); + assertTrue(auth instanceof OAuth); + assertSame(auth, apiClient.getAuthentication("petstore_auth")); + + assertNull(auths.get("unknown")); + + try { + auths.put("my_auth", new HttpBasicAuth()); + fail("the authentications returned should not be modifiable"); + } catch (UnsupportedOperationException e) { + } + } + + @Ignore("There is no more basic auth in petstore security definitions") + @Test + public void testSetUsernameAndPassword() { + HttpBasicAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof HttpBasicAuth) { + auth = (HttpBasicAuth) _auth; + break; + } + } + auth.setUsername(null); + auth.setPassword(null); + + apiClient.setUsername("my-username"); + apiClient.setPassword("my-password"); + assertEquals("my-username", auth.getUsername()); + assertEquals("my-password", auth.getPassword()); + + // reset values + auth.setUsername(null); + auth.setPassword(null); + } + + @Test + public void testSetApiKeyAndPrefix() { + ApiKeyAuth auth = null; + for (Authentication _auth : apiClient.getAuthentications().values()) { + if (_auth instanceof ApiKeyAuth) { + auth = (ApiKeyAuth) _auth; + break; + } + } + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + + apiClient.setApiKey("my-api-key"); + apiClient.setApiKeyPrefix("Token"); + assertEquals("my-api-key", auth.getApiKey()); + assertEquals("Token", auth.getApiKeyPrefix()); + + // reset values + auth.setApiKey(null); + auth.setApiKeyPrefix(null); + } + + @Test + public void testParameterToMultiValueMapWhenNameIsInvalid() throws Exception { + MultiValueMap pairs_a = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, null, new Integer(1)); + MultiValueMap pairs_b = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "", new Integer(1)); + + assertTrue(pairs_a.isEmpty()); + assertTrue(pairs_b.isEmpty()); + } + + @Test + public void testParameterToMultiValueMapWhenValueIsNull() throws Exception { + MultiValueMap pairs = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "param-a", null); + + assertTrue(pairs.isEmpty()); + } + + @Test + public void testParameterToMultiValueMapWhenValueIsEmptyStrings() throws Exception { + + // single empty string + MultiValueMap pairs = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "param-a", " "); + assertEquals(1, pairs.size()); + + // list of empty strings + List strs = new ArrayList(); + strs.add(" "); + strs.add(" "); + strs.add(" "); + + MultiValueMap concatStrings = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "param-a", strs); + + assertEquals(1, concatStrings.get("param-a").size()); + assertFalse(concatStrings.get("param-a").isEmpty()); // should contain some delimiters + } + + @Test + public void testParameterToMultiValueMapWhenValueIsNotCollection() throws Exception { + String name = "param-a"; + Integer value = 1; + + MultiValueMap pairs = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, name, value); + + assertEquals(1, pairs.get(name).size()); + assertEquals(value, Integer.valueOf(pairs.get(name).get(0))); + } + + @Test + public void testParameterToMultiValueMapWhenValueIsCollection() throws Exception { + Map collectionFormatMap = new HashMap(); + collectionFormatMap.put(ApiClient.CollectionFormat.CSV, ","); + collectionFormatMap.put(ApiClient.CollectionFormat.TSV, "\t"); + collectionFormatMap.put(ApiClient.CollectionFormat.SSV, " "); + collectionFormatMap.put(ApiClient.CollectionFormat.PIPES, "\\|"); + collectionFormatMap.put(null, ","); // no format, must default to csv + + String name = "param-a"; + + List values = new ArrayList(); + values.add("value-a"); + values.add(123); + values.add(new Date()); + + // check for multi separately + MultiValueMap multiValueMap = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.MULTI, name, values); + assertEquals(values.size(), multiValueMap.get(name).size()); + + // all other formats + for (ApiClient.CollectionFormat collectionFormat : collectionFormatMap.keySet()) { + MultiValueMap pairs = apiClient.parameterToMultiValueMap(collectionFormat, name, values); + + assertEquals(1, pairs.size()); + + String delimiter = collectionFormatMap.get(collectionFormat); + String[] pairValueSplit = pairs.get(name).get(0).split(delimiter); + + assertEquals(values.size(), pairValueSplit.length); + } + } +} diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java new file mode 100644 index 00000000000..eef07a5309c --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java @@ -0,0 +1,47 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.junit.*; +import org.springframework.http.HttpHeaders; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; + +import static org.junit.Assert.*; + +public class ApiKeyAuthTest { + @Test + public void testApplyToParamsInQuery() { + MultiValueMap queryParams = new LinkedMultiValueMap(); + HttpHeaders headerParams = new HttpHeaders(); + + ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); + auth.setApiKey("my-api-key"); + auth.applyToParams(queryParams, headerParams); + + assertEquals(1, queryParams.size()); + assertEquals("my-api-key", queryParams.get("api_key").get(0)); + + // no changes to header parameters + assertEquals(0, headerParams.size()); + } + + @Test + public void testApplyToParamsInHeaderWithPrefix() { + MultiValueMap queryParams = new LinkedMultiValueMap(); + HttpHeaders headerParams = new HttpHeaders(); + + ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); + auth.setApiKey("my-api-token"); + auth.setApiKeyPrefix("Token"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN").get(0)); + } +} diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java new file mode 100644 index 00000000000..04522ec56c5 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java @@ -0,0 +1,54 @@ +package org.openapitools.client.auth; + +import java.util.HashMap; +import java.util.ArrayList; +import java.util.Map; +import java.util.List; + +import org.junit.*; +import org.springframework.http.HttpHeaders; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; + +import static org.junit.Assert.*; + +public class HttpBasicAuthTest { + HttpBasicAuth auth = null; + + @Before + public void setup() { + auth = new HttpBasicAuth(); + } + + @Test + public void testApplyToParams() { + MultiValueMap queryParams = new LinkedMultiValueMap(); + HttpHeaders headerParams = new HttpHeaders(); + + auth.setUsername("my-username"); + auth.setPassword("my-password"); + auth.applyToParams(queryParams, headerParams); + + // no changes to query parameters + assertEquals(0, queryParams.size()); + assertEquals(1, headerParams.size()); + // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix + String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; + assertEquals(expected, headerParams.get("Authorization").get(0)); + + // null username should be treated as empty string + auth.setUsername(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of ":my-password" with the "Basic " prefix + expected = "Basic Om15LXBhc3N3b3Jk"; + assertEquals(expected, headerParams.get("Authorization").get(1)); + + // null password should be treated as empty string + auth.setUsername("my-username"); + auth.setPassword(null); + auth.applyToParams(queryParams, headerParams); + // the string below is base64-encoded result of "my-username:" with the "Basic " prefix + expected = "Basic bXktdXNlcm5hbWU6"; + assertEquals(expected, headerParams.get("Authorization").get(2)); + } +} diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/EnumValueTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/EnumValueTest.java new file mode 100644 index 00000000000..47bfe940d3c --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/EnumValueTest.java @@ -0,0 +1,63 @@ +package org.openapitools.client.model; + +import org.junit.Test; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectWriter; +import com.fasterxml.jackson.databind.SerializationFeature; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class EnumValueTest { + + @Test + public void testEnumClass() { + assertEquals(EnumClass._ABC.toString(), "_abc"); + assertEquals(EnumClass._EFG.toString(), "-efg"); + assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); + } + + @Test + public void testEnumTest() { + // test enum value + EnumTest enumTest = new EnumTest(); + enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); + enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); + enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); + + assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); + assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); + assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); + + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); + assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); + assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); + + assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); + assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); + assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); + + try { + // test serialization (object => json) + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + ObjectWriter ow = mapper.writer(); + String json = ow.writeValueAsString(enumTest); + assertEquals(json, "{\"enum_string\":\"lower\",\"enum_string_required\":null,\"enum_integer\":1,\"enum_number\":1.1,\"outerEnum\":null}"); + + // test deserialization (json => object) + EnumTest fromString = mapper.readValue(json, EnumTest.class); + assertEquals(fromString.getEnumString().toString(), "lower"); + assertEquals(fromString.getEnumInteger().toString(), "1"); + assertEquals(fromString.getEnumNumber().toString(), "1.1"); + + } catch (Exception e) { + fail("Exception thrown during serialization/deserialzation of JSON: " + e.getMessage()); + } + } +} From d19a2faf8e467736e52136c6b01c88b29787fb31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mads=20F=C3=B8hns?= Date: Wed, 20 Jun 2018 14:26:23 +0200 Subject: [PATCH 16/35] [php] Correctly handle multiple valid responses (#128) * #125: Correctly handle multiple valid responses * Fixed defaultResponses * Fixed void-returns * Fixed multiple return-types without an actual type * Update the samples under openapi3 folder --- .../src/main/resources/php/api.mustache | 36 +++++- .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 1 - .../lib/Api/AnotherFakeApi.php | 21 +++- .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 110 ++++++++++++++++-- .../lib/Api/FakeClassnameTags123Api.php | 21 +++- .../php/OpenAPIClient-php/lib/Api/PetApi.php | 88 ++++++++++++-- .../OpenAPIClient-php/lib/Api/StoreApi.php | 64 +++++++++- .../php/OpenAPIClient-php/lib/Api/UserApi.php | 48 ++++++-- .../lib/Api/AnotherFakeApi.php | 21 +++- .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 109 +++++++++++++++-- .../lib/Api/FakeClassnameTags123Api.php | 21 +++- .../php/OpenAPIClient-php/lib/Api/PetApi.php | 88 ++++++++++++-- .../OpenAPIClient-php/lib/Api/StoreApi.php | 64 +++++++++- .../php/OpenAPIClient-php/lib/Api/UserApi.php | 48 ++++++-- 14 files changed, 672 insertions(+), 68 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php/api.mustache b/modules/openapi-generator/src/main/resources/php/api.mustache index 15a18da56bf..776ebc14207 100644 --- a/modules/openapi-generator/src/main/resources/php/api.mustache +++ b/modules/openapi-generator/src/main/resources/php/api.mustache @@ -95,7 +95,7 @@ use {{invokerPackage}}\ObjectSerializer; * * @throws \{{invokerPackage}}\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} + * @return {{#returnType}}{{#responses}}{{#dataType}}{{^-first}}|{{/-first}}{{/dataType}}{{{dataType}}}{{/responses}}{{/returnType}}{{^returnType}}void{{/returnType}} */ public function {{operationId}}({{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { @@ -120,11 +120,10 @@ use {{invokerPackage}}\ObjectSerializer; * * @throws \{{invokerPackage}}\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}null{{/returnType}}, HTTP status code, HTTP response headers (array of strings) + * @return array of {{#returnType}}{{#responses}}{{#dataType}}{{^-first}}|{{/-first}}{{/dataType}}{{{dataType}}}{{/responses}}{{/returnType}}{{^returnType}}null{{/returnType}}, HTTP status code, HTTP response headers (array of strings) */ public function {{operationId}}WithHttpInfo({{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { - $returnType = '{{returnType}}'; $request = $this->{{operationId}}Request({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); try { @@ -154,8 +153,36 @@ use {{invokerPackage}}\ObjectSerializer; $response->getBody() ); } - {{#returnType}} + {{#responses}} + {{#-first}} + + $responseBody = $response->getBody(); + switch($statusCode) { + {{/-first}} + {{#dataType}} + {{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} + if ('{{dataType}}' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('{{dataType}}' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '{{dataType}}', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + {{/dataType}} + {{#-last}} + } + {{/-last}} + {{/responses}} + + $returnType = '{{returnType}}'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -173,6 +200,7 @@ use {{invokerPackage}}\ObjectSerializer; ]; {{/returnType}} {{^returnType}} + return [null, $statusCode, $response->getHeaders()]; {{/returnType}} diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Api/FakeApi.php index 3043c1e0978..e7c29a0121a 100644 --- a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -116,7 +116,6 @@ class FakeApi */ public function testCodeInjectEndRnNRWithHttpInfo($unknown_base_type = null) { - $returnType = ''; $request = $this->testCodeInjectEndRnNRRequest($unknown_base_type); try { diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index c8d5273a038..1c668d963da 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -117,7 +117,6 @@ class AnotherFakeApi */ public function testSpecialTagsWithHttpInfo($client) { - $returnType = '\OpenAPI\Client\Model\Client'; $request = $this->testSpecialTagsRequest($client); try { @@ -148,6 +147,26 @@ class AnotherFakeApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\Client' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Client', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Client'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 3409d09c62d..15628291dd3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -113,7 +113,6 @@ class FakeApi */ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) { - $returnType = 'bool'; $request = $this->fakeOuterBooleanSerializeRequest($body); try { @@ -144,6 +143,26 @@ class FakeApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('bool' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('bool' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, 'bool', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'bool'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -360,7 +379,6 @@ class FakeApi */ public function fakeOuterCompositeSerializeWithHttpInfo($outer_composite = null) { - $returnType = '\OpenAPI\Client\Model\OuterComposite'; $request = $this->fakeOuterCompositeSerializeRequest($outer_composite); try { @@ -391,6 +409,26 @@ class FakeApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\OuterComposite' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\OuterComposite' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\OuterComposite', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\OuterComposite'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -607,7 +645,6 @@ class FakeApi */ public function fakeOuterNumberSerializeWithHttpInfo($body = null) { - $returnType = 'float'; $request = $this->fakeOuterNumberSerializeRequest($body); try { @@ -638,6 +675,26 @@ class FakeApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('float' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('float' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, 'float', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'float'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -854,7 +911,6 @@ class FakeApi */ public function fakeOuterStringSerializeWithHttpInfo($body = null) { - $returnType = 'string'; $request = $this->fakeOuterStringSerializeRequest($body); try { @@ -885,6 +941,26 @@ class FakeApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('string' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('string' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'string'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1102,7 +1178,6 @@ class FakeApi */ public function testBodyWithQueryParamsWithHttpInfo($query, $user) { - $returnType = ''; $request = $this->testBodyWithQueryParamsRequest($query, $user); try { @@ -1336,7 +1411,6 @@ class FakeApi */ public function testClientModelWithHttpInfo($client) { - $returnType = '\OpenAPI\Client\Model\Client'; $request = $this->testClientModelRequest($client); try { @@ -1367,6 +1441,26 @@ class FakeApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\Client' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Client', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Client'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1618,7 +1712,6 @@ class FakeApi */ public function testEndpointParametersWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) { - $returnType = ''; $request = $this->testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback); try { @@ -2014,7 +2107,6 @@ class FakeApi */ public function testEnumParametersWithHttpInfo($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') { - $returnType = ''; $request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string); try { @@ -2284,7 +2376,6 @@ class FakeApi */ public function testInlineAdditionalPropertiesWithHttpInfo($request_body) { - $returnType = ''; $request = $this->testInlineAdditionalPropertiesRequest($request_body); try { @@ -2506,7 +2597,6 @@ class FakeApi */ public function testJsonFormDataWithHttpInfo($param, $param2) { - $returnType = ''; $request = $this->testJsonFormDataRequest($param, $param2); try { diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 911d658817c..ffe6a623b71 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -117,7 +117,6 @@ class FakeClassnameTags123Api */ public function testClassnameWithHttpInfo($client) { - $returnType = '\OpenAPI\Client\Model\Client'; $request = $this->testClassnameRequest($client); try { @@ -148,6 +147,26 @@ class FakeClassnameTags123Api ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\Client' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Client', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Client'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index 470cb1ca35e..9b495a9c624 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -116,7 +116,6 @@ class PetApi */ public function addPetWithHttpInfo($pet) { - $returnType = ''; $request = $this->addPetRequest($pet); try { @@ -342,7 +341,6 @@ class PetApi */ public function deletePetWithHttpInfo($pet_id, $api_key = null) { - $returnType = ''; $request = $this->deletePetRequest($pet_id, $api_key); try { @@ -579,7 +577,6 @@ class PetApi */ public function findPetsByStatusWithHttpInfo($status) { - $returnType = '\OpenAPI\Client\Model\Pet[]'; $request = $this->findPetsByStatusRequest($status); try { @@ -610,6 +607,26 @@ class PetApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\Pet[]' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Pet[]'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -844,7 +861,6 @@ class PetApi */ public function findPetsByTagsWithHttpInfo($tags) { - $returnType = '\OpenAPI\Client\Model\Pet[]'; $request = $this->findPetsByTagsRequest($tags); try { @@ -875,6 +891,26 @@ class PetApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\Pet[]' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Pet[]'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1109,7 +1145,6 @@ class PetApi */ public function getPetByIdWithHttpInfo($pet_id) { - $returnType = '\OpenAPI\Client\Model\Pet'; $request = $this->getPetByIdRequest($pet_id); try { @@ -1140,6 +1175,26 @@ class PetApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\Pet' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\Pet' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Pet'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1375,7 +1430,6 @@ class PetApi */ public function updatePetWithHttpInfo($pet) { - $returnType = ''; $request = $this->updatePetRequest($pet); try { @@ -1603,7 +1657,6 @@ class PetApi */ public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = null) { - $returnType = ''; $request = $this->updatePetWithFormRequest($pet_id, $name, $status); try { @@ -1851,7 +1904,6 @@ class PetApi */ public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $file = null) { - $returnType = '\OpenAPI\Client\Model\ApiResponse'; $request = $this->uploadFileRequest($pet_id, $additional_metadata, $file); try { @@ -1882,6 +1934,26 @@ class PetApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\ApiResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ApiResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index 6cfeeb7a629..76f1da432d8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -116,7 +116,6 @@ class StoreApi */ public function deleteOrderWithHttpInfo($order_id) { - $returnType = ''; $request = $this->deleteOrderRequest($order_id); try { @@ -340,7 +339,6 @@ class StoreApi */ public function getInventoryWithHttpInfo() { - $returnType = 'map[string,int]'; $request = $this->getInventoryRequest(); try { @@ -371,6 +369,26 @@ class StoreApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('map[string,int]' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('map[string,int]' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, 'map[string,int]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'map[string,int]'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -590,7 +608,6 @@ class StoreApi */ public function getOrderByIdWithHttpInfo($order_id) { - $returnType = '\OpenAPI\Client\Model\Order'; $request = $this->getOrderByIdRequest($order_id); try { @@ -621,6 +638,26 @@ class StoreApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\Order' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Order', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Order'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -859,7 +896,6 @@ class StoreApi */ public function placeOrderWithHttpInfo($order) { - $returnType = '\OpenAPI\Client\Model\Order'; $request = $this->placeOrderRequest($order); try { @@ -890,6 +926,26 @@ class StoreApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\Order' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Order', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Order'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index 14668618aa4..84226530cfa 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -116,7 +116,6 @@ class UserApi */ public function createUserWithHttpInfo($user) { - $returnType = ''; $request = $this->createUserRequest($user); try { @@ -336,7 +335,6 @@ class UserApi */ public function createUsersWithArrayInputWithHttpInfo($user) { - $returnType = ''; $request = $this->createUsersWithArrayInputRequest($user); try { @@ -556,7 +554,6 @@ class UserApi */ public function createUsersWithListInputWithHttpInfo($user) { - $returnType = ''; $request = $this->createUsersWithListInputRequest($user); try { @@ -776,7 +773,6 @@ class UserApi */ public function deleteUserWithHttpInfo($username) { - $returnType = ''; $request = $this->deleteUserRequest($username); try { @@ -1002,7 +998,6 @@ class UserApi */ public function getUserByNameWithHttpInfo($username) { - $returnType = '\OpenAPI\Client\Model\User'; $request = $this->getUserByNameRequest($username); try { @@ -1033,6 +1028,26 @@ class UserApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\User' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\User' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\User', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\User'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1266,7 +1281,6 @@ class UserApi */ public function loginUserWithHttpInfo($username, $password) { - $returnType = 'string'; $request = $this->loginUserRequest($username, $password); try { @@ -1297,6 +1311,26 @@ class UserApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('string' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('string' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'string'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1534,7 +1568,6 @@ class UserApi */ public function logoutUserWithHttpInfo() { - $returnType = ''; $request = $this->logoutUserRequest(); try { @@ -1744,7 +1777,6 @@ class UserApi */ public function updateUserWithHttpInfo($username, $user) { - $returnType = ''; $request = $this->updateUserRequest($username, $user); try { diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index c8d5273a038..1c668d963da 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -117,7 +117,6 @@ class AnotherFakeApi */ public function testSpecialTagsWithHttpInfo($client) { - $returnType = '\OpenAPI\Client\Model\Client'; $request = $this->testSpecialTagsRequest($client); try { @@ -148,6 +147,26 @@ class AnotherFakeApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\Client' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Client', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Client'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index a5d1a75aa22..b6c1ea3487a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -113,7 +113,6 @@ class FakeApi */ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) { - $returnType = 'bool'; $request = $this->fakeOuterBooleanSerializeRequest($body); try { @@ -144,6 +143,26 @@ class FakeApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('bool' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('bool' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, 'bool', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'bool'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -360,7 +379,6 @@ class FakeApi */ public function fakeOuterCompositeSerializeWithHttpInfo($outer_composite = null) { - $returnType = '\OpenAPI\Client\Model\OuterComposite'; $request = $this->fakeOuterCompositeSerializeRequest($outer_composite); try { @@ -391,6 +409,26 @@ class FakeApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\OuterComposite' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\OuterComposite' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\OuterComposite', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\OuterComposite'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -607,7 +645,6 @@ class FakeApi */ public function fakeOuterNumberSerializeWithHttpInfo($body = null) { - $returnType = 'float'; $request = $this->fakeOuterNumberSerializeRequest($body); try { @@ -638,6 +675,26 @@ class FakeApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('float' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('float' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, 'float', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'float'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -854,7 +911,6 @@ class FakeApi */ public function fakeOuterStringSerializeWithHttpInfo($body = null) { - $returnType = 'string'; $request = $this->fakeOuterStringSerializeRequest($body); try { @@ -885,6 +941,26 @@ class FakeApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('string' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('string' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'string'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1105,7 +1181,6 @@ class FakeApi */ public function testClientModelWithHttpInfo($client) { - $returnType = '\OpenAPI\Client\Model\Client'; $request = $this->testClientModelRequest($client); try { @@ -1136,6 +1211,26 @@ class FakeApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\Client' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Client', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Client'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1387,7 +1482,6 @@ class FakeApi */ public function testEndpointParametersWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) { - $returnType = ''; $request = $this->testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback); try { @@ -1783,7 +1877,6 @@ class FakeApi */ public function testEnumParametersWithHttpInfo($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') { - $returnType = ''; $request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string); try { @@ -2053,7 +2146,6 @@ class FakeApi */ public function testInlineAdditionalPropertiesWithHttpInfo($request_body) { - $returnType = ''; $request = $this->testInlineAdditionalPropertiesRequest($request_body); try { @@ -2275,7 +2367,6 @@ class FakeApi */ public function testJsonFormDataWithHttpInfo($param, $param2) { - $returnType = ''; $request = $this->testJsonFormDataRequest($param, $param2); try { diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 911d658817c..ffe6a623b71 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -117,7 +117,6 @@ class FakeClassnameTags123Api */ public function testClassnameWithHttpInfo($client) { - $returnType = '\OpenAPI\Client\Model\Client'; $request = $this->testClassnameRequest($client); try { @@ -148,6 +147,26 @@ class FakeClassnameTags123Api ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\Client' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Client', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Client'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index 470cb1ca35e..9b495a9c624 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -116,7 +116,6 @@ class PetApi */ public function addPetWithHttpInfo($pet) { - $returnType = ''; $request = $this->addPetRequest($pet); try { @@ -342,7 +341,6 @@ class PetApi */ public function deletePetWithHttpInfo($pet_id, $api_key = null) { - $returnType = ''; $request = $this->deletePetRequest($pet_id, $api_key); try { @@ -579,7 +577,6 @@ class PetApi */ public function findPetsByStatusWithHttpInfo($status) { - $returnType = '\OpenAPI\Client\Model\Pet[]'; $request = $this->findPetsByStatusRequest($status); try { @@ -610,6 +607,26 @@ class PetApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\Pet[]' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Pet[]'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -844,7 +861,6 @@ class PetApi */ public function findPetsByTagsWithHttpInfo($tags) { - $returnType = '\OpenAPI\Client\Model\Pet[]'; $request = $this->findPetsByTagsRequest($tags); try { @@ -875,6 +891,26 @@ class PetApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\Pet[]' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Pet[]'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1109,7 +1145,6 @@ class PetApi */ public function getPetByIdWithHttpInfo($pet_id) { - $returnType = '\OpenAPI\Client\Model\Pet'; $request = $this->getPetByIdRequest($pet_id); try { @@ -1140,6 +1175,26 @@ class PetApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\Pet' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\Pet' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Pet'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1375,7 +1430,6 @@ class PetApi */ public function updatePetWithHttpInfo($pet) { - $returnType = ''; $request = $this->updatePetRequest($pet); try { @@ -1603,7 +1657,6 @@ class PetApi */ public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = null) { - $returnType = ''; $request = $this->updatePetWithFormRequest($pet_id, $name, $status); try { @@ -1851,7 +1904,6 @@ class PetApi */ public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $file = null) { - $returnType = '\OpenAPI\Client\Model\ApiResponse'; $request = $this->uploadFileRequest($pet_id, $additional_metadata, $file); try { @@ -1882,6 +1934,26 @@ class PetApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\ApiResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\ApiResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index 58233ffb6b2..b4ba21addf7 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -116,7 +116,6 @@ class StoreApi */ public function deleteOrderWithHttpInfo($order_id) { - $returnType = ''; $request = $this->deleteOrderRequest($order_id); try { @@ -340,7 +339,6 @@ class StoreApi */ public function getInventoryWithHttpInfo() { - $returnType = 'map[string,int]'; $request = $this->getInventoryRequest(); try { @@ -371,6 +369,26 @@ class StoreApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('map[string,int]' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('map[string,int]' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, 'map[string,int]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'map[string,int]'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -590,7 +608,6 @@ class StoreApi */ public function getOrderByIdWithHttpInfo($order_id) { - $returnType = '\OpenAPI\Client\Model\Order'; $request = $this->getOrderByIdRequest($order_id); try { @@ -621,6 +638,26 @@ class StoreApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\Order' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Order', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Order'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -859,7 +896,6 @@ class StoreApi */ public function placeOrderWithHttpInfo($order) { - $returnType = '\OpenAPI\Client\Model\Order'; $request = $this->placeOrderRequest($order); try { @@ -890,6 +926,26 @@ class StoreApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\Order' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Order', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\Order'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index 346ad00fcd7..bb8db0f4c31 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -116,7 +116,6 @@ class UserApi */ public function createUserWithHttpInfo($user) { - $returnType = ''; $request = $this->createUserRequest($user); try { @@ -336,7 +335,6 @@ class UserApi */ public function createUsersWithArrayInputWithHttpInfo($user) { - $returnType = ''; $request = $this->createUsersWithArrayInputRequest($user); try { @@ -556,7 +554,6 @@ class UserApi */ public function createUsersWithListInputWithHttpInfo($user) { - $returnType = ''; $request = $this->createUsersWithListInputRequest($user); try { @@ -776,7 +773,6 @@ class UserApi */ public function deleteUserWithHttpInfo($username) { - $returnType = ''; $request = $this->deleteUserRequest($username); try { @@ -1002,7 +998,6 @@ class UserApi */ public function getUserByNameWithHttpInfo($username) { - $returnType = '\OpenAPI\Client\Model\User'; $request = $this->getUserByNameRequest($username); try { @@ -1033,6 +1028,26 @@ class UserApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\User' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('\OpenAPI\Client\Model\User' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\User', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\User'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1266,7 +1281,6 @@ class UserApi */ public function loginUserWithHttpInfo($username, $password) { - $returnType = 'string'; $request = $this->loginUserRequest($username, $password); try { @@ -1297,6 +1311,26 @@ class UserApi ); } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('string' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ('string' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'string'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1534,7 +1568,6 @@ class UserApi */ public function logoutUserWithHttpInfo() { - $returnType = ''; $request = $this->logoutUserRequest(); try { @@ -1744,7 +1777,6 @@ class UserApi */ public function updateUserWithHttpInfo($username, $user) { - $returnType = ''; $request = $this->updateUserRequest($username, $user); try { From 4664c07034fac99cfb6354fae6301d85f4f96810 Mon Sep 17 00:00:00 2001 From: ilk <984504+ilk@users.noreply.github.com> Date: Thu, 21 Jun 2018 07:36:28 +0200 Subject: [PATCH 17/35] [go] Fix issue #51, change object mapping from *interface{} to map[string]interface (#60) --- .../org/openapitools/codegen/languages/AbstractGoCodegen.java | 2 +- .../openapi-generator/src/main/resources/go/model.mustache | 4 ++-- .../src/main/resources/go/model_doc.mustache | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java index 5f6f220d74b..a3c09824a81 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java @@ -105,7 +105,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege typeMapping.put("file", "*os.File"); typeMapping.put("binary", "*os.File"); typeMapping.put("ByteArray", "string"); - typeMapping.put("object", "interface{}"); + typeMapping.put("object", "map[string]interface{}"); importMapping = new HashMap(); diff --git a/modules/openapi-generator/src/main/resources/go/model.mustache b/modules/openapi-generator/src/main/resources/go/model.mustache index 7f7357c0415..f669ec2c2bb 100644 --- a/modules/openapi-generator/src/main/resources/go/model.mustache +++ b/modules/openapi-generator/src/main/resources/go/model.mustache @@ -35,9 +35,9 @@ type {{classname}} struct { {{#description}} // {{{description}}} {{/description}} - {{name}} {{^isEnum}}{{^isPrimitiveType}}{{^isContainer}}{{^isDateTime}}*{{/isDateTime}}{{/isContainer}}{{/isPrimitiveType}}{{/isEnum}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}"{{/withXml}}` + {{name}} {{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}"{{/withXml}}` {{/vars}} } {{/isEnum}} {{/model}} -{{/models}} \ No newline at end of file +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/go/model_doc.mustache b/modules/openapi-generator/src/main/resources/go/model_doc.mustache index ccfd3f8d0de..8f3c785d458 100644 --- a/modules/openapi-generator/src/main/resources/go/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_doc.mustache @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{^isContainer}}{{^isDateTime}}*{{/isDateTime}}{{/isContainer}}{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) From 5b5fe3cad979dfdf85f8ef9e4a30229e1a2e4083 Mon Sep 17 00:00:00 2001 From: Joe Elliott <1489809+joeboyscout04@users.noreply.github.com> Date: Thu, 21 Jun 2018 10:52:02 +0200 Subject: [PATCH 18/35] [Swift 4] add compatibility for unwrapRequired config option (#229) * Added support for unwrapRequired in Swift 4 * Update petstore generators for Swift. --- bin/swift4-petstore-all.sh | 1 + bin/swift4-petstore-unwrapRequired.json | 7 + bin/swift4-petstore-unwrapRequired.sh | 32 + .../resources/swift4/modelObject.mustache | 10 +- .../swift3/default/.openapi-generator/VERSION | 2 +- .../objcCompatible/.openapi-generator/VERSION | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 3 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 7 - .../APIs/FakeClassnameTags123API.swift | 3 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 161 ---- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 60 -- .../Classes/OpenAPIs/APIs/UserAPI.swift | 38 - .../promisekit/.openapi-generator/VERSION | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 3 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 7 - .../APIs/FakeClassnameTags123API.swift | 3 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 161 ---- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 60 -- .../Classes/OpenAPIs/APIs/UserAPI.swift | 38 - .../swift3/rxswift/.openapi-generator/VERSION | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 3 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 7 - .../APIs/FakeClassnameTags123API.swift | 3 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 161 ---- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 60 -- .../Classes/OpenAPIs/APIs/UserAPI.swift | 38 - .../unwraprequired/.openapi-generator/VERSION | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 3 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 7 - .../APIs/FakeClassnameTags123API.swift | 3 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 161 ---- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 60 -- .../Classes/OpenAPIs/APIs/UserAPI.swift | 38 - .../swift4/default/.openapi-generator/VERSION | 2 +- .../objcCompatible/.openapi-generator/VERSION | 2 +- .../objcCompatible/PetstoreClient.podspec | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 65 ++ .../Classes/OpenAPIs/APIs.swift | 61 ++ .../OpenAPIs/APIs/AnotherFakeAPI.swift | 46 ++ .../Classes/OpenAPIs/APIs/FakeAPI.swift | 499 ++++++++++++ .../APIs/FakeClassnameTags123API.swift | 49 ++ .../Classes/OpenAPIs/APIs/PetAPI.swift | 358 +++++++++ .../Classes/OpenAPIs/APIs/StoreAPI.swift | 152 ++++ .../Classes/OpenAPIs/APIs/UserAPI.swift | 305 ++++++++ .../OpenAPIs/AlamofireImplementations.swift | 413 ++++++++++ .../Classes/OpenAPIs/CodableHelper.swift | 67 ++ .../Classes/OpenAPIs/Configuration.swift | 15 + .../Classes/OpenAPIs/Extensions.swift | 173 +++++ .../OpenAPIs/JSONEncodableEncoding.swift | 54 ++ .../Classes/OpenAPIs/JSONEncodingHelper.swift | 43 ++ .../Classes/OpenAPIs/Models.swift | 36 + .../Models/AdditionalPropertiesClass.swift | 29 + .../Classes/OpenAPIs/Models/Animal.swift | 24 + .../Classes/OpenAPIs/Models/AnimalFarm.swift | 11 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 31 + .../Models/ArrayOfArrayOfNumberOnly.swift | 26 + .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 26 + .../Classes/OpenAPIs/Models/ArrayTest.swift | 32 + .../OpenAPIs/Models/Capitalization.swift | 42 ++ .../Classes/OpenAPIs/Models/Cat.swift | 31 + .../Classes/OpenAPIs/Models/Category.swift | 34 + .../Classes/OpenAPIs/Models/ClassModel.swift | 23 + .../Classes/OpenAPIs/Models/Client.swift | 22 + .../Classes/OpenAPIs/Models/Dog.swift | 26 + .../Classes/OpenAPIs/Models/EnumArrays.swift | 37 + .../Classes/OpenAPIs/Models/EnumClass.swift | 15 + .../Classes/OpenAPIs/Models/EnumTest.swift | 56 ++ .../Classes/OpenAPIs/Models/FormatTest.swift | 76 ++ .../OpenAPIs/Models/HasOnlyReadOnly.swift | 24 + .../Classes/OpenAPIs/Models/List.swift | 26 + .../Classes/OpenAPIs/Models/MapTest.swift | 33 + ...opertiesAndAdditionalPropertiesClass.swift | 26 + .../OpenAPIs/Models/Model200Response.swift | 35 + .../Classes/OpenAPIs/Models/Name.swift | 51 ++ .../Classes/OpenAPIs/Models/NumberOnly.swift | 31 + .../Classes/OpenAPIs/Models/Order.swift | 67 ++ .../OpenAPIs/Models/OuterComposite.swift | 32 + .../Classes/OpenAPIs/Models/OuterEnum.swift | 15 + .../Classes/OpenAPIs/Models/Pet.swift | 52 ++ .../OpenAPIs/Models/ReadOnlyFirst.swift | 24 + .../Classes/OpenAPIs/Models/Return.swift | 32 + .../OpenAPIs/Models/SpecialModelName.swift | 31 + .../Classes/OpenAPIs/Models/Tag.swift | 34 + .../Classes/OpenAPIs/Models/User.swift | 58 ++ .../swift4/objcCompatible/git_push.sh | 2 +- .../promisekit/.openapi-generator/VERSION | 2 +- .../swift4/promisekit/PetstoreClient.podspec | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 65 ++ .../Classes/OpenAPIs/APIs.swift | 61 ++ .../OpenAPIs/APIs/AnotherFakeAPI.swift | 64 ++ .../Classes/OpenAPIs/APIs/FakeAPI.swift | 687 +++++++++++++++++ .../APIs/FakeClassnameTags123API.swift | 67 ++ .../Classes/OpenAPIs/APIs/PetAPI.swift | 500 +++++++++++++ .../Classes/OpenAPIs/APIs/StoreAPI.swift | 220 ++++++ .../Classes/OpenAPIs/APIs/UserAPI.swift | 443 +++++++++++ .../OpenAPIs/AlamofireImplementations.swift | 413 ++++++++++ .../Classes/OpenAPIs/CodableHelper.swift | 67 ++ .../Classes/OpenAPIs/Configuration.swift | 15 + .../Classes/OpenAPIs/Extensions.swift | 186 +++++ .../OpenAPIs/JSONEncodableEncoding.swift | 54 ++ .../Classes/OpenAPIs/JSONEncodingHelper.swift | 43 ++ .../Classes/OpenAPIs/Models.swift | 36 + .../Models/AdditionalPropertiesClass.swift | 29 + .../Classes/OpenAPIs/Models/Animal.swift | 24 + .../Classes/OpenAPIs/Models/AnimalFarm.swift | 11 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 26 + .../Models/ArrayOfArrayOfNumberOnly.swift | 26 + .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 26 + .../Classes/OpenAPIs/Models/ArrayTest.swift | 32 + .../OpenAPIs/Models/Capitalization.swift | 42 ++ .../Classes/OpenAPIs/Models/Cat.swift | 26 + .../Classes/OpenAPIs/Models/Category.swift | 29 + .../Classes/OpenAPIs/Models/ClassModel.swift | 23 + .../Classes/OpenAPIs/Models/Client.swift | 22 + .../Classes/OpenAPIs/Models/Dog.swift | 26 + .../Classes/OpenAPIs/Models/EnumArrays.swift | 37 + .../Classes/OpenAPIs/Models/EnumClass.swift | 15 + .../Classes/OpenAPIs/Models/EnumTest.swift | 56 ++ .../Classes/OpenAPIs/Models/FormatTest.swift | 46 ++ .../OpenAPIs/Models/HasOnlyReadOnly.swift | 24 + .../Classes/OpenAPIs/Models/List.swift | 26 + .../Classes/OpenAPIs/Models/MapTest.swift | 33 + ...opertiesAndAdditionalPropertiesClass.swift | 26 + .../OpenAPIs/Models/Model200Response.swift | 30 + .../Classes/OpenAPIs/Models/Name.swift | 36 + .../Classes/OpenAPIs/Models/NumberOnly.swift | 26 + .../Classes/OpenAPIs/Models/Order.swift | 47 ++ .../OpenAPIs/Models/OuterComposite.swift | 32 + .../Classes/OpenAPIs/Models/OuterEnum.swift | 15 + .../Classes/OpenAPIs/Models/Pet.swift | 47 ++ .../OpenAPIs/Models/ReadOnlyFirst.swift | 24 + .../Classes/OpenAPIs/Models/Return.swift | 27 + .../OpenAPIs/Models/SpecialModelName.swift | 26 + .../Classes/OpenAPIs/Models/Tag.swift | 29 + .../Classes/OpenAPIs/Models/User.swift | 48 ++ .../petstore/swift4/promisekit/git_push.sh | 2 +- .../swift4/rxswift/.openapi-generator/VERSION | 2 +- .../swift4/rxswift/PetstoreClient.podspec | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 65 ++ .../Classes/OpenAPIs/APIs.swift | 61 ++ .../OpenAPIs/APIs/AnotherFakeAPI.swift | 66 ++ .../Classes/OpenAPIs/APIs/FakeAPI.swift | 707 ++++++++++++++++++ .../APIs/FakeClassnameTags123API.swift | 69 ++ .../Classes/OpenAPIs/APIs/PetAPI.swift | 516 +++++++++++++ .../Classes/OpenAPIs/APIs/StoreAPI.swift | 228 ++++++ .../Classes/OpenAPIs/APIs/UserAPI.swift | 459 ++++++++++++ .../OpenAPIs/AlamofireImplementations.swift | 413 ++++++++++ .../Classes/OpenAPIs/CodableHelper.swift | 67 ++ .../Classes/OpenAPIs/Configuration.swift | 15 + .../Classes/OpenAPIs/Extensions.swift | 173 +++++ .../OpenAPIs/JSONEncodableEncoding.swift | 54 ++ .../Classes/OpenAPIs/JSONEncodingHelper.swift | 43 ++ .../Classes/OpenAPIs/Models.swift | 36 + .../Models/AdditionalPropertiesClass.swift | 29 + .../Classes/OpenAPIs/Models/Animal.swift | 24 + .../Classes/OpenAPIs/Models/AnimalFarm.swift | 11 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 26 + .../Models/ArrayOfArrayOfNumberOnly.swift | 26 + .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 26 + .../Classes/OpenAPIs/Models/ArrayTest.swift | 32 + .../OpenAPIs/Models/Capitalization.swift | 42 ++ .../Classes/OpenAPIs/Models/Cat.swift | 26 + .../Classes/OpenAPIs/Models/Category.swift | 29 + .../Classes/OpenAPIs/Models/ClassModel.swift | 23 + .../Classes/OpenAPIs/Models/Client.swift | 22 + .../Classes/OpenAPIs/Models/Dog.swift | 26 + .../Classes/OpenAPIs/Models/EnumArrays.swift | 37 + .../Classes/OpenAPIs/Models/EnumClass.swift | 15 + .../Classes/OpenAPIs/Models/EnumTest.swift | 56 ++ .../Classes/OpenAPIs/Models/FormatTest.swift | 46 ++ .../OpenAPIs/Models/HasOnlyReadOnly.swift | 24 + .../Classes/OpenAPIs/Models/List.swift | 26 + .../Classes/OpenAPIs/Models/MapTest.swift | 33 + ...opertiesAndAdditionalPropertiesClass.swift | 26 + .../OpenAPIs/Models/Model200Response.swift | 30 + .../Classes/OpenAPIs/Models/Name.swift | 36 + .../Classes/OpenAPIs/Models/NumberOnly.swift | 26 + .../Classes/OpenAPIs/Models/Order.swift | 47 ++ .../OpenAPIs/Models/OuterComposite.swift | 32 + .../Classes/OpenAPIs/Models/OuterEnum.swift | 15 + .../Classes/OpenAPIs/Models/Pet.swift | 47 ++ .../OpenAPIs/Models/ReadOnlyFirst.swift | 24 + .../Classes/OpenAPIs/Models/Return.swift | 27 + .../OpenAPIs/Models/SpecialModelName.swift | 26 + .../Classes/OpenAPIs/Models/Tag.swift | 29 + .../Classes/OpenAPIs/Models/User.swift | 48 ++ .../petstore/swift4/rxswift/git_push.sh | 2 +- .../petstore/swift4/unwrapRequired/.gitignore | 63 ++ .../unwrapRequired/.openapi-generator-ignore | 23 + .../unwrapRequired/.openapi-generator/VERSION | 1 + .../petstore/swift4/unwrapRequired/Cartfile | 1 + .../unwrapRequired/PetstoreClient.podspec | 14 + .../Classes/OpenAPIs/APIHelper.swift | 65 ++ .../Classes/OpenAPIs/APIs.swift | 61 ++ .../OpenAPIs/APIs/AnotherFakeAPI.swift | 46 ++ .../Classes/OpenAPIs/APIs/FakeAPI.swift | 499 ++++++++++++ .../APIs/FakeClassnameTags123API.swift | 49 ++ .../Classes/OpenAPIs/APIs/PetAPI.swift | 358 +++++++++ .../Classes/OpenAPIs/APIs/StoreAPI.swift | 152 ++++ .../Classes/OpenAPIs/APIs/UserAPI.swift | 305 ++++++++ .../OpenAPIs/AlamofireImplementations.swift | 413 ++++++++++ .../Classes/OpenAPIs/CodableHelper.swift | 67 ++ .../Classes/OpenAPIs/Configuration.swift | 15 + .../Classes/OpenAPIs/Extensions.swift | 173 +++++ .../OpenAPIs/JSONEncodableEncoding.swift | 54 ++ .../Classes/OpenAPIs/JSONEncodingHelper.swift | 43 ++ .../Classes/OpenAPIs/Models.swift | 36 + .../Models/AdditionalPropertiesClass.swift | 29 + .../Classes/OpenAPIs/Models/Animal.swift | 24 + .../Classes/OpenAPIs/Models/AnimalFarm.swift | 11 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 26 + .../Models/ArrayOfArrayOfNumberOnly.swift | 26 + .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 26 + .../Classes/OpenAPIs/Models/ArrayTest.swift | 32 + .../OpenAPIs/Models/Capitalization.swift | 42 ++ .../Classes/OpenAPIs/Models/Cat.swift | 26 + .../Classes/OpenAPIs/Models/Category.swift | 29 + .../Classes/OpenAPIs/Models/ClassModel.swift | 23 + .../Classes/OpenAPIs/Models/Client.swift | 22 + .../Classes/OpenAPIs/Models/Dog.swift | 26 + .../Classes/OpenAPIs/Models/EnumArrays.swift | 37 + .../Classes/OpenAPIs/Models/EnumClass.swift | 15 + .../Classes/OpenAPIs/Models/EnumTest.swift | 56 ++ .../Classes/OpenAPIs/Models/FormatTest.swift | 46 ++ .../OpenAPIs/Models/HasOnlyReadOnly.swift | 24 + .../Classes/OpenAPIs/Models/List.swift | 26 + .../Classes/OpenAPIs/Models/MapTest.swift | 33 + ...opertiesAndAdditionalPropertiesClass.swift | 26 + .../OpenAPIs/Models/Model200Response.swift | 30 + .../Classes/OpenAPIs/Models/Name.swift | 36 + .../Classes/OpenAPIs/Models/NumberOnly.swift | 26 + .../Classes/OpenAPIs/Models/Order.swift | 47 ++ .../OpenAPIs/Models/OuterComposite.swift | 32 + .../Classes/OpenAPIs/Models/OuterEnum.swift | 15 + .../Classes/OpenAPIs/Models/Pet.swift | 47 ++ .../OpenAPIs/Models/ReadOnlyFirst.swift | 24 + .../Classes/OpenAPIs/Models/Return.swift | 27 + .../OpenAPIs/Models/SpecialModelName.swift | 26 + .../Classes/OpenAPIs/Models/Tag.swift | 29 + .../Classes/OpenAPIs/Models/User.swift | 48 ++ .../swift4/unwrapRequired/git_push.sh | 52 ++ 241 files changed, 14870 insertions(+), 1111 deletions(-) create mode 100644 bin/swift4-petstore-unwrapRequired.json create mode 100755 bin/swift4-petstore-unwrapRequired.sh create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift create mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift create mode 100644 samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift create mode 100644 samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/.gitignore create mode 100644 samples/client/petstore/swift4/unwrapRequired/.openapi-generator-ignore create mode 100644 samples/client/petstore/swift4/unwrapRequired/.openapi-generator/VERSION create mode 100644 samples/client/petstore/swift4/unwrapRequired/Cartfile create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient.podspec create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift create mode 100644 samples/client/petstore/swift4/unwrapRequired/git_push.sh diff --git a/bin/swift4-petstore-all.sh b/bin/swift4-petstore-all.sh index e1725c37687..b8d8cd47b26 100755 --- a/bin/swift4-petstore-all.sh +++ b/bin/swift4-petstore-all.sh @@ -4,3 +4,4 @@ ./bin/swift4-petstore-promisekit.sh ./bin/swift4-petstore-rxswift.sh ./bin/swift4-petstore-objcCompatible.sh +./bin/swift4-petstore-unwrapRequired.sh diff --git a/bin/swift4-petstore-unwrapRequired.json b/bin/swift4-petstore-unwrapRequired.json new file mode 100644 index 00000000000..3d3152c52a2 --- /dev/null +++ b/bin/swift4-petstore-unwrapRequired.json @@ -0,0 +1,7 @@ +{ + "podSummary": "PetstoreClient", + "podHomepage": "https://github.com/openapitools/openapi-generator", + "podAuthors": "", + "projectName": "PetstoreClient", + "unwrapRequired": true +} diff --git a/bin/swift4-petstore-unwrapRequired.sh b/bin/swift4-petstore-unwrapRequired.sh new file mode 100755 index 00000000000..9e30fdf76b8 --- /dev/null +++ b/bin/swift4-petstore-unwrapRequired.sh @@ -0,0 +1,32 @@ +#!/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 -B 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/swift4 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-unwrapRequired.json -o samples/client/petstore/swift4/unwrapRequired $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/openapi-generator/src/main/resources/swift4/modelObject.mustache b/modules/openapi-generator/src/main/resources/swift4/modelObject.mustache index 3021f006706..d477ac7880d 100644 --- a/modules/openapi-generator/src/main/resources/swift4/modelObject.mustache +++ b/modules/openapi-generator/src/main/resources/swift4/modelObject.mustache @@ -9,11 +9,11 @@ public struct {{classname}}: Codable { {{#allVars}} {{#isEnum}} {{#description}}/** {{description}} */ - {{/description}}public var {{name}}: {{{datatypeWithEnum}}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} + {{/description}}public var {{name}}: {{{datatypeWithEnum}}}{{#unwrapRequired}}?{{/unwrapRequired}}{{^unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} {{/isEnum}} {{^isEnum}} {{#description}}/** {{description}} */ - {{/description}}public var {{name}}: {{{dataType}}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#objcCompatible}}{{#vendorExtensions.x-swift-optional-scalar}} + {{/description}}public var {{name}}: {{{datatype}}}{{#unwrapRequired}}?{{/unwrapRequired}}{{^unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#objcCompatible}}{{#vendorExtensions.x-swift-optional-scalar}} public var {{name}}Num: NSNumber? { get { return {{name}}.map({ return NSNumber(value: $0) }) @@ -23,7 +23,7 @@ public struct {{classname}}: Codable { {{/allVars}} {{#hasVars}} - public init({{#allVars}}{{name}}: {{{datatypeWithEnum}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/allVars}}) { + public init({{#allVars}}{{name}}: {{{datatypeWithEnum}}}{{#unwrapRequired}}?{{/unwrapRequired}}{{^unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{#hasMore}}, {{/hasMore}}{{/allVars}}) { {{#allVars}} self.{{name}} = {{name}} {{/allVars}} @@ -52,7 +52,7 @@ public struct {{classname}}: Codable { var container = encoder.container(keyedBy: String.self) {{#allVars}} - try container.encode{{^required}}IfPresent{{/required}}({{{name}}}, forKey: "{{{baseName}}}") + try container.encode{{#unwrapRequired}}IfPresent{{/unwrapRequired}}{{^unwrapRequired}}{{^required}}IfPresent{{/required}}{{/unwrapRequired}}({{{name}}}, forKey: "{{{baseName}}}") {{/allVars}} try container.encodeMap(additionalProperties) } @@ -63,7 +63,7 @@ public struct {{classname}}: Codable { let container = try decoder.container(keyedBy: String.self) {{#allVars}} - {{name}} = try container.decode{{^required}}IfPresent{{/required}}({{{datatypeWithEnum}}}.self, forKey: "{{{baseName}}}") + {{name}} = try container.decode{{#unwrapRequired}}IfPresent{{/unwrapRequired}}{{^unwrapRequired}}{{^required}}IfPresent{{/required}}{{/unwrapRequired}}({{{datatypeWithEnum}}}.self, forKey: "{{{baseName}}}") {{/allVars}} var nonAdditionalPropertyKeys = Set() {{#allVars}} diff --git a/samples/client/petstore/swift3/default/.openapi-generator/VERSION b/samples/client/petstore/swift3/default/.openapi-generator/VERSION index 096bf47efe3..ad121e8340e 100644 --- a/samples/client/petstore/swift3/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/default/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION index 096bf47efe3..ad121e8340e 100644 --- a/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 7381be5eef6..ea37e8c5966 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -26,9 +26,6 @@ open class AnotherFakeAPI: APIBase { To test special tags - PATCH /another-fake/dummy - To test special tags - - examples: [{contentType=application/json, example={ - "client" : "client" -}}] - parameter client: (body) client model - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 8da34b09cfb..3ed9e7cfddf 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -24,7 +24,6 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/boolean - Test serialization of outer boolean types - - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input boolean as post body (optional) - returns: RequestBuilder */ @@ -54,7 +53,6 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - examples: [{contentType=*/*, example={ }}] - parameter outerComposite: (body) Input composite as post body (optional) - returns: RequestBuilder */ @@ -84,7 +82,6 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/number - Test serialization of outer number types - - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input number as post body (optional) - returns: RequestBuilder */ @@ -114,7 +111,6 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/string - Test serialization of outer string types - - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input string as post body (optional) - returns: RequestBuilder */ @@ -146,9 +142,6 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - examples: [{contentType=application/json, example={ - "client" : "client" -}}] - parameter client: (body) client model - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 29690f61979..a54e0ff03f4 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -28,9 +28,6 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - examples: [{contentType=application/json, example={ - "client" : "client" -}}] - parameter client: (body) client model - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 3f9f338b1af..1460cbe2955 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -113,58 +113,6 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ @@ -202,58 +150,6 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - parameter tags: (query) Tags to filter by - returns: RequestBuilder<[Pet]> */ @@ -291,58 +187,6 @@ open class PetAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - parameter petId: (path) ID of pet to return - returns: RequestBuilder */ @@ -460,11 +304,6 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example={ - "code" : 0, - "type" : "type", - "message" : "message" -}}] - parameter petId: (path) ID of pet to update - parameter additionalMetadata: (form) Additional data to pass to server (optional) - parameter file: (form) file to upload (optional) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 53c51f3e990..66dbd6f25d8 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -92,36 +92,6 @@ open class StoreAPI: APIBase { Find purchase order by ID - GET /store/order/{order_id} - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder */ @@ -155,36 +125,6 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - parameter order: (body) order placed for purchasing the pet - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index c8f7c607c91..eee28ea249a 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -150,44 +150,6 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - examples: [{contentType=application/json, example={ - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" -}}, {contentType=application/xml, example= - 123456789 - aeiou - aeiou - aeiou - aeiou - aeiou - aeiou - 123 -}] - - examples: [{contentType=application/json, example={ - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" -}}, {contentType=application/xml, example= - 123456789 - aeiou - aeiou - aeiou - aeiou - aeiou - aeiou - 123 -}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION b/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION index 096bf47efe3..ad121e8340e 100644 --- a/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 683c9d00751..1c087005aca 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -43,9 +43,6 @@ open class AnotherFakeAPI: APIBase { To test special tags - PATCH /another-fake/dummy - To test special tags - - examples: [{contentType=application/json, example={ - "client" : "client" -}}] - parameter client: (body) client model - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index d44a3736c63..daf7ed7ad4a 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -40,7 +40,6 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/boolean - Test serialization of outer boolean types - - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input boolean as post body (optional) - returns: RequestBuilder */ @@ -85,7 +84,6 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - examples: [{contentType=*/*, example={ }}] - parameter outerComposite: (body) Input composite as post body (optional) - returns: RequestBuilder */ @@ -130,7 +128,6 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/number - Test serialization of outer number types - - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input number as post body (optional) - returns: RequestBuilder */ @@ -175,7 +172,6 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/string - Test serialization of outer string types - - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input string as post body (optional) - returns: RequestBuilder */ @@ -223,9 +219,6 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - examples: [{contentType=application/json, example={ - "client" : "client" -}}] - parameter client: (body) client model - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 0e328cd4283..757d5fbe468 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -45,9 +45,6 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - examples: [{contentType=application/json, example={ - "client" : "client" -}}] - parameter client: (body) client model - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 163556dcbf4..239005397eb 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -163,58 +163,6 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ @@ -268,58 +216,6 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - parameter tags: (query) Tags to filter by - returns: RequestBuilder<[Pet]> */ @@ -373,58 +269,6 @@ open class PetAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - parameter petId: (path) ID of pet to return - returns: RequestBuilder */ @@ -594,11 +438,6 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example={ - "code" : 0, - "type" : "type", - "message" : "message" -}}] - parameter petId: (path) ID of pet to update - parameter additionalMetadata: (form) Additional data to pass to server (optional) - parameter file: (form) file to upload (optional) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 500ceee9f4f..67fe5e9bacf 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -140,36 +140,6 @@ open class StoreAPI: APIBase { Find purchase order by ID - GET /store/order/{order_id} - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder */ @@ -219,36 +189,6 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - parameter order: (body) order placed for purchasing the pet - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index c1c06a892fa..90a131ebe8b 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -231,44 +231,6 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - examples: [{contentType=application/json, example={ - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" -}}, {contentType=application/xml, example= - 123456789 - aeiou - aeiou - aeiou - aeiou - aeiou - aeiou - 123 -}] - - examples: [{contentType=application/json, example={ - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" -}}, {contentType=application/xml, example= - 123456789 - aeiou - aeiou - aeiou - aeiou - aeiou - aeiou - 123 -}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION b/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION index 096bf47efe3..ad121e8340e 100644 --- a/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 3de3c12f944..c468f8a3828 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -45,9 +45,6 @@ open class AnotherFakeAPI: APIBase { To test special tags - PATCH /another-fake/dummy - To test special tags - - examples: [{contentType=application/json, example={ - "client" : "client" -}}] - parameter client: (body) client model - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 45aa13f036e..cf09fa027fe 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -42,7 +42,6 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/boolean - Test serialization of outer boolean types - - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input boolean as post body (optional) - returns: RequestBuilder */ @@ -89,7 +88,6 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - examples: [{contentType=*/*, example={ }}] - parameter outerComposite: (body) Input composite as post body (optional) - returns: RequestBuilder */ @@ -136,7 +134,6 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/number - Test serialization of outer number types - - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input number as post body (optional) - returns: RequestBuilder */ @@ -183,7 +180,6 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/string - Test serialization of outer string types - - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input string as post body (optional) - returns: RequestBuilder */ @@ -233,9 +229,6 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - examples: [{contentType=application/json, example={ - "client" : "client" -}}] - parameter client: (body) client model - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index b5e911d6c50..ee7f77c9de6 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -47,9 +47,6 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - examples: [{contentType=application/json, example={ - "client" : "client" -}}] - parameter client: (body) client model - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 708f9527b34..51543ddc2e6 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -169,58 +169,6 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ @@ -276,58 +224,6 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - parameter tags: (query) Tags to filter by - returns: RequestBuilder<[Pet]> */ @@ -383,58 +279,6 @@ open class PetAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - parameter petId: (path) ID of pet to return - returns: RequestBuilder */ @@ -610,11 +454,6 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example={ - "code" : 0, - "type" : "type", - "message" : "message" -}}] - parameter petId: (path) ID of pet to update - parameter additionalMetadata: (form) Additional data to pass to server (optional) - parameter file: (form) file to upload (optional) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 8ac4209dcee..1fc9de36c09 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -146,36 +146,6 @@ open class StoreAPI: APIBase { Find purchase order by ID - GET /store/order/{order_id} - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder */ @@ -227,36 +197,6 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - parameter order: (body) order placed for purchasing the pet - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 5c21da00313..0641d7201db 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -241,44 +241,6 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - examples: [{contentType=application/json, example={ - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" -}}, {contentType=application/xml, example= - 123456789 - aeiou - aeiou - aeiou - aeiou - aeiou - aeiou - 123 -}] - - examples: [{contentType=application/json, example={ - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" -}}, {contentType=application/xml, example= - 123456789 - aeiou - aeiou - aeiou - aeiou - aeiou - aeiou - 123 -}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION b/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION index 096bf47efe3..ad121e8340e 100644 --- a/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 7381be5eef6..ea37e8c5966 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -26,9 +26,6 @@ open class AnotherFakeAPI: APIBase { To test special tags - PATCH /another-fake/dummy - To test special tags - - examples: [{contentType=application/json, example={ - "client" : "client" -}}] - parameter client: (body) client model - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 8da34b09cfb..3ed9e7cfddf 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -24,7 +24,6 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/boolean - Test serialization of outer boolean types - - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input boolean as post body (optional) - returns: RequestBuilder */ @@ -54,7 +53,6 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - examples: [{contentType=*/*, example={ }}] - parameter outerComposite: (body) Input composite as post body (optional) - returns: RequestBuilder */ @@ -84,7 +82,6 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/number - Test serialization of outer number types - - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input number as post body (optional) - returns: RequestBuilder */ @@ -114,7 +111,6 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/string - Test serialization of outer string types - - examples: [{contentType=*/*, example=null}] - parameter body: (body) Input string as post body (optional) - returns: RequestBuilder */ @@ -146,9 +142,6 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - examples: [{contentType=application/json, example={ - "client" : "client" -}}] - parameter client: (body) client model - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 29690f61979..a54e0ff03f4 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -28,9 +28,6 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - examples: [{contentType=application/json, example={ - "client" : "client" -}}] - parameter client: (body) client model - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 3f9f338b1af..1460cbe2955 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -113,58 +113,6 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - parameter status: (query) Status values that need to be considered for filter - returns: RequestBuilder<[Pet]> */ @@ -202,58 +150,6 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - parameter tags: (query) Tags to filter by - returns: RequestBuilder<[Pet]> */ @@ -291,58 +187,6 @@ open class PetAPI: APIBase { - API Key: - type: apiKey api_key - name: api_key - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - parameter petId: (path) ID of pet to return - returns: RequestBuilder */ @@ -460,11 +304,6 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - examples: [{contentType=application/json, example={ - "code" : 0, - "type" : "type", - "message" : "message" -}}] - parameter petId: (path) ID of pet to update - parameter additionalMetadata: (form) Additional data to pass to server (optional) - parameter file: (form) file to upload (optional) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 53c51f3e990..66dbd6f25d8 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -92,36 +92,6 @@ open class StoreAPI: APIBase { Find purchase order by ID - GET /store/order/{order_id} - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder */ @@ -155,36 +125,6 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - parameter order: (body) order placed for purchasing the pet - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index c8f7c607c91..eee28ea249a 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -150,44 +150,6 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - examples: [{contentType=application/json, example={ - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" -}}, {contentType=application/xml, example= - 123456789 - aeiou - aeiou - aeiou - aeiou - aeiou - aeiou - 123 -}] - - examples: [{contentType=application/json, example={ - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" -}}, {contentType=application/xml, example= - 123456789 - aeiou - aeiou - aeiou - aeiou - aeiou - aeiou - 123 -}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ diff --git a/samples/client/petstore/swift4/default/.openapi-generator/VERSION b/samples/client/petstore/swift4/default/.openapi-generator/VERSION index 096bf47efe3..ad121e8340e 100644 --- a/samples/client/petstore/swift4/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift4/default/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift4/objcCompatible/.openapi-generator/VERSION index 855ff9501eb..ad121e8340e 100644 --- a/samples/client/petstore/swift4/objcCompatible/.openapi-generator/VERSION +++ b/samples/client/petstore/swift4/objcCompatible/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.podspec b/samples/client/petstore/swift4/objcCompatible/PetstoreClient.podspec index 0245828f84b..c8453cdd8e0 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.podspec +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient.podspec @@ -4,10 +4,10 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.11' s.tvos.deployment_target = '9.0' s.version = '0.0.1' - s.source = { :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' } + s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } s.authors = '' s.license = 'Proprietary' - s.homepage = 'https://github.com/swagger-api/swagger-codegen' + s.homepage = 'https://github.com/openapitools/openapi-generator' s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' s.dependency 'Alamofire', '~> 4.5.0' diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift new file mode 100644 index 00000000000..3c7b53f8149 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -0,0 +1,65 @@ +// APIHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct APIHelper { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + let destination = source.reduce(into: [String: Any]()) { (result, item) in + if let value = item.value { + result[item.key] = value + } + } + + if destination.isEmpty { + return nil + } + return destination + } + + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + return source.reduce(into: [String: String]()) { (result, item) in + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + } else if let value: Any = item.value { + result[item.key] = "\(value)" + } + } + } + + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + guard let source = source else { + return nil + } + + return source.reduce(into: [String: Any](), { (result, item) in + switch item.value { + case let x as Bool: + result[item.key] = x.description + default: + result[item.key] = item.value + } + }) + } + + + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in + if let collection = item.value as? Array { + let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") + result.append(URLQueryItem(name: item.key, value: value)) + } else if let value = item.value { + result.append(URLQueryItem(name: item.key, value: "\(value)")) + } + } + + if destination.isEmpty { + return nil + } + return destination + } +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift new file mode 100644 index 00000000000..8cae3aacfe5 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -0,0 +1,61 @@ +// APIs.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class PetstoreClientAPI { + open static var basePath = "http://petstore.swagger.io:80/v2" + open static var credential: URLCredential? + open static var customHeaders: [String:String] = [:] + open static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() +} + +open class RequestBuilder { + var credential: URLCredential? + var headers: [String:String] + public let parameters: [String:Any]? + public let isBody: Bool + public let method: String + public let URLString: String + + /// Optional block to obtain a reference to the request's progress instance when available. + public var onProgressReady: ((Progress) -> ())? + + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + self.method = method + self.URLString = URLString + self.parameters = parameters + self.isBody = isBody + self.headers = headers + + addHeaders(PetstoreClientAPI.customHeaders) + } + + open func addHeaders(_ aHeaders:[String:String]) { + for (header, value) in aHeaders { + headers[header] = value + } + } + + open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { } + + public func addHeader(name: String, value: String) -> Self { + if !value.isEmpty { + headers[name] = value + } + return self + } + + open func addCredential() -> Self { + self.credential = PetstoreClientAPI.credential + return self + } +} + +public protocol RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift new file mode 100644 index 00000000000..f8313034a66 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -0,0 +1,46 @@ +// +// AnotherFakeAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + + + +open class AnotherFakeAPI { + /** + To test special tags + + - parameter client: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + To test special tags + - PATCH /another-fake/dummy + - To test special tags + - parameter client: (body) client model + - returns: RequestBuilder + */ + open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { + let path = "/another-fake/dummy" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: client) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift new file mode 100644 index 00000000000..d22ed47557e --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -0,0 +1,499 @@ +// +// FakeAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + + + +open class FakeAPI { + /** + + - parameter body: (body) Input boolean as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { + fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + - POST /fake/outer/boolean + - Test serialization of outer boolean types + - parameter body: (body) Input boolean as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { + let path = "/fake/outer/boolean" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter outerComposite: (body) Input composite as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + - POST /fake/outer/composite + - Test serialization of object with outer number type + - parameter outerComposite: (body) Input composite as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { + let path = "/fake/outer/composite" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: outerComposite) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter body: (body) Input number as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { + fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + - POST /fake/outer/number + - Test serialization of outer number types + - parameter body: (body) Input number as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { + let path = "/fake/outer/number" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter body: (body) Input string as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + - POST /fake/outer/string + - Test serialization of outer string types + - parameter body: (body) Input string as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { + let path = "/fake/outer/string" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter query: (query) + - parameter user: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithQueryParams(query: String, user: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + - PUT /fake/body-with-query-params + - parameter query: (query) + - parameter user: (body) + - returns: RequestBuilder + */ + open class func testBodyWithQueryParamsWithRequestBuilder(query: String, user: User) -> RequestBuilder { + let path = "/fake/body-with-query-params" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "query": query + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + To test \"client\" model + + - parameter client: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + To test \"client\" model + - PATCH /fake + - To test \"client\" model + - parameter client: (body) client model + - returns: RequestBuilder + */ + open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: client) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + - parameter number: (form) None + - parameter double: (form) None + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter float: (form) None (optional) + - parameter string: (form) None (optional) + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - POST /fake + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - BASIC: + - type: http + - name: http_basic_test + - parameter number: (form) None + - parameter double: (form) None + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter float: (form) None (optional) + - parameter string: (form) None (optional) + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + - returns: RequestBuilder + */ + open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "integer": integer?.encodeToJSON(), + "int32": int32?.encodeToJSON(), + "int64": int64?.encodeToJSON(), + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date?.encodeToJSON(), + "dateTime": dateTime?.encodeToJSON(), + "password": password, + "callback": callback + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + * enum for parameter enumHeaderStringArray + */ + public enum EnumHeaderStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumHeaderString + */ + public enum EnumHeaderString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + * enum for parameter enumQueryStringArray + */ + public enum EnumQueryStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumQueryString + */ + public enum EnumQueryString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + * enum for parameter enumQueryInteger + */ + public enum EnumQueryInteger_testEnumParameters: Int { + case _1 = 1 + case number2 = -2 + } + + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + + /** + * enum for parameter enumFormStringArray + */ + public enum EnumFormStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumFormString + */ + public enum EnumFormString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + To test enum parameters + + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to "$") + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to "-efg") + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + To test enum parameters + - GET /fake + - To test enum parameters + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to "$") + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to "-efg") + - returns: RequestBuilder + */ + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString?.rawValue + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "enum_query_string_array": enumQueryStringArray, + "enum_query_string": enumQueryString?.rawValue, + "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue + ]) + let nillableHeaders: [String: Any?] = [ + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString?.rawValue + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + test inline additionalProperties + + - parameter requestBody: (body) request body + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testInlineAdditionalProperties(requestBody: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(requestBody: requestBody).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + test inline additionalProperties + - POST /fake/inline-additionalProperties + - parameter requestBody: (body) request body + - returns: RequestBuilder + */ + open class func testInlineAdditionalPropertiesWithRequestBuilder(requestBody: [String:String]) -> RequestBuilder { + let path = "/fake/inline-additionalProperties" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: requestBody) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + test json serialization of form data + + - parameter param: (form) field1 + - parameter param2: (form) field2 + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + test json serialization of form data + - GET /fake/jsonFormData + - parameter param: (form) field1 + - parameter param2: (form) field2 + - returns: RequestBuilder + */ + open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { + let path = "/fake/jsonFormData" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "param": param, + "param2": param2 + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift new file mode 100644 index 00000000000..8bb79ddd28f --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -0,0 +1,49 @@ +// +// FakeClassnameTags123API.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + + + +open class FakeClassnameTags123API { + /** + To test class name in snake case + + - parameter client: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testClassname(client: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + To test class name in snake case + - PATCH /fake_classname_test + - To test class name in snake case + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query + - parameter client: (body) client model + - returns: RequestBuilder + */ + open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { + let path = "/fake_classname_test" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: client) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift new file mode 100644 index 00000000000..c525e66cce5 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -0,0 +1,358 @@ +// +// PetAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + + + +open class PetAPI { + /** + Add a new pet to the store + + - parameter pet: (body) Pet object that needs to be added to the store + - parameter completion: completion handler to receive the data and the error objects + */ + open class func addPet(pet: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Add a new pet to the store + - POST /pet + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter pet: (body) Pet object that needs to be added to the store + - returns: RequestBuilder + */ + open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { + let path = "/pet" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: pet) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Deletes a pet + + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Deletes a pet + - DELETE /pet/{petId} + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + - returns: RequestBuilder + */ + open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + let nillableHeaders: [String: Any?] = [ + "api_key": apiKey + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + * enum for parameter status + */ + public enum Status_findPetsByStatus: String { + case available = "available" + case pending = "pending" + case sold = "sold" + } + + /** + Finds Pets by status + + - parameter status: (query) Status values that need to be considered for filter + - parameter completion: completion handler to receive the data and the error objects + */ + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + Finds Pets by status + - GET /pet/findByStatus + - Multiple status values can be provided with comma separated strings + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter status: (query) Status values that need to be considered for filter + - returns: RequestBuilder<[Pet]> + */ + open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + let path = "/pet/findByStatus" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "status": status + ]) + + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Finds Pets by tags + + - parameter tags: (query) Tags to filter by + - parameter completion: completion handler to receive the data and the error objects + */ + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + Finds Pets by tags + - GET /pet/findByTags + - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter tags: (query) Tags to filter by + - returns: RequestBuilder<[Pet]> + */ + open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { + let path = "/pet/findByTags" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "tags": tags + ]) + + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Find pet by ID + + - parameter petId: (path) ID of pet to return + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { + getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + Find pet by ID + - GET /pet/{petId} + - Returns a single pet + - API Key: + - type: apiKey api_key + - name: api_key + - parameter petId: (path) ID of pet to return + - returns: RequestBuilder + */ + open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Update an existing pet + + - parameter pet: (body) Pet object that needs to be added to the store + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updatePet(pet: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Update an existing pet + - PUT /pet + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter pet: (body) Pet object that needs to be added to the store + - returns: RequestBuilder + */ + open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { + let path = "/pet" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: pet) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Updates a pet in the store with form data + + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Updates a pet in the store with form data + - POST /pet/{petId} + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - returns: RequestBuilder + */ + open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "name": name, + "status": status + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + uploads an image + + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + uploads an image + - POST /pet/{petId}/uploadImage + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { + var path = "/pet/{petId}/uploadImage" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "additionalMetadata": additionalMetadata, + "file": file + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift new file mode 100644 index 00000000000..920eff9816b --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -0,0 +1,152 @@ +// +// StoreAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + + + +open class StoreAPI { + /** + Delete purchase order by ID + + - parameter orderId: (path) ID of the order that needs to be deleted + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Delete purchase order by ID + - DELETE /store/order/{order_id} + - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + - parameter orderId: (path) ID of the order that needs to be deleted + - returns: RequestBuilder + */ + open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { + var path = "/store/order/{order_id}" + let orderIdPreEscape = "\(orderId)" + let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Returns pet inventories by status + + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { + getInventoryWithRequestBuilder().execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + Returns pet inventories by status + - GET /store/inventory + - Returns a map of status codes to quantities + - API Key: + - type: apiKey api_key + - name: api_key + - returns: RequestBuilder<[String:Int]> + */ + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + let path = "/store/inventory" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Find purchase order by ID + + - parameter orderId: (path) ID of pet that needs to be fetched + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + Find purchase order by ID + - GET /store/order/{order_id} + - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + - parameter orderId: (path) ID of pet that needs to be fetched + - returns: RequestBuilder + */ + open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { + var path = "/store/order/{order_id}" + let orderIdPreEscape = "\(orderId)" + let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Place an order for a pet + + - parameter order: (body) order placed for purchasing the pet + - parameter completion: completion handler to receive the data and the error objects + */ + open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + Place an order for a pet + - POST /store/order + - parameter order: (body) order placed for purchasing the pet + - returns: RequestBuilder + */ + open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { + let path = "/store/order" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: order) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift new file mode 100644 index 00000000000..e9457fc88a6 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -0,0 +1,305 @@ +// +// UserAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + + + +open class UserAPI { + /** + Create user + + - parameter user: (body) Created user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUser(user: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Create user + - POST /user + - This can only be done by the logged in user. + - parameter user: (body) Created user object + - returns: RequestBuilder + */ + open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { + let path = "/user" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Creates list of users with given input array + - POST /user/createWithArray + - parameter user: (body) List of user object + - returns: RequestBuilder + */ + open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { + let path = "/user/createWithArray" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUsersWithListInput(user: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Creates list of users with given input array + - POST /user/createWithList + - parameter user: (body) List of user object + - returns: RequestBuilder + */ + open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { + let path = "/user/createWithList" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Delete user + + - parameter username: (path) The name that needs to be deleted + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Delete user + - DELETE /user/{username} + - This can only be done by the logged in user. + - parameter username: (path) The name that needs to be deleted + - returns: RequestBuilder + */ + open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(username)" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Get user by user name + + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { + getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + Get user by user name + - GET /user/{username} + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - returns: RequestBuilder + */ + open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(username)" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Logs user into the system + + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - parameter completion: completion handler to receive the data and the error objects + */ + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + Logs user into the system + - GET /user/login + - responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)] + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - returns: RequestBuilder + */ + open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { + let path = "/user/login" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "username": username, + "password": password + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Logs out current logged in user session + + - parameter completion: completion handler to receive the data and the error objects + */ + open class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Logs out current logged in user session + - GET /user/logout + - returns: RequestBuilder + */ + open class func logoutUserWithRequestBuilder() -> RequestBuilder { + let path = "/user/logout" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Updated user + + - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updateUser(username: String, user: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Updated user + - PUT /user/{username} + - This can only be done by the logged in user. + - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object + - returns: RequestBuilder + */ + open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(username)" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift new file mode 100644 index 00000000000..280b4e53389 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -0,0 +1,413 @@ +// AlamofireImplementations.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + +class AlamofireRequestBuilderFactory: RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type { + return AlamofireRequestBuilder.self + } + + func getBuilder() -> RequestBuilder.Type { + return AlamofireDecodableRequestBuilder.self + } +} + +// Store manager to retain its reference +private var managerStore: [String: Alamofire.SessionManager] = [:] + +open class AlamofireRequestBuilder: RequestBuilder { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) + } + + /** + May be overridden by a subclass if you want to control the session + configuration. + */ + open func createSessionManager() -> Alamofire.SessionManager { + let configuration = URLSessionConfiguration.default + configuration.httpAdditionalHeaders = buildHeaders() + return Alamofire.SessionManager(configuration: configuration) + } + + /** + May be overridden by a subclass if you want to control the Content-Type + that is given to an uploaded form part. + + Return nil to use the default behavior (inferring the Content-Type from + the file extension). Return the desired Content-Type otherwise. + */ + open func contentTypeForFormPart(fileURL: URL) -> String? { + return nil + } + + /** + May be overridden by a subclass if you want to control the request + configuration (e.g. to override the cache policy). + */ + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { + return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) + } + + override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + let managerId:String = UUID().uuidString + // Create a new manager for each request to customize its request header + let manager = createSessionManager() + managerStore[managerId] = manager + + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + + let xMethod = Alamofire.HTTPMethod(rawValue: method) + let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } + .map { $0.0 } + + if fileKeys.count > 0 { + manager.upload(multipartFormData: { mpForm in + for (k, v) in self.parameters! { + switch v { + case let fileURL as URL: + if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { + mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) + } + else { + mpForm.append(fileURL, withName: k) + } + case let string as String: + mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) + case let number as NSNumber: + mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) + default: + fatalError("Unprocessable value \(v) with key \(k)") + } + } + }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in + switch encodingResult { + case .success(let upload, _, _): + if let onProgressReady = self.onProgressReady { + onProgressReady(upload.uploadProgress) + } + self.processRequest(request: upload, managerId, completion) + case .failure(let encodingError): + completion(nil, ErrorResponse.error(415, nil, encodingError)) + } + }) + } else { + let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) + if let onProgressReady = self.onProgressReady { + onProgressReady(request.progress) + } + processRequest(request: request, managerId, completion) + } + + } + + fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + if let credential = self.credential { + request.authenticate(usingCredential: credential) + } + + let cleanupRequest = { + _ = managerStore.removeValue(forKey: managerId) + } + + let validatedRequest = request.validate() + + switch T.self { + case is String.Type: + validatedRequest.responseString(completionHandler: { (stringResponse) in + cleanupRequest() + + if stringResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!) + ) + return + } + + completion( + Response( + response: stringResponse.response!, + body: ((stringResponse.result.value ?? "") as! T) + ), + nil + ) + }) + case is URL.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + do { + + guard !dataResponse.result.isFailure else { + throw DownloadException.responseFailed + } + + guard let data = dataResponse.data else { + throw DownloadException.responseDataMissing + } + + guard let request = request.request else { + throw DownloadException.requestMissing + } + + let fileManager = FileManager.default + let urlRequest = try request.asURLRequest() + let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] + let requestURL = try self.getURL(from: urlRequest) + + var requestPath = try self.getPath(from: requestURL) + + if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { + requestPath = requestPath.appending("/\(headerFileName)") + } + + let filePath = documentsDirectory.appendingPathComponent(requestPath) + let directoryPath = filePath.deletingLastPathComponent().path + + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) + try data.write(to: filePath, options: .atomic) + + completion( + Response( + response: dataResponse.response!, + body: (filePath as! T) + ), + nil + ) + + } catch let requestParserError as DownloadException { + completion(nil, ErrorResponse.error(400, dataResponse.data, requestParserError)) + } catch let error { + completion(nil, ErrorResponse.error(400, dataResponse.data, error)) + } + return + }) + case is Void.Type: + validatedRequest.responseData(completionHandler: { (voidResponse) in + cleanupRequest() + + if voidResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) + ) + return + } + + completion( + Response( + response: voidResponse.response!, + body: nil), + nil + ) + }) + default: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + if dataResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) + ) + return + } + + completion( + Response( + response: dataResponse.response!, + body: (dataResponse.data as! T) + ), + nil + ) + }) + } + } + + open func buildHeaders() -> [String: String] { + var httpHeaders = SessionManager.defaultHTTPHeaders + for (key, value) in self.headers { + httpHeaders[key] = value + } + return httpHeaders + } + + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + + guard let contentDisposition = contentDisposition else { + return nil + } + + let items = contentDisposition.components(separatedBy: ";") + + var filename : String? = nil + + for contentItem in items { + + let filenameKey = "filename=" + guard let range = contentItem.range(of: filenameKey) else { + break + } + + filename = contentItem + return filename? + .replacingCharacters(in: range, with:"") + .replacingOccurrences(of: "\"", with: "") + .trimmingCharacters(in: .whitespacesAndNewlines) + } + + return filename + + } + + fileprivate func getPath(from url : URL) throws -> String { + + guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { + throw DownloadException.requestMissingPath + } + + if path.hasPrefix("/") { + path.remove(at: path.startIndex) + } + + return path + + } + + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + return url + } + +} + +fileprivate enum DownloadException : Error { + case responseDataMissing + case responseFailed + case requestMissing + case requestMissingPath + case requestMissingURL +} + +public enum AlamofireDecodableRequestBuilderError: Error { + case emptyDataResponse + case nilHTTPResponse + case jsonDecoding(DecodingError) + case generalError(Error) +} + +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { + + override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + if let credential = self.credential { + request.authenticate(usingCredential: credential) + } + + let cleanupRequest = { + _ = managerStore.removeValue(forKey: managerId) + } + + let validatedRequest = request.validate() + + switch T.self { + case is String.Type: + validatedRequest.responseString(completionHandler: { (stringResponse) in + cleanupRequest() + + if stringResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!) + ) + return + } + + completion( + Response( + response: stringResponse.response!, + body: ((stringResponse.result.value ?? "") as! T) + ), + nil + ) + }) + case is Void.Type: + validatedRequest.responseData(completionHandler: { (voidResponse) in + cleanupRequest() + + if voidResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) + ) + return + } + + completion( + Response( + response: voidResponse.response!, + body: nil), + nil + ) + }) + case is Data.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + if dataResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) + ) + return + } + + completion( + Response( + response: dataResponse.response!, + body: (dataResponse.data as! T) + ), + nil + ) + }) + default: + validatedRequest.responseData(completionHandler: { (dataResponse: DataResponse) in + cleanupRequest() + + guard dataResponse.result.isSuccess else { + completion(nil, ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)) + return + } + + guard let data = dataResponse.data, !data.isEmpty else { + completion(nil, ErrorResponse.error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse)) + return + } + + guard let httpResponse = dataResponse.response else { + completion(nil, ErrorResponse.error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse)) + return + } + + var responseObj: Response? = nil + + let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) + if decodeResult.error == nil { + responseObj = Response(response: httpResponse, body: decodeResult.decodableObj) + } + + completion(responseObj, decodeResult.error) + }) + } + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift new file mode 100644 index 00000000000..2d50e463ae1 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -0,0 +1,67 @@ +// +// CodableHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public typealias EncodeResult = (data: Data?, error: Error?) + +open class CodableHelper { + + open static var dateformatter: DateFormatter? + + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { + var returnedDecodable: T? = nil + var returnedError: Error? = nil + + let decoder = JSONDecoder() + if let df = self.dateformatter { + decoder.dateDecodingStrategy = .formatted(df) + } else { + decoder.dataDecodingStrategy = .base64 + let formatter = DateFormatter() + formatter.calendar = Calendar(identifier: .iso8601) + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX" + decoder.dateDecodingStrategy = .formatted(formatter) + } + + do { + returnedDecodable = try decoder.decode(type, from: data) + } catch { + returnedError = error + } + + return (returnedDecodable, returnedError) + } + + open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T : Encodable { + var returnedData: Data? + var returnedError: Error? = nil + + let encoder = JSONEncoder() + if prettyPrint { + encoder.outputFormatting = .prettyPrinted + } + encoder.dataEncodingStrategy = .base64 + let formatter = DateFormatter() + formatter.calendar = Calendar(identifier: .iso8601) + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX" + encoder.dateEncodingStrategy = .formatted(formatter) + + do { + returnedData = try encoder.encode(value) + } catch { + returnedError = error + } + + return (returnedData, returnedError) + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift new file mode 100644 index 00000000000..f8180752b67 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -0,0 +1,15 @@ +// Configuration.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class Configuration { + + // This value is used to configure the date formatter that is used to serialize dates into JSON format. + // You must set it prior to encoding any dates, and it will only be read once. + open static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift new file mode 100644 index 00000000000..abe218b4e7a --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -0,0 +1,173 @@ +// Extensions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +private func encodeIfPossible(_ object: T) -> Any { + if let encodableObject = object as? JSONEncodable { + return encodableObject.encodeToJSON() + } else { + return object as Any + } +} + +extension Array: JSONEncodable { + func encodeToJSON() -> Any { + return self.map(encodeIfPossible) + } +} + +extension Dictionary: JSONEncodable { + func encodeToJSON() -> Any { + var dictionary = [AnyHashable: Any]() + for (key, value) in self { + dictionary[key] = encodeIfPossible(value) + } + return dictionary as Any + } +} + +extension Data: JSONEncodable { + func encodeToJSON() -> Any { + return self.base64EncodedString(options: Data.Base64EncodingOptions()) + } +} + +private let dateFormatter: DateFormatter = { + let fmt = DateFormatter() + fmt.dateFormat = Configuration.dateFormat + fmt.locale = Locale(identifier: "en_US_POSIX") + return fmt +}() + +extension Date: JSONEncodable { + func encodeToJSON() -> Any { + return dateFormatter.string(from: self) as Any + } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { + return self.uuidString + } +} + +extension String: CodingKey { + + public var stringValue: String { + return self + } + + public init?(stringValue: String) { + self.init(stringLiteral: stringValue) + } + + public var intValue: Int? { + return nil + } + + public init?(intValue: Int) { + return nil + } + +} + +extension KeyedEncodingContainerProtocol { + + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + var arrayContainer = nestedUnkeyedContainer(forKey: key) + try arrayContainer.encode(contentsOf: values) + } + + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + if let values = values { + try encodeArray(values, forKey: key) + } + } + + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + for (key, value) in pairs { + try encode(value, forKey: key) + } + } + + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + if let pairs = pairs { + try encodeMap(pairs) + } + } + +} + +extension KeyedDecodingContainerProtocol { + + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + var tmpArray = [T]() + + var nestedContainer = try nestedUnkeyedContainer(forKey: key) + while !nestedContainer.isAtEnd { + let arrayValue = try nestedContainer.decode(T.self) + tmpArray.append(arrayValue) + } + + return tmpArray + } + + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil + + if contains(key) { + tmpArray = try decodeArray(T.self, forKey: key) + } + + return tmpArray + } + + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] + + for key in allKeys { + if !excludedKeys.contains(key) { + let value = try decode(T.self, forKey: key) + map[key] = value + } + } + + return map + } + +} + + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift new file mode 100644 index 00000000000..ca05906d420 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -0,0 +1,54 @@ +// +// JSONDataEncoding.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + +public struct JSONDataEncoding: ParameterEncoding { + + // MARK: Properties + + private static let jsonDataKey = "jsonData" + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. This should have a single key/value + /// pair with "jsonData" as the key and a Data object as the value. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { + return urlRequest + } + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = jsonData + + return urlRequest + } + + public static func encodingParameters(jsonData: Data?) -> Parameters? { + var returnedParams: Parameters? = nil + if let jsonData = jsonData, !jsonData.isEmpty { + var params = Parameters() + params[jsonDataKey] = jsonData + returnedParams = params + } + return returnedParams + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift new file mode 100644 index 00000000000..70449515842 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -0,0 +1,43 @@ +// +// JSONEncodingHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + +open class JSONEncodingHelper { + + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? = nil + + // Encode the Encodable object + if let encodableObj = encodableObj { + let encodeResult = CodableHelper.encode(encodableObj, prettyPrint: true) + if encodeResult.error == nil { + params = JSONDataEncoding.encodingParameters(jsonData: encodeResult.data) + } + } + + return params + } + + open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { + var params: Parameters? = nil + + if let encodableObj = encodableObj { + do { + let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) + params = JSONDataEncoding.encodingParameters(jsonData: data) + } catch { + print(error) + return nil + } + } + + return params + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift new file mode 100644 index 00000000000..42f8186ae4a --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -0,0 +1,36 @@ +// Models.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +protocol JSONEncodable { + func encodeToJSON() -> Any +} + +public enum ErrorResponse : Error { + case error(Int, Data?, Error) +} + +open class Response { + open let statusCode: Int + open let header: [String: String] + open let body: T? + + public init(statusCode: Int, header: [String: String], body: T?) { + self.statusCode = statusCode + self.header = header + self.body = body + } + + public convenience init(response: HTTPURLResponse, body: T?) { + let rawHeader = response.allHeaderFields + var header = [String:String]() + for case let (key, value) as (String, String) in rawHeader { + header[key] = value + } + self.init(statusCode: response.statusCode, header: header, body: body) + } +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift new file mode 100644 index 00000000000..4e018486ad7 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -0,0 +1,29 @@ +// +// AdditionalPropertiesClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct AdditionalPropertiesClass: Codable { + + public var mapProperty: [String:String]? + public var mapOfMapProperty: [String:[String:String]]? + + public init(mapProperty: [String:String]?, mapOfMapProperty: [String:[String:String]]?) { + self.mapProperty = mapProperty + self.mapOfMapProperty = mapOfMapProperty + } + + public enum CodingKeys: String, CodingKey { + case mapProperty = "map_property" + case mapOfMapProperty = "map_of_map_property" + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift new file mode 100644 index 00000000000..7221a1be099 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -0,0 +1,24 @@ +// +// Animal.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Animal: Codable { + + public var className: String + public var color: String? = "red" + + public init(className: String, color: String?) { + self.className = className + self.color = color + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift new file mode 100644 index 00000000000..e7bea63f8ed --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -0,0 +1,11 @@ +// +// AnimalFarm.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift new file mode 100644 index 00000000000..915c55a6d07 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -0,0 +1,31 @@ +// +// ApiResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ApiResponse: Codable { + + public var code: Int? + public var codeNum: NSNumber? { + get { + return code.map({ return NSNumber(value: $0) }) + } + } + public var type: String? + public var message: String? + + public init(code: Int?, type: String?, message: String?) { + self.code = code + self.type = type + self.message = message + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift new file mode 100644 index 00000000000..4e5a5ca1445 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -0,0 +1,26 @@ +// +// ArrayOfArrayOfNumberOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ArrayOfArrayOfNumberOnly: Codable { + + public var arrayArrayNumber: [[Double]]? + + public init(arrayArrayNumber: [[Double]]?) { + self.arrayArrayNumber = arrayArrayNumber + } + + public enum CodingKeys: String, CodingKey { + case arrayArrayNumber = "ArrayArrayNumber" + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift new file mode 100644 index 00000000000..7d059d36833 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -0,0 +1,26 @@ +// +// ArrayOfNumberOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ArrayOfNumberOnly: Codable { + + public var arrayNumber: [Double]? + + public init(arrayNumber: [Double]?) { + self.arrayNumber = arrayNumber + } + + public enum CodingKeys: String, CodingKey { + case arrayNumber = "ArrayNumber" + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift new file mode 100644 index 00000000000..9c56fed50c2 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -0,0 +1,32 @@ +// +// ArrayTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ArrayTest: Codable { + + public var arrayOfString: [String]? + public var arrayArrayOfInteger: [[Int64]]? + public var arrayArrayOfModel: [[ReadOnlyFirst]]? + + public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + self.arrayOfString = arrayOfString + self.arrayArrayOfInteger = arrayArrayOfInteger + self.arrayArrayOfModel = arrayArrayOfModel + } + + public enum CodingKeys: String, CodingKey { + case arrayOfString = "array_of_string" + case arrayArrayOfInteger = "array_array_of_integer" + case arrayArrayOfModel = "array_array_of_model" + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift new file mode 100644 index 00000000000..98cda23dac9 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -0,0 +1,42 @@ +// +// Capitalization.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Capitalization: Codable { + + public var smallCamel: String? + public var capitalCamel: String? + public var smallSnake: String? + public var capitalSnake: String? + public var sCAETHFlowPoints: String? + /** Name of the pet */ + public var ATT_NAME: String? + + public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + self.smallCamel = smallCamel + self.capitalCamel = capitalCamel + self.smallSnake = smallSnake + self.capitalSnake = capitalSnake + self.sCAETHFlowPoints = sCAETHFlowPoints + self.ATT_NAME = ATT_NAME + } + + public enum CodingKeys: String, CodingKey { + case smallCamel + case capitalCamel = "CapitalCamel" + case smallSnake = "small_Snake" + case capitalSnake = "Capital_Snake" + case sCAETHFlowPoints = "SCA_ETH_Flow_Points" + case ATT_NAME + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift new file mode 100644 index 00000000000..5675a053506 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -0,0 +1,31 @@ +// +// Cat.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Cat: Codable { + + public var className: String + public var color: String? = "red" + public var declawed: Bool? + public var declawedNum: NSNumber? { + get { + return declawed.map({ return NSNumber(value: $0) }) + } + } + + public init(className: String, color: String?, declawed: Bool?) { + self.className = className + self.color = color + self.declawed = declawed + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift new file mode 100644 index 00000000000..c27be481ecf --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -0,0 +1,34 @@ +// +// Category.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Category: Codable { + + public var _id: Int64? + public var _idNum: NSNumber? { + get { + return _id.map({ return NSNumber(value: $0) }) + } + } + public var name: String? + + public init(_id: Int64?, name: String?) { + self._id = _id + self.name = name + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case name + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift new file mode 100644 index 00000000000..f673ed127cd --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -0,0 +1,23 @@ +// +// ClassModel.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Model for testing model with \"_class\" property */ + +public struct ClassModel: Codable { + + public var _class: String? + + public init(_class: String?) { + self._class = _class + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift new file mode 100644 index 00000000000..51390b6c4ea --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -0,0 +1,22 @@ +// +// Client.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Client: Codable { + + public var client: String? + + public init(client: String?) { + self.client = client + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift new file mode 100644 index 00000000000..239ce74dcc2 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -0,0 +1,26 @@ +// +// Dog.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Dog: Codable { + + public var className: String + public var color: String? = "red" + public var breed: String? + + public init(className: String, color: String?, breed: String?) { + self.className = className + self.color = color + self.breed = breed + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift new file mode 100644 index 00000000000..8713961520e --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -0,0 +1,37 @@ +// +// EnumArrays.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct EnumArrays: Codable { + + public enum JustSymbol: String, Codable { + case greaterThanOrEqualTo = ">=" + case dollar = "$" + } + public enum ArrayEnum: String, Codable { + case fish = "fish" + case crab = "crab" + } + public var justSymbol: JustSymbol? + public var arrayEnum: [ArrayEnum]? + + public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + self.justSymbol = justSymbol + self.arrayEnum = arrayEnum + } + + public enum CodingKeys: String, CodingKey { + case justSymbol = "just_symbol" + case arrayEnum = "array_enum" + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift new file mode 100644 index 00000000000..7280a621fec --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -0,0 +1,15 @@ +// +// EnumClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +public enum EnumClass: String, Codable { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift new file mode 100644 index 00000000000..0f546c76a21 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -0,0 +1,56 @@ +// +// EnumTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct EnumTest: Codable { + + public enum EnumString: String, Codable { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } + public enum EnumStringRequired: String, Codable { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } + public enum EnumInteger: Int, Codable { + case _1 = 1 + case number1 = -1 + } + public enum EnumNumber: Double, Codable { + case _11 = 1.1 + case number12 = -1.2 + } + public var enumString: EnumString? + public var enumStringRequired: EnumStringRequired + public var enumInteger: EnumInteger? + public var enumNumber: EnumNumber? + public var outerEnum: OuterEnum? + + public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + self.enumString = enumString + self.enumStringRequired = enumStringRequired + self.enumInteger = enumInteger + self.enumNumber = enumNumber + self.outerEnum = outerEnum + } + + public enum CodingKeys: String, CodingKey { + case enumString = "enum_string" + case enumStringRequired = "enum_string_required" + case enumInteger = "enum_integer" + case enumNumber = "enum_number" + case outerEnum + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift new file mode 100644 index 00000000000..a365cc6d8ed --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -0,0 +1,76 @@ +// +// FormatTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct FormatTest: Codable { + + public var integer: Int? + public var integerNum: NSNumber? { + get { + return integer.map({ return NSNumber(value: $0) }) + } + } + public var int32: Int? + public var int32Num: NSNumber? { + get { + return int32.map({ return NSNumber(value: $0) }) + } + } + public var int64: Int64? + public var int64Num: NSNumber? { + get { + return int64.map({ return NSNumber(value: $0) }) + } + } + public var number: Double + public var numberNum: NSNumber? { + get { + return number.map({ return NSNumber(value: $0) }) + } + } + public var float: Float? + public var floatNum: NSNumber? { + get { + return float.map({ return NSNumber(value: $0) }) + } + } + public var double: Double? + public var doubleNum: NSNumber? { + get { + return double.map({ return NSNumber(value: $0) }) + } + } + public var string: String? + public var byte: Data + public var binary: URL? + public var date: Date + public var dateTime: Date? + public var uuid: UUID? + public var password: String + + public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + self.integer = integer + self.int32 = int32 + self.int64 = int64 + self.number = number + self.float = float + self.double = double + self.string = string + self.byte = byte + self.binary = binary + self.date = date + self.dateTime = dateTime + self.uuid = uuid + self.password = password + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift new file mode 100644 index 00000000000..554aee1081a --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -0,0 +1,24 @@ +// +// HasOnlyReadOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct HasOnlyReadOnly: Codable { + + public var bar: String? + public var foo: String? + + public init(bar: String?, foo: String?) { + self.bar = bar + self.foo = foo + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift new file mode 100644 index 00000000000..8997340ff4b --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -0,0 +1,26 @@ +// +// List.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct List: Codable { + + public var _123list: String? + + public init(_123list: String?) { + self._123list = _123list + } + + public enum CodingKeys: String, CodingKey { + case _123list = "123-list" + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift new file mode 100644 index 00000000000..dfbbee8428e --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -0,0 +1,33 @@ +// +// MapTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct MapTest: Codable { + + public enum MapOfEnumString: String, Codable { + case upper = "UPPER" + case lower = "lower" + } + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?) { + self.mapMapOfString = mapMapOfString + self.mapOfEnumString = mapOfEnumString + } + + public enum CodingKeys: String, CodingKey { + case mapMapOfString = "map_map_of_string" + case mapOfEnumString = "map_of_enum_string" + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift new file mode 100644 index 00000000000..7116108fd7a --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -0,0 +1,26 @@ +// +// MixedPropertiesAndAdditionalPropertiesClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + + public var uuid: UUID? + public var dateTime: Date? + public var map: [String:Animal]? + + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + self.uuid = uuid + self.dateTime = dateTime + self.map = map + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift new file mode 100644 index 00000000000..f1a89186d7a --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -0,0 +1,35 @@ +// +// Model200Response.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Model for testing model name starting with number */ + +public struct Model200Response: Codable { + + public var name: Int? + public var nameNum: NSNumber? { + get { + return name.map({ return NSNumber(value: $0) }) + } + } + public var _class: String? + + public init(name: Int?, _class: String?) { + self.name = name + self._class = _class + } + + public enum CodingKeys: String, CodingKey { + case name + case _class = "class" + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift new file mode 100644 index 00000000000..d22a908748d --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -0,0 +1,51 @@ +// +// Name.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Model for testing model name same as property name */ + +public struct Name: Codable { + + public var name: Int + public var nameNum: NSNumber? { + get { + return name.map({ return NSNumber(value: $0) }) + } + } + public var snakeCase: Int? + public var snakeCaseNum: NSNumber? { + get { + return snakeCase.map({ return NSNumber(value: $0) }) + } + } + public var property: String? + public var _123number: Int? + public var _123numberNum: NSNumber? { + get { + return _123number.map({ return NSNumber(value: $0) }) + } + } + + public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { + self.name = name + self.snakeCase = snakeCase + self.property = property + self._123number = _123number + } + + public enum CodingKeys: String, CodingKey { + case name + case snakeCase = "snake_case" + case property + case _123number = "123Number" + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift new file mode 100644 index 00000000000..f32f416f357 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -0,0 +1,31 @@ +// +// NumberOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct NumberOnly: Codable { + + public var justNumber: Double? + public var justNumberNum: NSNumber? { + get { + return justNumber.map({ return NSNumber(value: $0) }) + } + } + + public init(justNumber: Double?) { + self.justNumber = justNumber + } + + public enum CodingKeys: String, CodingKey { + case justNumber = "JustNumber" + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift new file mode 100644 index 00000000000..36c9c534d12 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -0,0 +1,67 @@ +// +// Order.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Order: Codable { + + public enum Status: String, Codable { + case placed = "placed" + case approved = "approved" + case delivered = "delivered" + } + public var _id: Int64? + public var _idNum: NSNumber? { + get { + return _id.map({ return NSNumber(value: $0) }) + } + } + public var petId: Int64? + public var petIdNum: NSNumber? { + get { + return petId.map({ return NSNumber(value: $0) }) + } + } + public var quantity: Int? + public var quantityNum: NSNumber? { + get { + return quantity.map({ return NSNumber(value: $0) }) + } + } + public var shipDate: Date? + /** Order Status */ + public var status: Status? + public var complete: Bool? = false + public var completeNum: NSNumber? { + get { + return complete.map({ return NSNumber(value: $0) }) + } + } + + public init(_id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + self._id = _id + self.petId = petId + self.quantity = quantity + self.shipDate = shipDate + self.status = status + self.complete = complete + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case petId + case quantity + case shipDate + case status + case complete + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift new file mode 100644 index 00000000000..edc4523d9f0 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -0,0 +1,32 @@ +// +// OuterComposite.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct OuterComposite: Codable { + + public var myNumber: Double? + public var myString: String? + public var myBoolean: Bool? + + public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { + self.myNumber = myNumber + self.myString = myString + self.myBoolean = myBoolean + } + + public enum CodingKeys: String, CodingKey { + case myNumber = "my_number" + case myString = "my_string" + case myBoolean = "my_boolean" + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift new file mode 100644 index 00000000000..bd1643d279e --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -0,0 +1,15 @@ +// +// OuterEnum.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +public enum OuterEnum: String, Codable { + case placed = "placed" + case approved = "approved" + case delivered = "delivered" +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift new file mode 100644 index 00000000000..25ead1f5cba --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -0,0 +1,52 @@ +// +// Pet.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Pet: Codable { + + public enum Status: String, Codable { + case available = "available" + case pending = "pending" + case sold = "sold" + } + public var _id: Int64? + public var _idNum: NSNumber? { + get { + return _id.map({ return NSNumber(value: $0) }) + } + } + public var category: Category? + public var name: String + public var photoUrls: [String] + public var tags: [Tag]? + /** pet status in the store */ + public var status: Status? + + public init(_id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + self._id = _id + self.category = category + self.name = name + self.photoUrls = photoUrls + self.tags = tags + self.status = status + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case category + case name + case photoUrls + case tags + case status + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift new file mode 100644 index 00000000000..48b655a5b0a --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -0,0 +1,24 @@ +// +// ReadOnlyFirst.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ReadOnlyFirst: Codable { + + public var bar: String? + public var baz: String? + + public init(bar: String?, baz: String?) { + self.bar = bar + self.baz = baz + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift new file mode 100644 index 00000000000..b2f32673924 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -0,0 +1,32 @@ +// +// Return.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Model for testing reserved words */ + +public struct Return: Codable { + + public var _return: Int? + public var _returnNum: NSNumber? { + get { + return _return.map({ return NSNumber(value: $0) }) + } + } + + public init(_return: Int?) { + self._return = _return + } + + public enum CodingKeys: String, CodingKey { + case _return = "return" + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift new file mode 100644 index 00000000000..b2f34b3ac52 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -0,0 +1,31 @@ +// +// SpecialModelName.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct SpecialModelName: Codable { + + public var specialPropertyName: Int64? + public var specialPropertyNameNum: NSNumber? { + get { + return specialPropertyName.map({ return NSNumber(value: $0) }) + } + } + + public init(specialPropertyName: Int64?) { + self.specialPropertyName = specialPropertyName + } + + public enum CodingKeys: String, CodingKey { + case specialPropertyName = "$special[property.name]" + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift new file mode 100644 index 00000000000..d9ffc0d941a --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -0,0 +1,34 @@ +// +// Tag.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Tag: Codable { + + public var _id: Int64? + public var _idNum: NSNumber? { + get { + return _id.map({ return NSNumber(value: $0) }) + } + } + public var name: String? + + public init(_id: Int64?, name: String?) { + self._id = _id + self.name = name + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case name + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift new file mode 100644 index 00000000000..205134a2d55 --- /dev/null +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -0,0 +1,58 @@ +// +// User.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct User: Codable { + + public var _id: Int64? + public var _idNum: NSNumber? { + get { + return _id.map({ return NSNumber(value: $0) }) + } + } + public var username: String? + public var firstName: String? + public var lastName: String? + public var email: String? + public var password: String? + public var phone: String? + /** User Status */ + public var userStatus: Int? + public var userStatusNum: NSNumber? { + get { + return userStatus.map({ return NSNumber(value: $0) }) + } + } + + public init(_id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + self._id = _id + self.username = username + self.firstName = firstName + self.lastName = lastName + self.email = email + self.password = password + self.phone = phone + self.userStatus = userStatus + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case username + case firstName + case lastName + case email + case password + case phone + case userStatus + } + + +} + diff --git a/samples/client/petstore/swift4/objcCompatible/git_push.sh b/samples/client/petstore/swift4/objcCompatible/git_push.sh index ae01b182ae9..8442b80bb44 100644 --- a/samples/client/petstore/swift4/objcCompatible/git_push.sh +++ b/samples/client/petstore/swift4/objcCompatible/git_push.sh @@ -1,7 +1,7 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 diff --git a/samples/client/petstore/swift4/promisekit/.openapi-generator/VERSION b/samples/client/petstore/swift4/promisekit/.openapi-generator/VERSION index 855ff9501eb..ad121e8340e 100644 --- a/samples/client/petstore/swift4/promisekit/.openapi-generator/VERSION +++ b/samples/client/petstore/swift4/promisekit/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient.podspec b/samples/client/petstore/swift4/promisekit/PetstoreClient.podspec index 933aeb7d783..34ca76681f8 100644 --- a/samples/client/petstore/swift4/promisekit/PetstoreClient.podspec +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient.podspec @@ -4,10 +4,10 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.11' s.tvos.deployment_target = '9.0' s.version = '0.0.1' - s.source = { :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' } + s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } s.authors = '' s.license = 'Proprietary' - s.homepage = 'https://github.com/swagger-api/swagger-codegen' + s.homepage = 'https://github.com/openapitools/openapi-generator' s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' s.dependency 'PromiseKit/CorePromise', '~> 4.4.0' diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift new file mode 100644 index 00000000000..3c7b53f8149 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -0,0 +1,65 @@ +// APIHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct APIHelper { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + let destination = source.reduce(into: [String: Any]()) { (result, item) in + if let value = item.value { + result[item.key] = value + } + } + + if destination.isEmpty { + return nil + } + return destination + } + + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + return source.reduce(into: [String: String]()) { (result, item) in + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + } else if let value: Any = item.value { + result[item.key] = "\(value)" + } + } + } + + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + guard let source = source else { + return nil + } + + return source.reduce(into: [String: Any](), { (result, item) in + switch item.value { + case let x as Bool: + result[item.key] = x.description + default: + result[item.key] = item.value + } + }) + } + + + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in + if let collection = item.value as? Array { + let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") + result.append(URLQueryItem(name: item.key, value: value)) + } else if let value = item.value { + result.append(URLQueryItem(name: item.key, value: "\(value)")) + } + } + + if destination.isEmpty { + return nil + } + return destination + } +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift new file mode 100644 index 00000000000..8cae3aacfe5 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -0,0 +1,61 @@ +// APIs.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class PetstoreClientAPI { + open static var basePath = "http://petstore.swagger.io:80/v2" + open static var credential: URLCredential? + open static var customHeaders: [String:String] = [:] + open static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() +} + +open class RequestBuilder { + var credential: URLCredential? + var headers: [String:String] + public let parameters: [String:Any]? + public let isBody: Bool + public let method: String + public let URLString: String + + /// Optional block to obtain a reference to the request's progress instance when available. + public var onProgressReady: ((Progress) -> ())? + + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + self.method = method + self.URLString = URLString + self.parameters = parameters + self.isBody = isBody + self.headers = headers + + addHeaders(PetstoreClientAPI.customHeaders) + } + + open func addHeaders(_ aHeaders:[String:String]) { + for (header, value) in aHeaders { + headers[header] = value + } + } + + open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { } + + public func addHeader(name: String, value: String) -> Self { + if !value.isEmpty { + headers[name] = value + } + return self + } + + open func addCredential() -> Self { + self.credential = PetstoreClientAPI.credential + return self + } +} + +public protocol RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type +} diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift new file mode 100644 index 00000000000..3a1ec7b161b --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -0,0 +1,64 @@ +// +// AnotherFakeAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import PromiseKit + + + +open class AnotherFakeAPI { + /** + To test special tags + + - parameter client: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + To test special tags + + - parameter client: (body) client model + - returns: Promise + */ + open class func testSpecialTags( client: Client) -> Promise { + let deferred = Promise.pending() + testSpecialTags(client: client) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + To test special tags + - PATCH /another-fake/dummy + - To test special tags + - parameter client: (body) client model + - returns: RequestBuilder + */ + open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { + let path = "/another-fake/dummy" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: client) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift new file mode 100644 index 00000000000..f98db8cfd2b --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -0,0 +1,687 @@ +// +// FakeAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import PromiseKit + + + +open class FakeAPI { + /** + + - parameter body: (body) Input boolean as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { + fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + + - parameter body: (body) Input boolean as post body (optional) + - returns: Promise + */ + open class func fakeOuterBooleanSerialize( body: Bool? = nil) -> Promise { + let deferred = Promise.pending() + fakeOuterBooleanSerialize(body: body) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + - POST /fake/outer/boolean + - Test serialization of outer boolean types + - parameter body: (body) Input boolean as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { + let path = "/fake/outer/boolean" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter outerComposite: (body) Input composite as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + + - parameter outerComposite: (body) Input composite as post body (optional) + - returns: Promise + */ + open class func fakeOuterCompositeSerialize( outerComposite: OuterComposite? = nil) -> Promise { + let deferred = Promise.pending() + fakeOuterCompositeSerialize(outerComposite: outerComposite) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + - POST /fake/outer/composite + - Test serialization of object with outer number type + - parameter outerComposite: (body) Input composite as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { + let path = "/fake/outer/composite" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: outerComposite) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter body: (body) Input number as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { + fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + + - parameter body: (body) Input number as post body (optional) + - returns: Promise + */ + open class func fakeOuterNumberSerialize( body: Double? = nil) -> Promise { + let deferred = Promise.pending() + fakeOuterNumberSerialize(body: body) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + - POST /fake/outer/number + - Test serialization of outer number types + - parameter body: (body) Input number as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { + let path = "/fake/outer/number" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter body: (body) Input string as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + + - parameter body: (body) Input string as post body (optional) + - returns: Promise + */ + open class func fakeOuterStringSerialize( body: String? = nil) -> Promise { + let deferred = Promise.pending() + fakeOuterStringSerialize(body: body) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + - POST /fake/outer/string + - Test serialization of outer string types + - parameter body: (body) Input string as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { + let path = "/fake/outer/string" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter query: (query) + - parameter user: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithQueryParams(query: String, user: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + + - parameter query: (query) + - parameter user: (body) + - returns: Promise + */ + open class func testBodyWithQueryParams( query: String, user: User) -> Promise { + let deferred = Promise.pending() + testBodyWithQueryParams(query: query, user: user) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + - PUT /fake/body-with-query-params + - parameter query: (query) + - parameter user: (body) + - returns: RequestBuilder + */ + open class func testBodyWithQueryParamsWithRequestBuilder(query: String, user: User) -> RequestBuilder { + let path = "/fake/body-with-query-params" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "query": query + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + To test \"client\" model + + - parameter client: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + To test \"client\" model + + - parameter client: (body) client model + - returns: Promise + */ + open class func testClientModel( client: Client) -> Promise { + let deferred = Promise.pending() + testClientModel(client: client) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + To test \"client\" model + - PATCH /fake + - To test \"client\" model + - parameter client: (body) client model + - returns: RequestBuilder + */ + open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: client) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + - parameter number: (form) None + - parameter double: (form) None + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter float: (form) None (optional) + - parameter string: (form) None (optional) + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + - parameter number: (form) None + - parameter double: (form) None + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter float: (form) None (optional) + - parameter string: (form) None (optional) + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + - returns: Promise + */ + open class func testEndpointParameters( number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Promise { + let deferred = Promise.pending() + testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - POST /fake + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - BASIC: + - type: http + - name: http_basic_test + - parameter number: (form) None + - parameter double: (form) None + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter float: (form) None (optional) + - parameter string: (form) None (optional) + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + - returns: RequestBuilder + */ + open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "integer": integer?.encodeToJSON(), + "int32": int32?.encodeToJSON(), + "int64": int64?.encodeToJSON(), + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date?.encodeToJSON(), + "dateTime": dateTime?.encodeToJSON(), + "password": password, + "callback": callback + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + * enum for parameter enumHeaderStringArray + */ + public enum EnumHeaderStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumHeaderString + */ + public enum EnumHeaderString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + * enum for parameter enumQueryStringArray + */ + public enum EnumQueryStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumQueryString + */ + public enum EnumQueryString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + * enum for parameter enumQueryInteger + */ + public enum EnumQueryInteger_testEnumParameters: Int { + case _1 = 1 + case number2 = -2 + } + + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + + /** + * enum for parameter enumFormStringArray + */ + public enum EnumFormStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumFormString + */ + public enum EnumFormString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + To test enum parameters + + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to "$") + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to "-efg") + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + To test enum parameters + + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to "$") + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to "-efg") + - returns: Promise + */ + open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Promise { + let deferred = Promise.pending() + testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + To test enum parameters + - GET /fake + - To test enum parameters + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to "$") + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to "-efg") + - returns: RequestBuilder + */ + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString?.rawValue + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "enum_query_string_array": enumQueryStringArray, + "enum_query_string": enumQueryString?.rawValue, + "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue + ]) + let nillableHeaders: [String: Any?] = [ + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString?.rawValue + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + test inline additionalProperties + + - parameter requestBody: (body) request body + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testInlineAdditionalProperties(requestBody: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(requestBody: requestBody).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + test inline additionalProperties + + - parameter requestBody: (body) request body + - returns: Promise + */ + open class func testInlineAdditionalProperties( requestBody: [String:String]) -> Promise { + let deferred = Promise.pending() + testInlineAdditionalProperties(requestBody: requestBody) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + test inline additionalProperties + - POST /fake/inline-additionalProperties + - parameter requestBody: (body) request body + - returns: RequestBuilder + */ + open class func testInlineAdditionalPropertiesWithRequestBuilder(requestBody: [String:String]) -> RequestBuilder { + let path = "/fake/inline-additionalProperties" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: requestBody) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + test json serialization of form data + + - parameter param: (form) field1 + - parameter param2: (form) field2 + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + test json serialization of form data + + - parameter param: (form) field1 + - parameter param2: (form) field2 + - returns: Promise + */ + open class func testJsonFormData( param: String, param2: String) -> Promise { + let deferred = Promise.pending() + testJsonFormData(param: param, param2: param2) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + test json serialization of form data + - GET /fake/jsonFormData + - parameter param: (form) field1 + - parameter param2: (form) field2 + - returns: RequestBuilder + */ + open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { + let path = "/fake/jsonFormData" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "param": param, + "param2": param2 + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + +} diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift new file mode 100644 index 00000000000..634207774bf --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -0,0 +1,67 @@ +// +// FakeClassnameTags123API.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import PromiseKit + + + +open class FakeClassnameTags123API { + /** + To test class name in snake case + + - parameter client: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testClassname(client: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + To test class name in snake case + + - parameter client: (body) client model + - returns: Promise + */ + open class func testClassname( client: Client) -> Promise { + let deferred = Promise.pending() + testClassname(client: client) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + To test class name in snake case + - PATCH /fake_classname_test + - To test class name in snake case + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query + - parameter client: (body) client model + - returns: RequestBuilder + */ + open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { + let path = "/fake_classname_test" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: client) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift new file mode 100644 index 00000000000..6cab307e02b --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -0,0 +1,500 @@ +// +// PetAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import PromiseKit + + + +open class PetAPI { + /** + Add a new pet to the store + + - parameter pet: (body) Pet object that needs to be added to the store + - parameter completion: completion handler to receive the data and the error objects + */ + open class func addPet(pet: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Add a new pet to the store + + - parameter pet: (body) Pet object that needs to be added to the store + - returns: Promise + */ + open class func addPet( pet: Pet) -> Promise { + let deferred = Promise.pending() + addPet(pet: pet) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Add a new pet to the store + - POST /pet + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter pet: (body) Pet object that needs to be added to the store + - returns: RequestBuilder + */ + open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { + let path = "/pet" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: pet) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Deletes a pet + + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Deletes a pet + + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + - returns: Promise + */ + open class func deletePet( petId: Int64, apiKey: String? = nil) -> Promise { + let deferred = Promise.pending() + deletePet(petId: petId, apiKey: apiKey) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Deletes a pet + - DELETE /pet/{petId} + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + - returns: RequestBuilder + */ + open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + let nillableHeaders: [String: Any?] = [ + "api_key": apiKey + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + * enum for parameter status + */ + public enum Status_findPetsByStatus: String { + case available = "available" + case pending = "pending" + case sold = "sold" + } + + /** + Finds Pets by status + + - parameter status: (query) Status values that need to be considered for filter + - parameter completion: completion handler to receive the data and the error objects + */ + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Finds Pets by status + + - parameter status: (query) Status values that need to be considered for filter + - returns: Promise<[Pet]> + */ + open class func findPetsByStatus( status: [String]) -> Promise<[Pet]> { + let deferred = Promise<[Pet]>.pending() + findPetsByStatus(status: status) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Finds Pets by status + - GET /pet/findByStatus + - Multiple status values can be provided with comma separated strings + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter status: (query) Status values that need to be considered for filter + - returns: RequestBuilder<[Pet]> + */ + open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + let path = "/pet/findByStatus" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "status": status + ]) + + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Finds Pets by tags + + - parameter tags: (query) Tags to filter by + - parameter completion: completion handler to receive the data and the error objects + */ + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Finds Pets by tags + + - parameter tags: (query) Tags to filter by + - returns: Promise<[Pet]> + */ + open class func findPetsByTags( tags: [String]) -> Promise<[Pet]> { + let deferred = Promise<[Pet]>.pending() + findPetsByTags(tags: tags) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Finds Pets by tags + - GET /pet/findByTags + - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter tags: (query) Tags to filter by + - returns: RequestBuilder<[Pet]> + */ + open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { + let path = "/pet/findByTags" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "tags": tags + ]) + + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Find pet by ID + + - parameter petId: (path) ID of pet to return + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { + getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Find pet by ID + + - parameter petId: (path) ID of pet to return + - returns: Promise + */ + open class func getPetById( petId: Int64) -> Promise { + let deferred = Promise.pending() + getPetById(petId: petId) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Find pet by ID + - GET /pet/{petId} + - Returns a single pet + - API Key: + - type: apiKey api_key + - name: api_key + - parameter petId: (path) ID of pet to return + - returns: RequestBuilder + */ + open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Update an existing pet + + - parameter pet: (body) Pet object that needs to be added to the store + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updatePet(pet: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Update an existing pet + + - parameter pet: (body) Pet object that needs to be added to the store + - returns: Promise + */ + open class func updatePet( pet: Pet) -> Promise { + let deferred = Promise.pending() + updatePet(pet: pet) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Update an existing pet + - PUT /pet + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter pet: (body) Pet object that needs to be added to the store + - returns: RequestBuilder + */ + open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { + let path = "/pet" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: pet) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Updates a pet in the store with form data + + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Updates a pet in the store with form data + + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - returns: Promise + */ + open class func updatePetWithForm( petId: Int64, name: String? = nil, status: String? = nil) -> Promise { + let deferred = Promise.pending() + updatePetWithForm(petId: petId, name: name, status: status) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Updates a pet in the store with form data + - POST /pet/{petId} + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - returns: RequestBuilder + */ + open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "name": name, + "status": status + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + uploads an image + + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + uploads an image + + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - returns: Promise + */ + open class func uploadFile( petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> Promise { + let deferred = Promise.pending() + uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + uploads an image + - POST /pet/{petId}/uploadImage + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { + var path = "/pet/{petId}/uploadImage" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "additionalMetadata": additionalMetadata, + "file": file + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + +} diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift new file mode 100644 index 00000000000..ac1d6c2a775 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -0,0 +1,220 @@ +// +// StoreAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import PromiseKit + + + +open class StoreAPI { + /** + Delete purchase order by ID + + - parameter orderId: (path) ID of the order that needs to be deleted + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Delete purchase order by ID + + - parameter orderId: (path) ID of the order that needs to be deleted + - returns: Promise + */ + open class func deleteOrder( orderId: String) -> Promise { + let deferred = Promise.pending() + deleteOrder(orderId: orderId) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Delete purchase order by ID + - DELETE /store/order/{order_id} + - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + - parameter orderId: (path) ID of the order that needs to be deleted + - returns: RequestBuilder + */ + open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { + var path = "/store/order/{order_id}" + let orderIdPreEscape = "\(orderId)" + let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Returns pet inventories by status + + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { + getInventoryWithRequestBuilder().execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Returns pet inventories by status + + - returns: Promise<[String:Int]> + */ + open class func getInventory() -> Promise<[String:Int]> { + let deferred = Promise<[String:Int]>.pending() + getInventory() { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Returns pet inventories by status + - GET /store/inventory + - Returns a map of status codes to quantities + - API Key: + - type: apiKey api_key + - name: api_key + - returns: RequestBuilder<[String:Int]> + */ + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + let path = "/store/inventory" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Find purchase order by ID + + - parameter orderId: (path) ID of pet that needs to be fetched + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Find purchase order by ID + + - parameter orderId: (path) ID of pet that needs to be fetched + - returns: Promise + */ + open class func getOrderById( orderId: Int64) -> Promise { + let deferred = Promise.pending() + getOrderById(orderId: orderId) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Find purchase order by ID + - GET /store/order/{order_id} + - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + - parameter orderId: (path) ID of pet that needs to be fetched + - returns: RequestBuilder + */ + open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { + var path = "/store/order/{order_id}" + let orderIdPreEscape = "\(orderId)" + let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Place an order for a pet + + - parameter order: (body) order placed for purchasing the pet + - parameter completion: completion handler to receive the data and the error objects + */ + open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Place an order for a pet + + - parameter order: (body) order placed for purchasing the pet + - returns: Promise + */ + open class func placeOrder( order: Order) -> Promise { + let deferred = Promise.pending() + placeOrder(order: order) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Place an order for a pet + - POST /store/order + - parameter order: (body) order placed for purchasing the pet + - returns: RequestBuilder + */ + open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { + let path = "/store/order" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: order) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift new file mode 100644 index 00000000000..e5840ba7091 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -0,0 +1,443 @@ +// +// UserAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import PromiseKit + + + +open class UserAPI { + /** + Create user + + - parameter user: (body) Created user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUser(user: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Create user + + - parameter user: (body) Created user object + - returns: Promise + */ + open class func createUser( user: User) -> Promise { + let deferred = Promise.pending() + createUser(user: user) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Create user + - POST /user + - This can only be done by the logged in user. + - parameter user: (body) Created user object + - returns: RequestBuilder + */ + open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { + let path = "/user" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - returns: Promise + */ + open class func createUsersWithArrayInput( user: [User]) -> Promise { + let deferred = Promise.pending() + createUsersWithArrayInput(user: user) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Creates list of users with given input array + - POST /user/createWithArray + - parameter user: (body) List of user object + - returns: RequestBuilder + */ + open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { + let path = "/user/createWithArray" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUsersWithListInput(user: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - returns: Promise + */ + open class func createUsersWithListInput( user: [User]) -> Promise { + let deferred = Promise.pending() + createUsersWithListInput(user: user) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Creates list of users with given input array + - POST /user/createWithList + - parameter user: (body) List of user object + - returns: RequestBuilder + */ + open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { + let path = "/user/createWithList" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Delete user + + - parameter username: (path) The name that needs to be deleted + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Delete user + + - parameter username: (path) The name that needs to be deleted + - returns: Promise + */ + open class func deleteUser( username: String) -> Promise { + let deferred = Promise.pending() + deleteUser(username: username) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Delete user + - DELETE /user/{username} + - This can only be done by the logged in user. + - parameter username: (path) The name that needs to be deleted + - returns: RequestBuilder + */ + open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(username)" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Get user by user name + + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { + getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Get user by user name + + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - returns: Promise + */ + open class func getUserByName( username: String) -> Promise { + let deferred = Promise.pending() + getUserByName(username: username) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Get user by user name + - GET /user/{username} + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - returns: RequestBuilder + */ + open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(username)" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Logs user into the system + + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - parameter completion: completion handler to receive the data and the error objects + */ + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Logs user into the system + + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - returns: Promise + */ + open class func loginUser( username: String, password: String) -> Promise { + let deferred = Promise.pending() + loginUser(username: username, password: password) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Logs user into the system + - GET /user/login + - responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)] + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - returns: RequestBuilder + */ + open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { + let path = "/user/login" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "username": username, + "password": password + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Logs out current logged in user session + + - parameter completion: completion handler to receive the data and the error objects + */ + open class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Logs out current logged in user session + + - returns: Promise + */ + open class func logoutUser() -> Promise { + let deferred = Promise.pending() + logoutUser() { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Logs out current logged in user session + - GET /user/logout + - returns: RequestBuilder + */ + open class func logoutUserWithRequestBuilder() -> RequestBuilder { + let path = "/user/logout" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Updated user + + - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updateUser(username: String, user: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Updated user + + - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object + - returns: Promise + */ + open class func updateUser( username: String, user: User) -> Promise { + let deferred = Promise.pending() + updateUser(username: username, user: user) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + Updated user + - PUT /user/{username} + - This can only be done by the logged in user. + - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object + - returns: RequestBuilder + */ + open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(username)" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift new file mode 100644 index 00000000000..280b4e53389 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -0,0 +1,413 @@ +// AlamofireImplementations.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + +class AlamofireRequestBuilderFactory: RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type { + return AlamofireRequestBuilder.self + } + + func getBuilder() -> RequestBuilder.Type { + return AlamofireDecodableRequestBuilder.self + } +} + +// Store manager to retain its reference +private var managerStore: [String: Alamofire.SessionManager] = [:] + +open class AlamofireRequestBuilder: RequestBuilder { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) + } + + /** + May be overridden by a subclass if you want to control the session + configuration. + */ + open func createSessionManager() -> Alamofire.SessionManager { + let configuration = URLSessionConfiguration.default + configuration.httpAdditionalHeaders = buildHeaders() + return Alamofire.SessionManager(configuration: configuration) + } + + /** + May be overridden by a subclass if you want to control the Content-Type + that is given to an uploaded form part. + + Return nil to use the default behavior (inferring the Content-Type from + the file extension). Return the desired Content-Type otherwise. + */ + open func contentTypeForFormPart(fileURL: URL) -> String? { + return nil + } + + /** + May be overridden by a subclass if you want to control the request + configuration (e.g. to override the cache policy). + */ + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { + return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) + } + + override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + let managerId:String = UUID().uuidString + // Create a new manager for each request to customize its request header + let manager = createSessionManager() + managerStore[managerId] = manager + + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + + let xMethod = Alamofire.HTTPMethod(rawValue: method) + let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } + .map { $0.0 } + + if fileKeys.count > 0 { + manager.upload(multipartFormData: { mpForm in + for (k, v) in self.parameters! { + switch v { + case let fileURL as URL: + if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { + mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) + } + else { + mpForm.append(fileURL, withName: k) + } + case let string as String: + mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) + case let number as NSNumber: + mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) + default: + fatalError("Unprocessable value \(v) with key \(k)") + } + } + }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in + switch encodingResult { + case .success(let upload, _, _): + if let onProgressReady = self.onProgressReady { + onProgressReady(upload.uploadProgress) + } + self.processRequest(request: upload, managerId, completion) + case .failure(let encodingError): + completion(nil, ErrorResponse.error(415, nil, encodingError)) + } + }) + } else { + let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) + if let onProgressReady = self.onProgressReady { + onProgressReady(request.progress) + } + processRequest(request: request, managerId, completion) + } + + } + + fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + if let credential = self.credential { + request.authenticate(usingCredential: credential) + } + + let cleanupRequest = { + _ = managerStore.removeValue(forKey: managerId) + } + + let validatedRequest = request.validate() + + switch T.self { + case is String.Type: + validatedRequest.responseString(completionHandler: { (stringResponse) in + cleanupRequest() + + if stringResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!) + ) + return + } + + completion( + Response( + response: stringResponse.response!, + body: ((stringResponse.result.value ?? "") as! T) + ), + nil + ) + }) + case is URL.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + do { + + guard !dataResponse.result.isFailure else { + throw DownloadException.responseFailed + } + + guard let data = dataResponse.data else { + throw DownloadException.responseDataMissing + } + + guard let request = request.request else { + throw DownloadException.requestMissing + } + + let fileManager = FileManager.default + let urlRequest = try request.asURLRequest() + let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] + let requestURL = try self.getURL(from: urlRequest) + + var requestPath = try self.getPath(from: requestURL) + + if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { + requestPath = requestPath.appending("/\(headerFileName)") + } + + let filePath = documentsDirectory.appendingPathComponent(requestPath) + let directoryPath = filePath.deletingLastPathComponent().path + + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) + try data.write(to: filePath, options: .atomic) + + completion( + Response( + response: dataResponse.response!, + body: (filePath as! T) + ), + nil + ) + + } catch let requestParserError as DownloadException { + completion(nil, ErrorResponse.error(400, dataResponse.data, requestParserError)) + } catch let error { + completion(nil, ErrorResponse.error(400, dataResponse.data, error)) + } + return + }) + case is Void.Type: + validatedRequest.responseData(completionHandler: { (voidResponse) in + cleanupRequest() + + if voidResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) + ) + return + } + + completion( + Response( + response: voidResponse.response!, + body: nil), + nil + ) + }) + default: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + if dataResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) + ) + return + } + + completion( + Response( + response: dataResponse.response!, + body: (dataResponse.data as! T) + ), + nil + ) + }) + } + } + + open func buildHeaders() -> [String: String] { + var httpHeaders = SessionManager.defaultHTTPHeaders + for (key, value) in self.headers { + httpHeaders[key] = value + } + return httpHeaders + } + + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + + guard let contentDisposition = contentDisposition else { + return nil + } + + let items = contentDisposition.components(separatedBy: ";") + + var filename : String? = nil + + for contentItem in items { + + let filenameKey = "filename=" + guard let range = contentItem.range(of: filenameKey) else { + break + } + + filename = contentItem + return filename? + .replacingCharacters(in: range, with:"") + .replacingOccurrences(of: "\"", with: "") + .trimmingCharacters(in: .whitespacesAndNewlines) + } + + return filename + + } + + fileprivate func getPath(from url : URL) throws -> String { + + guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { + throw DownloadException.requestMissingPath + } + + if path.hasPrefix("/") { + path.remove(at: path.startIndex) + } + + return path + + } + + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + return url + } + +} + +fileprivate enum DownloadException : Error { + case responseDataMissing + case responseFailed + case requestMissing + case requestMissingPath + case requestMissingURL +} + +public enum AlamofireDecodableRequestBuilderError: Error { + case emptyDataResponse + case nilHTTPResponse + case jsonDecoding(DecodingError) + case generalError(Error) +} + +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { + + override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + if let credential = self.credential { + request.authenticate(usingCredential: credential) + } + + let cleanupRequest = { + _ = managerStore.removeValue(forKey: managerId) + } + + let validatedRequest = request.validate() + + switch T.self { + case is String.Type: + validatedRequest.responseString(completionHandler: { (stringResponse) in + cleanupRequest() + + if stringResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!) + ) + return + } + + completion( + Response( + response: stringResponse.response!, + body: ((stringResponse.result.value ?? "") as! T) + ), + nil + ) + }) + case is Void.Type: + validatedRequest.responseData(completionHandler: { (voidResponse) in + cleanupRequest() + + if voidResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) + ) + return + } + + completion( + Response( + response: voidResponse.response!, + body: nil), + nil + ) + }) + case is Data.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + if dataResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) + ) + return + } + + completion( + Response( + response: dataResponse.response!, + body: (dataResponse.data as! T) + ), + nil + ) + }) + default: + validatedRequest.responseData(completionHandler: { (dataResponse: DataResponse) in + cleanupRequest() + + guard dataResponse.result.isSuccess else { + completion(nil, ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)) + return + } + + guard let data = dataResponse.data, !data.isEmpty else { + completion(nil, ErrorResponse.error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse)) + return + } + + guard let httpResponse = dataResponse.response else { + completion(nil, ErrorResponse.error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse)) + return + } + + var responseObj: Response? = nil + + let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) + if decodeResult.error == nil { + responseObj = Response(response: httpResponse, body: decodeResult.decodableObj) + } + + completion(responseObj, decodeResult.error) + }) + } + } + +} diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift new file mode 100644 index 00000000000..2d50e463ae1 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -0,0 +1,67 @@ +// +// CodableHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public typealias EncodeResult = (data: Data?, error: Error?) + +open class CodableHelper { + + open static var dateformatter: DateFormatter? + + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { + var returnedDecodable: T? = nil + var returnedError: Error? = nil + + let decoder = JSONDecoder() + if let df = self.dateformatter { + decoder.dateDecodingStrategy = .formatted(df) + } else { + decoder.dataDecodingStrategy = .base64 + let formatter = DateFormatter() + formatter.calendar = Calendar(identifier: .iso8601) + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX" + decoder.dateDecodingStrategy = .formatted(formatter) + } + + do { + returnedDecodable = try decoder.decode(type, from: data) + } catch { + returnedError = error + } + + return (returnedDecodable, returnedError) + } + + open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T : Encodable { + var returnedData: Data? + var returnedError: Error? = nil + + let encoder = JSONEncoder() + if prettyPrint { + encoder.outputFormatting = .prettyPrinted + } + encoder.dataEncodingStrategy = .base64 + let formatter = DateFormatter() + formatter.calendar = Calendar(identifier: .iso8601) + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX" + encoder.dateEncodingStrategy = .formatted(formatter) + + do { + returnedData = try encoder.encode(value) + } catch { + returnedError = error + } + + return (returnedData, returnedError) + } + +} diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift new file mode 100644 index 00000000000..f8180752b67 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -0,0 +1,15 @@ +// Configuration.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class Configuration { + + // This value is used to configure the date formatter that is used to serialize dates into JSON format. + // You must set it prior to encoding any dates, and it will only be read once. + open static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift new file mode 100644 index 00000000000..eb03b10eb47 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -0,0 +1,186 @@ +// Extensions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import PromiseKit + +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +private func encodeIfPossible(_ object: T) -> Any { + if let encodableObject = object as? JSONEncodable { + return encodableObject.encodeToJSON() + } else { + return object as Any + } +} + +extension Array: JSONEncodable { + func encodeToJSON() -> Any { + return self.map(encodeIfPossible) + } +} + +extension Dictionary: JSONEncodable { + func encodeToJSON() -> Any { + var dictionary = [AnyHashable: Any]() + for (key, value) in self { + dictionary[key] = encodeIfPossible(value) + } + return dictionary as Any + } +} + +extension Data: JSONEncodable { + func encodeToJSON() -> Any { + return self.base64EncodedString(options: Data.Base64EncodingOptions()) + } +} + +private let dateFormatter: DateFormatter = { + let fmt = DateFormatter() + fmt.dateFormat = Configuration.dateFormat + fmt.locale = Locale(identifier: "en_US_POSIX") + return fmt +}() + +extension Date: JSONEncodable { + func encodeToJSON() -> Any { + return dateFormatter.string(from: self) as Any + } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { + return self.uuidString + } +} + +extension String: CodingKey { + + public var stringValue: String { + return self + } + + public init?(stringValue: String) { + self.init(stringLiteral: stringValue) + } + + public var intValue: Int? { + return nil + } + + public init?(intValue: Int) { + return nil + } + +} + +extension KeyedEncodingContainerProtocol { + + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + var arrayContainer = nestedUnkeyedContainer(forKey: key) + try arrayContainer.encode(contentsOf: values) + } + + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + if let values = values { + try encodeArray(values, forKey: key) + } + } + + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + for (key, value) in pairs { + try encode(value, forKey: key) + } + } + + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + if let pairs = pairs { + try encodeMap(pairs) + } + } + +} + +extension KeyedDecodingContainerProtocol { + + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + var tmpArray = [T]() + + var nestedContainer = try nestedUnkeyedContainer(forKey: key) + while !nestedContainer.isAtEnd { + let arrayValue = try nestedContainer.decode(T.self) + tmpArray.append(arrayValue) + } + + return tmpArray + } + + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil + + if contains(key) { + tmpArray = try decodeArray(T.self, forKey: key) + } + + return tmpArray + } + + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] + + for key in allKeys { + if !excludedKeys.contains(key) { + let value = try decode(T.self, forKey: key) + map[key] = value + } + } + + return map + } + +} + +extension RequestBuilder { + public func execute() -> Promise> { + let deferred = Promise>.pending() + self.execute { (response: Response?, error: Error?) in + if let response = response { + deferred.fulfill(response) + } else { + deferred.reject(error!) + } + } + return deferred.promise + } +} diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift new file mode 100644 index 00000000000..ca05906d420 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -0,0 +1,54 @@ +// +// JSONDataEncoding.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + +public struct JSONDataEncoding: ParameterEncoding { + + // MARK: Properties + + private static let jsonDataKey = "jsonData" + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. This should have a single key/value + /// pair with "jsonData" as the key and a Data object as the value. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { + return urlRequest + } + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = jsonData + + return urlRequest + } + + public static func encodingParameters(jsonData: Data?) -> Parameters? { + var returnedParams: Parameters? = nil + if let jsonData = jsonData, !jsonData.isEmpty { + var params = Parameters() + params[jsonDataKey] = jsonData + returnedParams = params + } + return returnedParams + } + +} diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift new file mode 100644 index 00000000000..70449515842 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -0,0 +1,43 @@ +// +// JSONEncodingHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + +open class JSONEncodingHelper { + + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? = nil + + // Encode the Encodable object + if let encodableObj = encodableObj { + let encodeResult = CodableHelper.encode(encodableObj, prettyPrint: true) + if encodeResult.error == nil { + params = JSONDataEncoding.encodingParameters(jsonData: encodeResult.data) + } + } + + return params + } + + open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { + var params: Parameters? = nil + + if let encodableObj = encodableObj { + do { + let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) + params = JSONDataEncoding.encodingParameters(jsonData: data) + } catch { + print(error) + return nil + } + } + + return params + } + +} diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift new file mode 100644 index 00000000000..42f8186ae4a --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -0,0 +1,36 @@ +// Models.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +protocol JSONEncodable { + func encodeToJSON() -> Any +} + +public enum ErrorResponse : Error { + case error(Int, Data?, Error) +} + +open class Response { + open let statusCode: Int + open let header: [String: String] + open let body: T? + + public init(statusCode: Int, header: [String: String], body: T?) { + self.statusCode = statusCode + self.header = header + self.body = body + } + + public convenience init(response: HTTPURLResponse, body: T?) { + let rawHeader = response.allHeaderFields + var header = [String:String]() + for case let (key, value) as (String, String) in rawHeader { + header[key] = value + } + self.init(statusCode: response.statusCode, header: header, body: body) + } +} diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift new file mode 100644 index 00000000000..4e018486ad7 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -0,0 +1,29 @@ +// +// AdditionalPropertiesClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct AdditionalPropertiesClass: Codable { + + public var mapProperty: [String:String]? + public var mapOfMapProperty: [String:[String:String]]? + + public init(mapProperty: [String:String]?, mapOfMapProperty: [String:[String:String]]?) { + self.mapProperty = mapProperty + self.mapOfMapProperty = mapOfMapProperty + } + + public enum CodingKeys: String, CodingKey { + case mapProperty = "map_property" + case mapOfMapProperty = "map_of_map_property" + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift new file mode 100644 index 00000000000..7221a1be099 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -0,0 +1,24 @@ +// +// Animal.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Animal: Codable { + + public var className: String + public var color: String? = "red" + + public init(className: String, color: String?) { + self.className = className + self.color = color + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift new file mode 100644 index 00000000000..e7bea63f8ed --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -0,0 +1,11 @@ +// +// AnimalFarm.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift new file mode 100644 index 00000000000..a22e9aaebbb --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -0,0 +1,26 @@ +// +// ApiResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ApiResponse: Codable { + + public var code: Int? + public var type: String? + public var message: String? + + public init(code: Int?, type: String?, message: String?) { + self.code = code + self.type = type + self.message = message + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift new file mode 100644 index 00000000000..4e5a5ca1445 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -0,0 +1,26 @@ +// +// ArrayOfArrayOfNumberOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ArrayOfArrayOfNumberOnly: Codable { + + public var arrayArrayNumber: [[Double]]? + + public init(arrayArrayNumber: [[Double]]?) { + self.arrayArrayNumber = arrayArrayNumber + } + + public enum CodingKeys: String, CodingKey { + case arrayArrayNumber = "ArrayArrayNumber" + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift new file mode 100644 index 00000000000..7d059d36833 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -0,0 +1,26 @@ +// +// ArrayOfNumberOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ArrayOfNumberOnly: Codable { + + public var arrayNumber: [Double]? + + public init(arrayNumber: [Double]?) { + self.arrayNumber = arrayNumber + } + + public enum CodingKeys: String, CodingKey { + case arrayNumber = "ArrayNumber" + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift new file mode 100644 index 00000000000..9c56fed50c2 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -0,0 +1,32 @@ +// +// ArrayTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ArrayTest: Codable { + + public var arrayOfString: [String]? + public var arrayArrayOfInteger: [[Int64]]? + public var arrayArrayOfModel: [[ReadOnlyFirst]]? + + public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + self.arrayOfString = arrayOfString + self.arrayArrayOfInteger = arrayArrayOfInteger + self.arrayArrayOfModel = arrayArrayOfModel + } + + public enum CodingKeys: String, CodingKey { + case arrayOfString = "array_of_string" + case arrayArrayOfInteger = "array_array_of_integer" + case arrayArrayOfModel = "array_array_of_model" + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift new file mode 100644 index 00000000000..98cda23dac9 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -0,0 +1,42 @@ +// +// Capitalization.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Capitalization: Codable { + + public var smallCamel: String? + public var capitalCamel: String? + public var smallSnake: String? + public var capitalSnake: String? + public var sCAETHFlowPoints: String? + /** Name of the pet */ + public var ATT_NAME: String? + + public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + self.smallCamel = smallCamel + self.capitalCamel = capitalCamel + self.smallSnake = smallSnake + self.capitalSnake = capitalSnake + self.sCAETHFlowPoints = sCAETHFlowPoints + self.ATT_NAME = ATT_NAME + } + + public enum CodingKeys: String, CodingKey { + case smallCamel + case capitalCamel = "CapitalCamel" + case smallSnake = "small_Snake" + case capitalSnake = "Capital_Snake" + case sCAETHFlowPoints = "SCA_ETH_Flow_Points" + case ATT_NAME + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift new file mode 100644 index 00000000000..a116d964ea8 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -0,0 +1,26 @@ +// +// Cat.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Cat: Codable { + + public var className: String + public var color: String? = "red" + public var declawed: Bool? + + public init(className: String, color: String?, declawed: Bool?) { + self.className = className + self.color = color + self.declawed = declawed + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift new file mode 100644 index 00000000000..77fba95c1d7 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -0,0 +1,29 @@ +// +// Category.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Category: Codable { + + public var _id: Int64? + public var name: String? + + public init(_id: Int64?, name: String?) { + self._id = _id + self.name = name + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case name + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift new file mode 100644 index 00000000000..f673ed127cd --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -0,0 +1,23 @@ +// +// ClassModel.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Model for testing model with \"_class\" property */ + +public struct ClassModel: Codable { + + public var _class: String? + + public init(_class: String?) { + self._class = _class + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift new file mode 100644 index 00000000000..51390b6c4ea --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -0,0 +1,22 @@ +// +// Client.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Client: Codable { + + public var client: String? + + public init(client: String?) { + self.client = client + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift new file mode 100644 index 00000000000..239ce74dcc2 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -0,0 +1,26 @@ +// +// Dog.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Dog: Codable { + + public var className: String + public var color: String? = "red" + public var breed: String? + + public init(className: String, color: String?, breed: String?) { + self.className = className + self.color = color + self.breed = breed + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift new file mode 100644 index 00000000000..8713961520e --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -0,0 +1,37 @@ +// +// EnumArrays.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct EnumArrays: Codable { + + public enum JustSymbol: String, Codable { + case greaterThanOrEqualTo = ">=" + case dollar = "$" + } + public enum ArrayEnum: String, Codable { + case fish = "fish" + case crab = "crab" + } + public var justSymbol: JustSymbol? + public var arrayEnum: [ArrayEnum]? + + public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + self.justSymbol = justSymbol + self.arrayEnum = arrayEnum + } + + public enum CodingKeys: String, CodingKey { + case justSymbol = "just_symbol" + case arrayEnum = "array_enum" + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift new file mode 100644 index 00000000000..7280a621fec --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -0,0 +1,15 @@ +// +// EnumClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +public enum EnumClass: String, Codable { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" +} diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift new file mode 100644 index 00000000000..0f546c76a21 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -0,0 +1,56 @@ +// +// EnumTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct EnumTest: Codable { + + public enum EnumString: String, Codable { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } + public enum EnumStringRequired: String, Codable { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } + public enum EnumInteger: Int, Codable { + case _1 = 1 + case number1 = -1 + } + public enum EnumNumber: Double, Codable { + case _11 = 1.1 + case number12 = -1.2 + } + public var enumString: EnumString? + public var enumStringRequired: EnumStringRequired + public var enumInteger: EnumInteger? + public var enumNumber: EnumNumber? + public var outerEnum: OuterEnum? + + public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + self.enumString = enumString + self.enumStringRequired = enumStringRequired + self.enumInteger = enumInteger + self.enumNumber = enumNumber + self.outerEnum = outerEnum + } + + public enum CodingKeys: String, CodingKey { + case enumString = "enum_string" + case enumStringRequired = "enum_string_required" + case enumInteger = "enum_integer" + case enumNumber = "enum_number" + case outerEnum + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift new file mode 100644 index 00000000000..faa091b0658 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -0,0 +1,46 @@ +// +// FormatTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct FormatTest: Codable { + + public var integer: Int? + public var int32: Int? + public var int64: Int64? + public var number: Double + public var float: Float? + public var double: Double? + public var string: String? + public var byte: Data + public var binary: URL? + public var date: Date + public var dateTime: Date? + public var uuid: UUID? + public var password: String + + public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + self.integer = integer + self.int32 = int32 + self.int64 = int64 + self.number = number + self.float = float + self.double = double + self.string = string + self.byte = byte + self.binary = binary + self.date = date + self.dateTime = dateTime + self.uuid = uuid + self.password = password + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift new file mode 100644 index 00000000000..554aee1081a --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -0,0 +1,24 @@ +// +// HasOnlyReadOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct HasOnlyReadOnly: Codable { + + public var bar: String? + public var foo: String? + + public init(bar: String?, foo: String?) { + self.bar = bar + self.foo = foo + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift new file mode 100644 index 00000000000..8997340ff4b --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -0,0 +1,26 @@ +// +// List.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct List: Codable { + + public var _123list: String? + + public init(_123list: String?) { + self._123list = _123list + } + + public enum CodingKeys: String, CodingKey { + case _123list = "123-list" + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift new file mode 100644 index 00000000000..dfbbee8428e --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -0,0 +1,33 @@ +// +// MapTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct MapTest: Codable { + + public enum MapOfEnumString: String, Codable { + case upper = "UPPER" + case lower = "lower" + } + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?) { + self.mapMapOfString = mapMapOfString + self.mapOfEnumString = mapOfEnumString + } + + public enum CodingKeys: String, CodingKey { + case mapMapOfString = "map_map_of_string" + case mapOfEnumString = "map_of_enum_string" + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift new file mode 100644 index 00000000000..7116108fd7a --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -0,0 +1,26 @@ +// +// MixedPropertiesAndAdditionalPropertiesClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + + public var uuid: UUID? + public var dateTime: Date? + public var map: [String:Animal]? + + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + self.uuid = uuid + self.dateTime = dateTime + self.map = map + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift new file mode 100644 index 00000000000..fc1d0606b7b --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -0,0 +1,30 @@ +// +// Model200Response.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Model for testing model name starting with number */ + +public struct Model200Response: Codable { + + public var name: Int? + public var _class: String? + + public init(name: Int?, _class: String?) { + self.name = name + self._class = _class + } + + public enum CodingKeys: String, CodingKey { + case name + case _class = "class" + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift new file mode 100644 index 00000000000..cc165d767d9 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -0,0 +1,36 @@ +// +// Name.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Model for testing model name same as property name */ + +public struct Name: Codable { + + public var name: Int + public var snakeCase: Int? + public var property: String? + public var _123number: Int? + + public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { + self.name = name + self.snakeCase = snakeCase + self.property = property + self._123number = _123number + } + + public enum CodingKeys: String, CodingKey { + case name + case snakeCase = "snake_case" + case property + case _123number = "123Number" + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift new file mode 100644 index 00000000000..e6fb206093a --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -0,0 +1,26 @@ +// +// NumberOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct NumberOnly: Codable { + + public var justNumber: Double? + + public init(justNumber: Double?) { + self.justNumber = justNumber + } + + public enum CodingKeys: String, CodingKey { + case justNumber = "JustNumber" + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift new file mode 100644 index 00000000000..5cad29458b7 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -0,0 +1,47 @@ +// +// Order.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Order: Codable { + + public enum Status: String, Codable { + case placed = "placed" + case approved = "approved" + case delivered = "delivered" + } + public var _id: Int64? + public var petId: Int64? + public var quantity: Int? + public var shipDate: Date? + /** Order Status */ + public var status: Status? + public var complete: Bool? = false + + public init(_id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + self._id = _id + self.petId = petId + self.quantity = quantity + self.shipDate = shipDate + self.status = status + self.complete = complete + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case petId + case quantity + case shipDate + case status + case complete + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift new file mode 100644 index 00000000000..edc4523d9f0 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -0,0 +1,32 @@ +// +// OuterComposite.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct OuterComposite: Codable { + + public var myNumber: Double? + public var myString: String? + public var myBoolean: Bool? + + public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { + self.myNumber = myNumber + self.myString = myString + self.myBoolean = myBoolean + } + + public enum CodingKeys: String, CodingKey { + case myNumber = "my_number" + case myString = "my_string" + case myBoolean = "my_boolean" + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift new file mode 100644 index 00000000000..bd1643d279e --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -0,0 +1,15 @@ +// +// OuterEnum.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +public enum OuterEnum: String, Codable { + case placed = "placed" + case approved = "approved" + case delivered = "delivered" +} diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift new file mode 100644 index 00000000000..3773bf53317 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -0,0 +1,47 @@ +// +// Pet.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Pet: Codable { + + public enum Status: String, Codable { + case available = "available" + case pending = "pending" + case sold = "sold" + } + public var _id: Int64? + public var category: Category? + public var name: String + public var photoUrls: [String] + public var tags: [Tag]? + /** pet status in the store */ + public var status: Status? + + public init(_id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + self._id = _id + self.category = category + self.name = name + self.photoUrls = photoUrls + self.tags = tags + self.status = status + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case category + case name + case photoUrls + case tags + case status + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift new file mode 100644 index 00000000000..48b655a5b0a --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -0,0 +1,24 @@ +// +// ReadOnlyFirst.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ReadOnlyFirst: Codable { + + public var bar: String? + public var baz: String? + + public init(bar: String?, baz: String?) { + self.bar = bar + self.baz = baz + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift new file mode 100644 index 00000000000..de4b218999b --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -0,0 +1,27 @@ +// +// Return.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Model for testing reserved words */ + +public struct Return: Codable { + + public var _return: Int? + + public init(_return: Int?) { + self._return = _return + } + + public enum CodingKeys: String, CodingKey { + case _return = "return" + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift new file mode 100644 index 00000000000..213d896ba98 --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -0,0 +1,26 @@ +// +// SpecialModelName.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct SpecialModelName: Codable { + + public var specialPropertyName: Int64? + + public init(specialPropertyName: Int64?) { + self.specialPropertyName = specialPropertyName + } + + public enum CodingKeys: String, CodingKey { + case specialPropertyName = "$special[property.name]" + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift new file mode 100644 index 00000000000..20f50efd3ac --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -0,0 +1,29 @@ +// +// Tag.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Tag: Codable { + + public var _id: Int64? + public var name: String? + + public init(_id: Int64?, name: String?) { + self._id = _id + self.name = name + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case name + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift new file mode 100644 index 00000000000..d9c564d2a1f --- /dev/null +++ b/samples/client/petstore/swift4/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -0,0 +1,48 @@ +// +// User.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct User: Codable { + + public var _id: Int64? + public var username: String? + public var firstName: String? + public var lastName: String? + public var email: String? + public var password: String? + public var phone: String? + /** User Status */ + public var userStatus: Int? + + public init(_id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + self._id = _id + self.username = username + self.firstName = firstName + self.lastName = lastName + self.email = email + self.password = password + self.phone = phone + self.userStatus = userStatus + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case username + case firstName + case lastName + case email + case password + case phone + case userStatus + } + + +} + diff --git a/samples/client/petstore/swift4/promisekit/git_push.sh b/samples/client/petstore/swift4/promisekit/git_push.sh index ae01b182ae9..8442b80bb44 100644 --- a/samples/client/petstore/swift4/promisekit/git_push.sh +++ b/samples/client/petstore/swift4/promisekit/git_push.sh @@ -1,7 +1,7 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 diff --git a/samples/client/petstore/swift4/rxswift/.openapi-generator/VERSION b/samples/client/petstore/swift4/rxswift/.openapi-generator/VERSION index 855ff9501eb..ad121e8340e 100644 --- a/samples/client/petstore/swift4/rxswift/.openapi-generator/VERSION +++ b/samples/client/petstore/swift4/rxswift/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient.podspec b/samples/client/petstore/swift4/rxswift/PetstoreClient.podspec index ef79777ecba..5fd8bc297e7 100644 --- a/samples/client/petstore/swift4/rxswift/PetstoreClient.podspec +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient.podspec @@ -4,10 +4,10 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.11' s.tvos.deployment_target = '9.0' s.version = '0.0.1' - s.source = { :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' } + s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } s.authors = '' s.license = 'Proprietary' - s.homepage = 'https://github.com/swagger-api/swagger-codegen' + s.homepage = 'https://github.com/openapitools/openapi-generator' s.summary = 'PetstoreClient' s.source_files = 'PetstoreClient/Classes/**/*.swift' s.dependency 'RxSwift', '~> 4.0' diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift new file mode 100644 index 00000000000..3c7b53f8149 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -0,0 +1,65 @@ +// APIHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct APIHelper { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + let destination = source.reduce(into: [String: Any]()) { (result, item) in + if let value = item.value { + result[item.key] = value + } + } + + if destination.isEmpty { + return nil + } + return destination + } + + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + return source.reduce(into: [String: String]()) { (result, item) in + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + } else if let value: Any = item.value { + result[item.key] = "\(value)" + } + } + } + + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + guard let source = source else { + return nil + } + + return source.reduce(into: [String: Any](), { (result, item) in + switch item.value { + case let x as Bool: + result[item.key] = x.description + default: + result[item.key] = item.value + } + }) + } + + + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in + if let collection = item.value as? Array { + let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") + result.append(URLQueryItem(name: item.key, value: value)) + } else if let value = item.value { + result.append(URLQueryItem(name: item.key, value: "\(value)")) + } + } + + if destination.isEmpty { + return nil + } + return destination + } +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift new file mode 100644 index 00000000000..8cae3aacfe5 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -0,0 +1,61 @@ +// APIs.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class PetstoreClientAPI { + open static var basePath = "http://petstore.swagger.io:80/v2" + open static var credential: URLCredential? + open static var customHeaders: [String:String] = [:] + open static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() +} + +open class RequestBuilder { + var credential: URLCredential? + var headers: [String:String] + public let parameters: [String:Any]? + public let isBody: Bool + public let method: String + public let URLString: String + + /// Optional block to obtain a reference to the request's progress instance when available. + public var onProgressReady: ((Progress) -> ())? + + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + self.method = method + self.URLString = URLString + self.parameters = parameters + self.isBody = isBody + self.headers = headers + + addHeaders(PetstoreClientAPI.customHeaders) + } + + open func addHeaders(_ aHeaders:[String:String]) { + for (header, value) in aHeaders { + headers[header] = value + } + } + + open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { } + + public func addHeader(name: String, value: String) -> Self { + if !value.isEmpty { + headers[name] = value + } + return self + } + + open func addCredential() -> Self { + self.credential = PetstoreClientAPI.credential + return self + } +} + +public protocol RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type +} diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift new file mode 100644 index 00000000000..9f947042e85 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -0,0 +1,66 @@ +// +// AnotherFakeAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import RxSwift + + + +open class AnotherFakeAPI { + /** + To test special tags + + - parameter client: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + To test special tags + + - parameter client: (body) client model + - returns: Observable + */ + open class func testSpecialTags(client: Client) -> Observable { + return Observable.create { observer -> Disposable in + testSpecialTags(client: client) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + To test special tags + - PATCH /another-fake/dummy + - To test special tags + - parameter client: (body) client model + - returns: RequestBuilder + */ + open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { + let path = "/another-fake/dummy" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: client) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift new file mode 100644 index 00000000000..46fad3a2768 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -0,0 +1,707 @@ +// +// FakeAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import RxSwift + + + +open class FakeAPI { + /** + + - parameter body: (body) Input boolean as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { + fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + + - parameter body: (body) Input boolean as post body (optional) + - returns: Observable + */ + open class func fakeOuterBooleanSerialize(body: Bool? = nil) -> Observable { + return Observable.create { observer -> Disposable in + fakeOuterBooleanSerialize(body: body) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + - POST /fake/outer/boolean + - Test serialization of outer boolean types + - parameter body: (body) Input boolean as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { + let path = "/fake/outer/boolean" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter outerComposite: (body) Input composite as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + + - parameter outerComposite: (body) Input composite as post body (optional) + - returns: Observable + */ + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil) -> Observable { + return Observable.create { observer -> Disposable in + fakeOuterCompositeSerialize(outerComposite: outerComposite) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + - POST /fake/outer/composite + - Test serialization of object with outer number type + - parameter outerComposite: (body) Input composite as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { + let path = "/fake/outer/composite" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: outerComposite) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter body: (body) Input number as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { + fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + + - parameter body: (body) Input number as post body (optional) + - returns: Observable + */ + open class func fakeOuterNumberSerialize(body: Double? = nil) -> Observable { + return Observable.create { observer -> Disposable in + fakeOuterNumberSerialize(body: body) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + - POST /fake/outer/number + - Test serialization of outer number types + - parameter body: (body) Input number as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { + let path = "/fake/outer/number" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter body: (body) Input string as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + + - parameter body: (body) Input string as post body (optional) + - returns: Observable + */ + open class func fakeOuterStringSerialize(body: String? = nil) -> Observable { + return Observable.create { observer -> Disposable in + fakeOuterStringSerialize(body: body) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + - POST /fake/outer/string + - Test serialization of outer string types + - parameter body: (body) Input string as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { + let path = "/fake/outer/string" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter query: (query) + - parameter user: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithQueryParams(query: String, user: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + + - parameter query: (query) + - parameter user: (body) + - returns: Observable + */ + open class func testBodyWithQueryParams(query: String, user: User) -> Observable { + return Observable.create { observer -> Disposable in + testBodyWithQueryParams(query: query, user: user) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + - PUT /fake/body-with-query-params + - parameter query: (query) + - parameter user: (body) + - returns: RequestBuilder + */ + open class func testBodyWithQueryParamsWithRequestBuilder(query: String, user: User) -> RequestBuilder { + let path = "/fake/body-with-query-params" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "query": query + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + To test \"client\" model + + - parameter client: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + To test \"client\" model + + - parameter client: (body) client model + - returns: Observable + */ + open class func testClientModel(client: Client) -> Observable { + return Observable.create { observer -> Disposable in + testClientModel(client: client) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + To test \"client\" model + - PATCH /fake + - To test \"client\" model + - parameter client: (body) client model + - returns: RequestBuilder + */ + open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: client) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + - parameter number: (form) None + - parameter double: (form) None + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter float: (form) None (optional) + - parameter string: (form) None (optional) + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + - parameter number: (form) None + - parameter double: (form) None + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter float: (form) None (optional) + - parameter string: (form) None (optional) + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + - returns: Observable + */ + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Observable { + return Observable.create { observer -> Disposable in + testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - POST /fake + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - BASIC: + - type: http + - name: http_basic_test + - parameter number: (form) None + - parameter double: (form) None + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter float: (form) None (optional) + - parameter string: (form) None (optional) + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + - returns: RequestBuilder + */ + open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "integer": integer?.encodeToJSON(), + "int32": int32?.encodeToJSON(), + "int64": int64?.encodeToJSON(), + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date?.encodeToJSON(), + "dateTime": dateTime?.encodeToJSON(), + "password": password, + "callback": callback + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + * enum for parameter enumHeaderStringArray + */ + public enum EnumHeaderStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumHeaderString + */ + public enum EnumHeaderString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + * enum for parameter enumQueryStringArray + */ + public enum EnumQueryStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumQueryString + */ + public enum EnumQueryString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + * enum for parameter enumQueryInteger + */ + public enum EnumQueryInteger_testEnumParameters: Int { + case _1 = 1 + case number2 = -2 + } + + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + + /** + * enum for parameter enumFormStringArray + */ + public enum EnumFormStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumFormString + */ + public enum EnumFormString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + To test enum parameters + + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to "$") + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to "-efg") + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + To test enum parameters + + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to "$") + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to "-efg") + - returns: Observable + */ + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Observable { + return Observable.create { observer -> Disposable in + testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + To test enum parameters + - GET /fake + - To test enum parameters + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to "$") + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to "-efg") + - returns: RequestBuilder + */ + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString?.rawValue + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "enum_query_string_array": enumQueryStringArray, + "enum_query_string": enumQueryString?.rawValue, + "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue + ]) + let nillableHeaders: [String: Any?] = [ + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString?.rawValue + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + test inline additionalProperties + + - parameter requestBody: (body) request body + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testInlineAdditionalProperties(requestBody: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(requestBody: requestBody).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + test inline additionalProperties + + - parameter requestBody: (body) request body + - returns: Observable + */ + open class func testInlineAdditionalProperties(requestBody: [String:String]) -> Observable { + return Observable.create { observer -> Disposable in + testInlineAdditionalProperties(requestBody: requestBody) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + test inline additionalProperties + - POST /fake/inline-additionalProperties + - parameter requestBody: (body) request body + - returns: RequestBuilder + */ + open class func testInlineAdditionalPropertiesWithRequestBuilder(requestBody: [String:String]) -> RequestBuilder { + let path = "/fake/inline-additionalProperties" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: requestBody) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + test json serialization of form data + + - parameter param: (form) field1 + - parameter param2: (form) field2 + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + test json serialization of form data + + - parameter param: (form) field1 + - parameter param2: (form) field2 + - returns: Observable + */ + open class func testJsonFormData(param: String, param2: String) -> Observable { + return Observable.create { observer -> Disposable in + testJsonFormData(param: param, param2: param2) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + test json serialization of form data + - GET /fake/jsonFormData + - parameter param: (form) field1 + - parameter param2: (form) field2 + - returns: RequestBuilder + */ + open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { + let path = "/fake/jsonFormData" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "param": param, + "param2": param2 + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + +} diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift new file mode 100644 index 00000000000..316ba723274 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -0,0 +1,69 @@ +// +// FakeClassnameTags123API.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import RxSwift + + + +open class FakeClassnameTags123API { + /** + To test class name in snake case + + - parameter client: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testClassname(client: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + To test class name in snake case + + - parameter client: (body) client model + - returns: Observable + */ + open class func testClassname(client: Client) -> Observable { + return Observable.create { observer -> Disposable in + testClassname(client: client) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + To test class name in snake case + - PATCH /fake_classname_test + - To test class name in snake case + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query + - parameter client: (body) client model + - returns: RequestBuilder + */ + open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { + let path = "/fake_classname_test" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: client) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift new file mode 100644 index 00000000000..d7cd99d687a --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -0,0 +1,516 @@ +// +// PetAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import RxSwift + + + +open class PetAPI { + /** + Add a new pet to the store + + - parameter pet: (body) Pet object that needs to be added to the store + - parameter completion: completion handler to receive the data and the error objects + */ + open class func addPet(pet: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Add a new pet to the store + + - parameter pet: (body) Pet object that needs to be added to the store + - returns: Observable + */ + open class func addPet(pet: Pet) -> Observable { + return Observable.create { observer -> Disposable in + addPet(pet: pet) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Add a new pet to the store + - POST /pet + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter pet: (body) Pet object that needs to be added to the store + - returns: RequestBuilder + */ + open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { + let path = "/pet" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: pet) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Deletes a pet + + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Deletes a pet + + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + - returns: Observable + */ + open class func deletePet(petId: Int64, apiKey: String? = nil) -> Observable { + return Observable.create { observer -> Disposable in + deletePet(petId: petId, apiKey: apiKey) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Deletes a pet + - DELETE /pet/{petId} + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + - returns: RequestBuilder + */ + open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + let nillableHeaders: [String: Any?] = [ + "api_key": apiKey + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + * enum for parameter status + */ + public enum Status_findPetsByStatus: String { + case available = "available" + case pending = "pending" + case sold = "sold" + } + + /** + Finds Pets by status + + - parameter status: (query) Status values that need to be considered for filter + - parameter completion: completion handler to receive the data and the error objects + */ + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Finds Pets by status + + - parameter status: (query) Status values that need to be considered for filter + - returns: Observable<[Pet]> + */ + open class func findPetsByStatus(status: [String]) -> Observable<[Pet]> { + return Observable.create { observer -> Disposable in + findPetsByStatus(status: status) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Finds Pets by status + - GET /pet/findByStatus + - Multiple status values can be provided with comma separated strings + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter status: (query) Status values that need to be considered for filter + - returns: RequestBuilder<[Pet]> + */ + open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + let path = "/pet/findByStatus" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "status": status + ]) + + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Finds Pets by tags + + - parameter tags: (query) Tags to filter by + - parameter completion: completion handler to receive the data and the error objects + */ + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Finds Pets by tags + + - parameter tags: (query) Tags to filter by + - returns: Observable<[Pet]> + */ + open class func findPetsByTags(tags: [String]) -> Observable<[Pet]> { + return Observable.create { observer -> Disposable in + findPetsByTags(tags: tags) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Finds Pets by tags + - GET /pet/findByTags + - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter tags: (query) Tags to filter by + - returns: RequestBuilder<[Pet]> + */ + open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { + let path = "/pet/findByTags" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "tags": tags + ]) + + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Find pet by ID + + - parameter petId: (path) ID of pet to return + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { + getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Find pet by ID + + - parameter petId: (path) ID of pet to return + - returns: Observable + */ + open class func getPetById(petId: Int64) -> Observable { + return Observable.create { observer -> Disposable in + getPetById(petId: petId) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Find pet by ID + - GET /pet/{petId} + - Returns a single pet + - API Key: + - type: apiKey api_key + - name: api_key + - parameter petId: (path) ID of pet to return + - returns: RequestBuilder + */ + open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Update an existing pet + + - parameter pet: (body) Pet object that needs to be added to the store + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updatePet(pet: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Update an existing pet + + - parameter pet: (body) Pet object that needs to be added to the store + - returns: Observable + */ + open class func updatePet(pet: Pet) -> Observable { + return Observable.create { observer -> Disposable in + updatePet(pet: pet) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Update an existing pet + - PUT /pet + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter pet: (body) Pet object that needs to be added to the store + - returns: RequestBuilder + */ + open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { + let path = "/pet" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: pet) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Updates a pet in the store with form data + + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Updates a pet in the store with form data + + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - returns: Observable + */ + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil) -> Observable { + return Observable.create { observer -> Disposable in + updatePetWithForm(petId: petId, name: name, status: status) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Updates a pet in the store with form data + - POST /pet/{petId} + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - returns: RequestBuilder + */ + open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "name": name, + "status": status + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + uploads an image + + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + uploads an image + + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - returns: Observable + */ + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> Observable { + return Observable.create { observer -> Disposable in + uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + uploads an image + - POST /pet/{petId}/uploadImage + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { + var path = "/pet/{petId}/uploadImage" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "additionalMetadata": additionalMetadata, + "file": file + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + +} diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift new file mode 100644 index 00000000000..f071f68e21c --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -0,0 +1,228 @@ +// +// StoreAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import RxSwift + + + +open class StoreAPI { + /** + Delete purchase order by ID + + - parameter orderId: (path) ID of the order that needs to be deleted + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Delete purchase order by ID + + - parameter orderId: (path) ID of the order that needs to be deleted + - returns: Observable + */ + open class func deleteOrder(orderId: String) -> Observable { + return Observable.create { observer -> Disposable in + deleteOrder(orderId: orderId) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Delete purchase order by ID + - DELETE /store/order/{order_id} + - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + - parameter orderId: (path) ID of the order that needs to be deleted + - returns: RequestBuilder + */ + open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { + var path = "/store/order/{order_id}" + let orderIdPreEscape = "\(orderId)" + let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Returns pet inventories by status + + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { + getInventoryWithRequestBuilder().execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Returns pet inventories by status + + - returns: Observable<[String:Int]> + */ + open class func getInventory() -> Observable<[String:Int]> { + return Observable.create { observer -> Disposable in + getInventory() { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Returns pet inventories by status + - GET /store/inventory + - Returns a map of status codes to quantities + - API Key: + - type: apiKey api_key + - name: api_key + - returns: RequestBuilder<[String:Int]> + */ + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + let path = "/store/inventory" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Find purchase order by ID + + - parameter orderId: (path) ID of pet that needs to be fetched + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Find purchase order by ID + + - parameter orderId: (path) ID of pet that needs to be fetched + - returns: Observable + */ + open class func getOrderById(orderId: Int64) -> Observable { + return Observable.create { observer -> Disposable in + getOrderById(orderId: orderId) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Find purchase order by ID + - GET /store/order/{order_id} + - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + - parameter orderId: (path) ID of pet that needs to be fetched + - returns: RequestBuilder + */ + open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { + var path = "/store/order/{order_id}" + let orderIdPreEscape = "\(orderId)" + let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Place an order for a pet + + - parameter order: (body) order placed for purchasing the pet + - parameter completion: completion handler to receive the data and the error objects + */ + open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Place an order for a pet + + - parameter order: (body) order placed for purchasing the pet + - returns: Observable + */ + open class func placeOrder(order: Order) -> Observable { + return Observable.create { observer -> Disposable in + placeOrder(order: order) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Place an order for a pet + - POST /store/order + - parameter order: (body) order placed for purchasing the pet + - returns: RequestBuilder + */ + open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { + let path = "/store/order" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: order) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift new file mode 100644 index 00000000000..b006c017f0c --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -0,0 +1,459 @@ +// +// UserAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import RxSwift + + + +open class UserAPI { + /** + Create user + + - parameter user: (body) Created user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUser(user: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Create user + + - parameter user: (body) Created user object + - returns: Observable + */ + open class func createUser(user: User) -> Observable { + return Observable.create { observer -> Disposable in + createUser(user: user) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Create user + - POST /user + - This can only be done by the logged in user. + - parameter user: (body) Created user object + - returns: RequestBuilder + */ + open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { + let path = "/user" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - returns: Observable + */ + open class func createUsersWithArrayInput(user: [User]) -> Observable { + return Observable.create { observer -> Disposable in + createUsersWithArrayInput(user: user) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Creates list of users with given input array + - POST /user/createWithArray + - parameter user: (body) List of user object + - returns: RequestBuilder + */ + open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { + let path = "/user/createWithArray" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUsersWithListInput(user: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - returns: Observable + */ + open class func createUsersWithListInput(user: [User]) -> Observable { + return Observable.create { observer -> Disposable in + createUsersWithListInput(user: user) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Creates list of users with given input array + - POST /user/createWithList + - parameter user: (body) List of user object + - returns: RequestBuilder + */ + open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { + let path = "/user/createWithList" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Delete user + + - parameter username: (path) The name that needs to be deleted + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Delete user + + - parameter username: (path) The name that needs to be deleted + - returns: Observable + */ + open class func deleteUser(username: String) -> Observable { + return Observable.create { observer -> Disposable in + deleteUser(username: username) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Delete user + - DELETE /user/{username} + - This can only be done by the logged in user. + - parameter username: (path) The name that needs to be deleted + - returns: RequestBuilder + */ + open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(username)" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Get user by user name + + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { + getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Get user by user name + + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - returns: Observable + */ + open class func getUserByName(username: String) -> Observable { + return Observable.create { observer -> Disposable in + getUserByName(username: username) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Get user by user name + - GET /user/{username} + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - returns: RequestBuilder + */ + open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(username)" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Logs user into the system + + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - parameter completion: completion handler to receive the data and the error objects + */ + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Logs user into the system + + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - returns: Observable + */ + open class func loginUser(username: String, password: String) -> Observable { + return Observable.create { observer -> Disposable in + loginUser(username: username, password: password) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Logs user into the system + - GET /user/login + - responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)] + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - returns: RequestBuilder + */ + open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { + let path = "/user/login" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "username": username, + "password": password + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Logs out current logged in user session + + - parameter completion: completion handler to receive the data and the error objects + */ + open class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Logs out current logged in user session + + - returns: Observable + */ + open class func logoutUser() -> Observable { + return Observable.create { observer -> Disposable in + logoutUser() { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Logs out current logged in user session + - GET /user/logout + - returns: RequestBuilder + */ + open class func logoutUserWithRequestBuilder() -> RequestBuilder { + let path = "/user/logout" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Updated user + + - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updateUser(username: String, user: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Updated user + + - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object + - returns: Observable + */ + open class func updateUser(username: String, user: User) -> Observable { + return Observable.create { observer -> Disposable in + updateUser(username: username, user: user) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Updated user + - PUT /user/{username} + - This can only be done by the logged in user. + - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object + - returns: RequestBuilder + */ + open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(username)" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift new file mode 100644 index 00000000000..280b4e53389 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -0,0 +1,413 @@ +// AlamofireImplementations.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + +class AlamofireRequestBuilderFactory: RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type { + return AlamofireRequestBuilder.self + } + + func getBuilder() -> RequestBuilder.Type { + return AlamofireDecodableRequestBuilder.self + } +} + +// Store manager to retain its reference +private var managerStore: [String: Alamofire.SessionManager] = [:] + +open class AlamofireRequestBuilder: RequestBuilder { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) + } + + /** + May be overridden by a subclass if you want to control the session + configuration. + */ + open func createSessionManager() -> Alamofire.SessionManager { + let configuration = URLSessionConfiguration.default + configuration.httpAdditionalHeaders = buildHeaders() + return Alamofire.SessionManager(configuration: configuration) + } + + /** + May be overridden by a subclass if you want to control the Content-Type + that is given to an uploaded form part. + + Return nil to use the default behavior (inferring the Content-Type from + the file extension). Return the desired Content-Type otherwise. + */ + open func contentTypeForFormPart(fileURL: URL) -> String? { + return nil + } + + /** + May be overridden by a subclass if you want to control the request + configuration (e.g. to override the cache policy). + */ + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { + return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) + } + + override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + let managerId:String = UUID().uuidString + // Create a new manager for each request to customize its request header + let manager = createSessionManager() + managerStore[managerId] = manager + + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + + let xMethod = Alamofire.HTTPMethod(rawValue: method) + let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } + .map { $0.0 } + + if fileKeys.count > 0 { + manager.upload(multipartFormData: { mpForm in + for (k, v) in self.parameters! { + switch v { + case let fileURL as URL: + if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { + mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) + } + else { + mpForm.append(fileURL, withName: k) + } + case let string as String: + mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) + case let number as NSNumber: + mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) + default: + fatalError("Unprocessable value \(v) with key \(k)") + } + } + }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in + switch encodingResult { + case .success(let upload, _, _): + if let onProgressReady = self.onProgressReady { + onProgressReady(upload.uploadProgress) + } + self.processRequest(request: upload, managerId, completion) + case .failure(let encodingError): + completion(nil, ErrorResponse.error(415, nil, encodingError)) + } + }) + } else { + let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) + if let onProgressReady = self.onProgressReady { + onProgressReady(request.progress) + } + processRequest(request: request, managerId, completion) + } + + } + + fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + if let credential = self.credential { + request.authenticate(usingCredential: credential) + } + + let cleanupRequest = { + _ = managerStore.removeValue(forKey: managerId) + } + + let validatedRequest = request.validate() + + switch T.self { + case is String.Type: + validatedRequest.responseString(completionHandler: { (stringResponse) in + cleanupRequest() + + if stringResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!) + ) + return + } + + completion( + Response( + response: stringResponse.response!, + body: ((stringResponse.result.value ?? "") as! T) + ), + nil + ) + }) + case is URL.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + do { + + guard !dataResponse.result.isFailure else { + throw DownloadException.responseFailed + } + + guard let data = dataResponse.data else { + throw DownloadException.responseDataMissing + } + + guard let request = request.request else { + throw DownloadException.requestMissing + } + + let fileManager = FileManager.default + let urlRequest = try request.asURLRequest() + let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] + let requestURL = try self.getURL(from: urlRequest) + + var requestPath = try self.getPath(from: requestURL) + + if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { + requestPath = requestPath.appending("/\(headerFileName)") + } + + let filePath = documentsDirectory.appendingPathComponent(requestPath) + let directoryPath = filePath.deletingLastPathComponent().path + + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) + try data.write(to: filePath, options: .atomic) + + completion( + Response( + response: dataResponse.response!, + body: (filePath as! T) + ), + nil + ) + + } catch let requestParserError as DownloadException { + completion(nil, ErrorResponse.error(400, dataResponse.data, requestParserError)) + } catch let error { + completion(nil, ErrorResponse.error(400, dataResponse.data, error)) + } + return + }) + case is Void.Type: + validatedRequest.responseData(completionHandler: { (voidResponse) in + cleanupRequest() + + if voidResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) + ) + return + } + + completion( + Response( + response: voidResponse.response!, + body: nil), + nil + ) + }) + default: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + if dataResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) + ) + return + } + + completion( + Response( + response: dataResponse.response!, + body: (dataResponse.data as! T) + ), + nil + ) + }) + } + } + + open func buildHeaders() -> [String: String] { + var httpHeaders = SessionManager.defaultHTTPHeaders + for (key, value) in self.headers { + httpHeaders[key] = value + } + return httpHeaders + } + + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + + guard let contentDisposition = contentDisposition else { + return nil + } + + let items = contentDisposition.components(separatedBy: ";") + + var filename : String? = nil + + for contentItem in items { + + let filenameKey = "filename=" + guard let range = contentItem.range(of: filenameKey) else { + break + } + + filename = contentItem + return filename? + .replacingCharacters(in: range, with:"") + .replacingOccurrences(of: "\"", with: "") + .trimmingCharacters(in: .whitespacesAndNewlines) + } + + return filename + + } + + fileprivate func getPath(from url : URL) throws -> String { + + guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { + throw DownloadException.requestMissingPath + } + + if path.hasPrefix("/") { + path.remove(at: path.startIndex) + } + + return path + + } + + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + return url + } + +} + +fileprivate enum DownloadException : Error { + case responseDataMissing + case responseFailed + case requestMissing + case requestMissingPath + case requestMissingURL +} + +public enum AlamofireDecodableRequestBuilderError: Error { + case emptyDataResponse + case nilHTTPResponse + case jsonDecoding(DecodingError) + case generalError(Error) +} + +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { + + override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + if let credential = self.credential { + request.authenticate(usingCredential: credential) + } + + let cleanupRequest = { + _ = managerStore.removeValue(forKey: managerId) + } + + let validatedRequest = request.validate() + + switch T.self { + case is String.Type: + validatedRequest.responseString(completionHandler: { (stringResponse) in + cleanupRequest() + + if stringResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!) + ) + return + } + + completion( + Response( + response: stringResponse.response!, + body: ((stringResponse.result.value ?? "") as! T) + ), + nil + ) + }) + case is Void.Type: + validatedRequest.responseData(completionHandler: { (voidResponse) in + cleanupRequest() + + if voidResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) + ) + return + } + + completion( + Response( + response: voidResponse.response!, + body: nil), + nil + ) + }) + case is Data.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + if dataResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) + ) + return + } + + completion( + Response( + response: dataResponse.response!, + body: (dataResponse.data as! T) + ), + nil + ) + }) + default: + validatedRequest.responseData(completionHandler: { (dataResponse: DataResponse) in + cleanupRequest() + + guard dataResponse.result.isSuccess else { + completion(nil, ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)) + return + } + + guard let data = dataResponse.data, !data.isEmpty else { + completion(nil, ErrorResponse.error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse)) + return + } + + guard let httpResponse = dataResponse.response else { + completion(nil, ErrorResponse.error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse)) + return + } + + var responseObj: Response? = nil + + let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) + if decodeResult.error == nil { + responseObj = Response(response: httpResponse, body: decodeResult.decodableObj) + } + + completion(responseObj, decodeResult.error) + }) + } + } + +} diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift new file mode 100644 index 00000000000..2d50e463ae1 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -0,0 +1,67 @@ +// +// CodableHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public typealias EncodeResult = (data: Data?, error: Error?) + +open class CodableHelper { + + open static var dateformatter: DateFormatter? + + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { + var returnedDecodable: T? = nil + var returnedError: Error? = nil + + let decoder = JSONDecoder() + if let df = self.dateformatter { + decoder.dateDecodingStrategy = .formatted(df) + } else { + decoder.dataDecodingStrategy = .base64 + let formatter = DateFormatter() + formatter.calendar = Calendar(identifier: .iso8601) + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX" + decoder.dateDecodingStrategy = .formatted(formatter) + } + + do { + returnedDecodable = try decoder.decode(type, from: data) + } catch { + returnedError = error + } + + return (returnedDecodable, returnedError) + } + + open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T : Encodable { + var returnedData: Data? + var returnedError: Error? = nil + + let encoder = JSONEncoder() + if prettyPrint { + encoder.outputFormatting = .prettyPrinted + } + encoder.dataEncodingStrategy = .base64 + let formatter = DateFormatter() + formatter.calendar = Calendar(identifier: .iso8601) + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX" + encoder.dateEncodingStrategy = .formatted(formatter) + + do { + returnedData = try encoder.encode(value) + } catch { + returnedError = error + } + + return (returnedData, returnedError) + } + +} diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift new file mode 100644 index 00000000000..f8180752b67 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -0,0 +1,15 @@ +// Configuration.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class Configuration { + + // This value is used to configure the date formatter that is used to serialize dates into JSON format. + // You must set it prior to encoding any dates, and it will only be read once. + open static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift new file mode 100644 index 00000000000..abe218b4e7a --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -0,0 +1,173 @@ +// Extensions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +private func encodeIfPossible(_ object: T) -> Any { + if let encodableObject = object as? JSONEncodable { + return encodableObject.encodeToJSON() + } else { + return object as Any + } +} + +extension Array: JSONEncodable { + func encodeToJSON() -> Any { + return self.map(encodeIfPossible) + } +} + +extension Dictionary: JSONEncodable { + func encodeToJSON() -> Any { + var dictionary = [AnyHashable: Any]() + for (key, value) in self { + dictionary[key] = encodeIfPossible(value) + } + return dictionary as Any + } +} + +extension Data: JSONEncodable { + func encodeToJSON() -> Any { + return self.base64EncodedString(options: Data.Base64EncodingOptions()) + } +} + +private let dateFormatter: DateFormatter = { + let fmt = DateFormatter() + fmt.dateFormat = Configuration.dateFormat + fmt.locale = Locale(identifier: "en_US_POSIX") + return fmt +}() + +extension Date: JSONEncodable { + func encodeToJSON() -> Any { + return dateFormatter.string(from: self) as Any + } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { + return self.uuidString + } +} + +extension String: CodingKey { + + public var stringValue: String { + return self + } + + public init?(stringValue: String) { + self.init(stringLiteral: stringValue) + } + + public var intValue: Int? { + return nil + } + + public init?(intValue: Int) { + return nil + } + +} + +extension KeyedEncodingContainerProtocol { + + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + var arrayContainer = nestedUnkeyedContainer(forKey: key) + try arrayContainer.encode(contentsOf: values) + } + + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + if let values = values { + try encodeArray(values, forKey: key) + } + } + + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + for (key, value) in pairs { + try encode(value, forKey: key) + } + } + + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + if let pairs = pairs { + try encodeMap(pairs) + } + } + +} + +extension KeyedDecodingContainerProtocol { + + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + var tmpArray = [T]() + + var nestedContainer = try nestedUnkeyedContainer(forKey: key) + while !nestedContainer.isAtEnd { + let arrayValue = try nestedContainer.decode(T.self) + tmpArray.append(arrayValue) + } + + return tmpArray + } + + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil + + if contains(key) { + tmpArray = try decodeArray(T.self, forKey: key) + } + + return tmpArray + } + + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] + + for key in allKeys { + if !excludedKeys.contains(key) { + let value = try decode(T.self, forKey: key) + map[key] = value + } + } + + return map + } + +} + + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift new file mode 100644 index 00000000000..ca05906d420 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -0,0 +1,54 @@ +// +// JSONDataEncoding.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + +public struct JSONDataEncoding: ParameterEncoding { + + // MARK: Properties + + private static let jsonDataKey = "jsonData" + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. This should have a single key/value + /// pair with "jsonData" as the key and a Data object as the value. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { + return urlRequest + } + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = jsonData + + return urlRequest + } + + public static func encodingParameters(jsonData: Data?) -> Parameters? { + var returnedParams: Parameters? = nil + if let jsonData = jsonData, !jsonData.isEmpty { + var params = Parameters() + params[jsonDataKey] = jsonData + returnedParams = params + } + return returnedParams + } + +} diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift new file mode 100644 index 00000000000..70449515842 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -0,0 +1,43 @@ +// +// JSONEncodingHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + +open class JSONEncodingHelper { + + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? = nil + + // Encode the Encodable object + if let encodableObj = encodableObj { + let encodeResult = CodableHelper.encode(encodableObj, prettyPrint: true) + if encodeResult.error == nil { + params = JSONDataEncoding.encodingParameters(jsonData: encodeResult.data) + } + } + + return params + } + + open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { + var params: Parameters? = nil + + if let encodableObj = encodableObj { + do { + let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) + params = JSONDataEncoding.encodingParameters(jsonData: data) + } catch { + print(error) + return nil + } + } + + return params + } + +} diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift new file mode 100644 index 00000000000..42f8186ae4a --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -0,0 +1,36 @@ +// Models.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +protocol JSONEncodable { + func encodeToJSON() -> Any +} + +public enum ErrorResponse : Error { + case error(Int, Data?, Error) +} + +open class Response { + open let statusCode: Int + open let header: [String: String] + open let body: T? + + public init(statusCode: Int, header: [String: String], body: T?) { + self.statusCode = statusCode + self.header = header + self.body = body + } + + public convenience init(response: HTTPURLResponse, body: T?) { + let rawHeader = response.allHeaderFields + var header = [String:String]() + for case let (key, value) as (String, String) in rawHeader { + header[key] = value + } + self.init(statusCode: response.statusCode, header: header, body: body) + } +} diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift new file mode 100644 index 00000000000..4e018486ad7 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -0,0 +1,29 @@ +// +// AdditionalPropertiesClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct AdditionalPropertiesClass: Codable { + + public var mapProperty: [String:String]? + public var mapOfMapProperty: [String:[String:String]]? + + public init(mapProperty: [String:String]?, mapOfMapProperty: [String:[String:String]]?) { + self.mapProperty = mapProperty + self.mapOfMapProperty = mapOfMapProperty + } + + public enum CodingKeys: String, CodingKey { + case mapProperty = "map_property" + case mapOfMapProperty = "map_of_map_property" + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift new file mode 100644 index 00000000000..7221a1be099 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -0,0 +1,24 @@ +// +// Animal.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Animal: Codable { + + public var className: String + public var color: String? = "red" + + public init(className: String, color: String?) { + self.className = className + self.color = color + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift new file mode 100644 index 00000000000..e7bea63f8ed --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -0,0 +1,11 @@ +// +// AnimalFarm.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift new file mode 100644 index 00000000000..a22e9aaebbb --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -0,0 +1,26 @@ +// +// ApiResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ApiResponse: Codable { + + public var code: Int? + public var type: String? + public var message: String? + + public init(code: Int?, type: String?, message: String?) { + self.code = code + self.type = type + self.message = message + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift new file mode 100644 index 00000000000..4e5a5ca1445 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -0,0 +1,26 @@ +// +// ArrayOfArrayOfNumberOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ArrayOfArrayOfNumberOnly: Codable { + + public var arrayArrayNumber: [[Double]]? + + public init(arrayArrayNumber: [[Double]]?) { + self.arrayArrayNumber = arrayArrayNumber + } + + public enum CodingKeys: String, CodingKey { + case arrayArrayNumber = "ArrayArrayNumber" + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift new file mode 100644 index 00000000000..7d059d36833 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -0,0 +1,26 @@ +// +// ArrayOfNumberOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ArrayOfNumberOnly: Codable { + + public var arrayNumber: [Double]? + + public init(arrayNumber: [Double]?) { + self.arrayNumber = arrayNumber + } + + public enum CodingKeys: String, CodingKey { + case arrayNumber = "ArrayNumber" + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift new file mode 100644 index 00000000000..9c56fed50c2 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -0,0 +1,32 @@ +// +// ArrayTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ArrayTest: Codable { + + public var arrayOfString: [String]? + public var arrayArrayOfInteger: [[Int64]]? + public var arrayArrayOfModel: [[ReadOnlyFirst]]? + + public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + self.arrayOfString = arrayOfString + self.arrayArrayOfInteger = arrayArrayOfInteger + self.arrayArrayOfModel = arrayArrayOfModel + } + + public enum CodingKeys: String, CodingKey { + case arrayOfString = "array_of_string" + case arrayArrayOfInteger = "array_array_of_integer" + case arrayArrayOfModel = "array_array_of_model" + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift new file mode 100644 index 00000000000..98cda23dac9 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -0,0 +1,42 @@ +// +// Capitalization.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Capitalization: Codable { + + public var smallCamel: String? + public var capitalCamel: String? + public var smallSnake: String? + public var capitalSnake: String? + public var sCAETHFlowPoints: String? + /** Name of the pet */ + public var ATT_NAME: String? + + public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + self.smallCamel = smallCamel + self.capitalCamel = capitalCamel + self.smallSnake = smallSnake + self.capitalSnake = capitalSnake + self.sCAETHFlowPoints = sCAETHFlowPoints + self.ATT_NAME = ATT_NAME + } + + public enum CodingKeys: String, CodingKey { + case smallCamel + case capitalCamel = "CapitalCamel" + case smallSnake = "small_Snake" + case capitalSnake = "Capital_Snake" + case sCAETHFlowPoints = "SCA_ETH_Flow_Points" + case ATT_NAME + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift new file mode 100644 index 00000000000..a116d964ea8 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -0,0 +1,26 @@ +// +// Cat.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Cat: Codable { + + public var className: String + public var color: String? = "red" + public var declawed: Bool? + + public init(className: String, color: String?, declawed: Bool?) { + self.className = className + self.color = color + self.declawed = declawed + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift new file mode 100644 index 00000000000..77fba95c1d7 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -0,0 +1,29 @@ +// +// Category.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Category: Codable { + + public var _id: Int64? + public var name: String? + + public init(_id: Int64?, name: String?) { + self._id = _id + self.name = name + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case name + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift new file mode 100644 index 00000000000..f673ed127cd --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -0,0 +1,23 @@ +// +// ClassModel.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Model for testing model with \"_class\" property */ + +public struct ClassModel: Codable { + + public var _class: String? + + public init(_class: String?) { + self._class = _class + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift new file mode 100644 index 00000000000..51390b6c4ea --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -0,0 +1,22 @@ +// +// Client.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Client: Codable { + + public var client: String? + + public init(client: String?) { + self.client = client + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift new file mode 100644 index 00000000000..239ce74dcc2 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -0,0 +1,26 @@ +// +// Dog.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Dog: Codable { + + public var className: String + public var color: String? = "red" + public var breed: String? + + public init(className: String, color: String?, breed: String?) { + self.className = className + self.color = color + self.breed = breed + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift new file mode 100644 index 00000000000..8713961520e --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -0,0 +1,37 @@ +// +// EnumArrays.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct EnumArrays: Codable { + + public enum JustSymbol: String, Codable { + case greaterThanOrEqualTo = ">=" + case dollar = "$" + } + public enum ArrayEnum: String, Codable { + case fish = "fish" + case crab = "crab" + } + public var justSymbol: JustSymbol? + public var arrayEnum: [ArrayEnum]? + + public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + self.justSymbol = justSymbol + self.arrayEnum = arrayEnum + } + + public enum CodingKeys: String, CodingKey { + case justSymbol = "just_symbol" + case arrayEnum = "array_enum" + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift new file mode 100644 index 00000000000..7280a621fec --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -0,0 +1,15 @@ +// +// EnumClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +public enum EnumClass: String, Codable { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" +} diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift new file mode 100644 index 00000000000..0f546c76a21 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -0,0 +1,56 @@ +// +// EnumTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct EnumTest: Codable { + + public enum EnumString: String, Codable { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } + public enum EnumStringRequired: String, Codable { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } + public enum EnumInteger: Int, Codable { + case _1 = 1 + case number1 = -1 + } + public enum EnumNumber: Double, Codable { + case _11 = 1.1 + case number12 = -1.2 + } + public var enumString: EnumString? + public var enumStringRequired: EnumStringRequired + public var enumInteger: EnumInteger? + public var enumNumber: EnumNumber? + public var outerEnum: OuterEnum? + + public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + self.enumString = enumString + self.enumStringRequired = enumStringRequired + self.enumInteger = enumInteger + self.enumNumber = enumNumber + self.outerEnum = outerEnum + } + + public enum CodingKeys: String, CodingKey { + case enumString = "enum_string" + case enumStringRequired = "enum_string_required" + case enumInteger = "enum_integer" + case enumNumber = "enum_number" + case outerEnum + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift new file mode 100644 index 00000000000..faa091b0658 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -0,0 +1,46 @@ +// +// FormatTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct FormatTest: Codable { + + public var integer: Int? + public var int32: Int? + public var int64: Int64? + public var number: Double + public var float: Float? + public var double: Double? + public var string: String? + public var byte: Data + public var binary: URL? + public var date: Date + public var dateTime: Date? + public var uuid: UUID? + public var password: String + + public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + self.integer = integer + self.int32 = int32 + self.int64 = int64 + self.number = number + self.float = float + self.double = double + self.string = string + self.byte = byte + self.binary = binary + self.date = date + self.dateTime = dateTime + self.uuid = uuid + self.password = password + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift new file mode 100644 index 00000000000..554aee1081a --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -0,0 +1,24 @@ +// +// HasOnlyReadOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct HasOnlyReadOnly: Codable { + + public var bar: String? + public var foo: String? + + public init(bar: String?, foo: String?) { + self.bar = bar + self.foo = foo + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift new file mode 100644 index 00000000000..8997340ff4b --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -0,0 +1,26 @@ +// +// List.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct List: Codable { + + public var _123list: String? + + public init(_123list: String?) { + self._123list = _123list + } + + public enum CodingKeys: String, CodingKey { + case _123list = "123-list" + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift new file mode 100644 index 00000000000..dfbbee8428e --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -0,0 +1,33 @@ +// +// MapTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct MapTest: Codable { + + public enum MapOfEnumString: String, Codable { + case upper = "UPPER" + case lower = "lower" + } + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?) { + self.mapMapOfString = mapMapOfString + self.mapOfEnumString = mapOfEnumString + } + + public enum CodingKeys: String, CodingKey { + case mapMapOfString = "map_map_of_string" + case mapOfEnumString = "map_of_enum_string" + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift new file mode 100644 index 00000000000..7116108fd7a --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -0,0 +1,26 @@ +// +// MixedPropertiesAndAdditionalPropertiesClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + + public var uuid: UUID? + public var dateTime: Date? + public var map: [String:Animal]? + + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + self.uuid = uuid + self.dateTime = dateTime + self.map = map + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift new file mode 100644 index 00000000000..fc1d0606b7b --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -0,0 +1,30 @@ +// +// Model200Response.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Model for testing model name starting with number */ + +public struct Model200Response: Codable { + + public var name: Int? + public var _class: String? + + public init(name: Int?, _class: String?) { + self.name = name + self._class = _class + } + + public enum CodingKeys: String, CodingKey { + case name + case _class = "class" + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift new file mode 100644 index 00000000000..cc165d767d9 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -0,0 +1,36 @@ +// +// Name.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Model for testing model name same as property name */ + +public struct Name: Codable { + + public var name: Int + public var snakeCase: Int? + public var property: String? + public var _123number: Int? + + public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { + self.name = name + self.snakeCase = snakeCase + self.property = property + self._123number = _123number + } + + public enum CodingKeys: String, CodingKey { + case name + case snakeCase = "snake_case" + case property + case _123number = "123Number" + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift new file mode 100644 index 00000000000..e6fb206093a --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -0,0 +1,26 @@ +// +// NumberOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct NumberOnly: Codable { + + public var justNumber: Double? + + public init(justNumber: Double?) { + self.justNumber = justNumber + } + + public enum CodingKeys: String, CodingKey { + case justNumber = "JustNumber" + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift new file mode 100644 index 00000000000..5cad29458b7 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -0,0 +1,47 @@ +// +// Order.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Order: Codable { + + public enum Status: String, Codable { + case placed = "placed" + case approved = "approved" + case delivered = "delivered" + } + public var _id: Int64? + public var petId: Int64? + public var quantity: Int? + public var shipDate: Date? + /** Order Status */ + public var status: Status? + public var complete: Bool? = false + + public init(_id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + self._id = _id + self.petId = petId + self.quantity = quantity + self.shipDate = shipDate + self.status = status + self.complete = complete + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case petId + case quantity + case shipDate + case status + case complete + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift new file mode 100644 index 00000000000..edc4523d9f0 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -0,0 +1,32 @@ +// +// OuterComposite.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct OuterComposite: Codable { + + public var myNumber: Double? + public var myString: String? + public var myBoolean: Bool? + + public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { + self.myNumber = myNumber + self.myString = myString + self.myBoolean = myBoolean + } + + public enum CodingKeys: String, CodingKey { + case myNumber = "my_number" + case myString = "my_string" + case myBoolean = "my_boolean" + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift new file mode 100644 index 00000000000..bd1643d279e --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -0,0 +1,15 @@ +// +// OuterEnum.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +public enum OuterEnum: String, Codable { + case placed = "placed" + case approved = "approved" + case delivered = "delivered" +} diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift new file mode 100644 index 00000000000..3773bf53317 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -0,0 +1,47 @@ +// +// Pet.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Pet: Codable { + + public enum Status: String, Codable { + case available = "available" + case pending = "pending" + case sold = "sold" + } + public var _id: Int64? + public var category: Category? + public var name: String + public var photoUrls: [String] + public var tags: [Tag]? + /** pet status in the store */ + public var status: Status? + + public init(_id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + self._id = _id + self.category = category + self.name = name + self.photoUrls = photoUrls + self.tags = tags + self.status = status + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case category + case name + case photoUrls + case tags + case status + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift new file mode 100644 index 00000000000..48b655a5b0a --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -0,0 +1,24 @@ +// +// ReadOnlyFirst.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ReadOnlyFirst: Codable { + + public var bar: String? + public var baz: String? + + public init(bar: String?, baz: String?) { + self.bar = bar + self.baz = baz + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift new file mode 100644 index 00000000000..de4b218999b --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -0,0 +1,27 @@ +// +// Return.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Model for testing reserved words */ + +public struct Return: Codable { + + public var _return: Int? + + public init(_return: Int?) { + self._return = _return + } + + public enum CodingKeys: String, CodingKey { + case _return = "return" + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift new file mode 100644 index 00000000000..213d896ba98 --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -0,0 +1,26 @@ +// +// SpecialModelName.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct SpecialModelName: Codable { + + public var specialPropertyName: Int64? + + public init(specialPropertyName: Int64?) { + self.specialPropertyName = specialPropertyName + } + + public enum CodingKeys: String, CodingKey { + case specialPropertyName = "$special[property.name]" + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift new file mode 100644 index 00000000000..20f50efd3ac --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -0,0 +1,29 @@ +// +// Tag.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Tag: Codable { + + public var _id: Int64? + public var name: String? + + public init(_id: Int64?, name: String?) { + self._id = _id + self.name = name + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case name + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift new file mode 100644 index 00000000000..d9c564d2a1f --- /dev/null +++ b/samples/client/petstore/swift4/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -0,0 +1,48 @@ +// +// User.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct User: Codable { + + public var _id: Int64? + public var username: String? + public var firstName: String? + public var lastName: String? + public var email: String? + public var password: String? + public var phone: String? + /** User Status */ + public var userStatus: Int? + + public init(_id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + self._id = _id + self.username = username + self.firstName = firstName + self.lastName = lastName + self.email = email + self.password = password + self.phone = phone + self.userStatus = userStatus + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case username + case firstName + case lastName + case email + case password + case phone + case userStatus + } + + +} + diff --git a/samples/client/petstore/swift4/rxswift/git_push.sh b/samples/client/petstore/swift4/rxswift/git_push.sh index ae01b182ae9..8442b80bb44 100644 --- a/samples/client/petstore/swift4/rxswift/git_push.sh +++ b/samples/client/petstore/swift4/rxswift/git_push.sh @@ -1,7 +1,7 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 diff --git a/samples/client/petstore/swift4/unwrapRequired/.gitignore b/samples/client/petstore/swift4/unwrapRequired/.gitignore new file mode 100644 index 00000000000..5e5d5cebcf4 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/.gitignore @@ -0,0 +1,63 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +build/ +DerivedData + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata + +## Other +*.xccheckout +*.moved-aside +*.xcuserstate +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +.build/ + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md + +fastlane/report.xml +fastlane/screenshots diff --git a/samples/client/petstore/swift4/unwrapRequired/.openapi-generator-ignore b/samples/client/petstore/swift4/unwrapRequired/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/swift4/unwrapRequired/.openapi-generator/VERSION b/samples/client/petstore/swift4/unwrapRequired/.openapi-generator/VERSION new file mode 100644 index 00000000000..ad121e8340e --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/.openapi-generator/VERSION @@ -0,0 +1 @@ +3.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/unwrapRequired/Cartfile b/samples/client/petstore/swift4/unwrapRequired/Cartfile new file mode 100644 index 00000000000..f1823fda9ab --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/Cartfile @@ -0,0 +1 @@ +github "Alamofire/Alamofire" ~> 4.5.0 diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.podspec b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.podspec new file mode 100644 index 00000000000..c8453cdd8e0 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.podspec @@ -0,0 +1,14 @@ +Pod::Spec.new do |s| + s.name = 'PetstoreClient' + s.ios.deployment_target = '9.0' + s.osx.deployment_target = '10.11' + s.tvos.deployment_target = '9.0' + s.version = '0.0.1' + s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } + s.authors = '' + s.license = 'Proprietary' + s.homepage = 'https://github.com/openapitools/openapi-generator' + s.summary = 'PetstoreClient' + s.source_files = 'PetstoreClient/Classes/**/*.swift' + s.dependency 'Alamofire', '~> 4.5.0' +end diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift new file mode 100644 index 00000000000..3c7b53f8149 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -0,0 +1,65 @@ +// APIHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct APIHelper { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + let destination = source.reduce(into: [String: Any]()) { (result, item) in + if let value = item.value { + result[item.key] = value + } + } + + if destination.isEmpty { + return nil + } + return destination + } + + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + return source.reduce(into: [String: String]()) { (result, item) in + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + } else if let value: Any = item.value { + result[item.key] = "\(value)" + } + } + } + + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + guard let source = source else { + return nil + } + + return source.reduce(into: [String: Any](), { (result, item) in + switch item.value { + case let x as Bool: + result[item.key] = x.description + default: + result[item.key] = item.value + } + }) + } + + + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in + if let collection = item.value as? Array { + let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") + result.append(URLQueryItem(name: item.key, value: value)) + } else if let value = item.value { + result.append(URLQueryItem(name: item.key, value: "\(value)")) + } + } + + if destination.isEmpty { + return nil + } + return destination + } +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift new file mode 100644 index 00000000000..8cae3aacfe5 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -0,0 +1,61 @@ +// APIs.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class PetstoreClientAPI { + open static var basePath = "http://petstore.swagger.io:80/v2" + open static var credential: URLCredential? + open static var customHeaders: [String:String] = [:] + open static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() +} + +open class RequestBuilder { + var credential: URLCredential? + var headers: [String:String] + public let parameters: [String:Any]? + public let isBody: Bool + public let method: String + public let URLString: String + + /// Optional block to obtain a reference to the request's progress instance when available. + public var onProgressReady: ((Progress) -> ())? + + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + self.method = method + self.URLString = URLString + self.parameters = parameters + self.isBody = isBody + self.headers = headers + + addHeaders(PetstoreClientAPI.customHeaders) + } + + open func addHeaders(_ aHeaders:[String:String]) { + for (header, value) in aHeaders { + headers[header] = value + } + } + + open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { } + + public func addHeader(name: String, value: String) -> Self { + if !value.isEmpty { + headers[name] = value + } + return self + } + + open func addCredential() -> Self { + self.credential = PetstoreClientAPI.credential + return self + } +} + +public protocol RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift new file mode 100644 index 00000000000..f8313034a66 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -0,0 +1,46 @@ +// +// AnotherFakeAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + + + +open class AnotherFakeAPI { + /** + To test special tags + + - parameter client: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + To test special tags + - PATCH /another-fake/dummy + - To test special tags + - parameter client: (body) client model + - returns: RequestBuilder + */ + open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { + let path = "/another-fake/dummy" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: client) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift new file mode 100644 index 00000000000..d22ed47557e --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -0,0 +1,499 @@ +// +// FakeAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + + + +open class FakeAPI { + /** + + - parameter body: (body) Input boolean as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { + fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + - POST /fake/outer/boolean + - Test serialization of outer boolean types + - parameter body: (body) Input boolean as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { + let path = "/fake/outer/boolean" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter outerComposite: (body) Input composite as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + - POST /fake/outer/composite + - Test serialization of object with outer number type + - parameter outerComposite: (body) Input composite as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { + let path = "/fake/outer/composite" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: outerComposite) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter body: (body) Input number as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { + fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + - POST /fake/outer/number + - Test serialization of outer number types + - parameter body: (body) Input number as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { + let path = "/fake/outer/number" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter body: (body) Input string as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + - POST /fake/outer/string + - Test serialization of outer string types + - parameter body: (body) Input string as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { + let path = "/fake/outer/string" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter query: (query) + - parameter user: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithQueryParams(query: String, user: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + - PUT /fake/body-with-query-params + - parameter query: (query) + - parameter user: (body) + - returns: RequestBuilder + */ + open class func testBodyWithQueryParamsWithRequestBuilder(query: String, user: User) -> RequestBuilder { + let path = "/fake/body-with-query-params" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "query": query + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + To test \"client\" model + + - parameter client: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + To test \"client\" model + - PATCH /fake + - To test \"client\" model + - parameter client: (body) client model + - returns: RequestBuilder + */ + open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: client) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + - parameter number: (form) None + - parameter double: (form) None + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter float: (form) None (optional) + - parameter string: (form) None (optional) + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - POST /fake + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - BASIC: + - type: http + - name: http_basic_test + - parameter number: (form) None + - parameter double: (form) None + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter float: (form) None (optional) + - parameter string: (form) None (optional) + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + - returns: RequestBuilder + */ + open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "integer": integer?.encodeToJSON(), + "int32": int32?.encodeToJSON(), + "int64": int64?.encodeToJSON(), + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date?.encodeToJSON(), + "dateTime": dateTime?.encodeToJSON(), + "password": password, + "callback": callback + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + * enum for parameter enumHeaderStringArray + */ + public enum EnumHeaderStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumHeaderString + */ + public enum EnumHeaderString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + * enum for parameter enumQueryStringArray + */ + public enum EnumQueryStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumQueryString + */ + public enum EnumQueryString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + * enum for parameter enumQueryInteger + */ + public enum EnumQueryInteger_testEnumParameters: Int { + case _1 = 1 + case number2 = -2 + } + + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + + /** + * enum for parameter enumFormStringArray + */ + public enum EnumFormStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumFormString + */ + public enum EnumFormString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + To test enum parameters + + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to "$") + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to "-efg") + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + To test enum parameters + - GET /fake + - To test enum parameters + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to "$") + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to "-efg") + - returns: RequestBuilder + */ + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString?.rawValue + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "enum_query_string_array": enumQueryStringArray, + "enum_query_string": enumQueryString?.rawValue, + "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue + ]) + let nillableHeaders: [String: Any?] = [ + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString?.rawValue + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + test inline additionalProperties + + - parameter requestBody: (body) request body + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testInlineAdditionalProperties(requestBody: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(requestBody: requestBody).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + test inline additionalProperties + - POST /fake/inline-additionalProperties + - parameter requestBody: (body) request body + - returns: RequestBuilder + */ + open class func testInlineAdditionalPropertiesWithRequestBuilder(requestBody: [String:String]) -> RequestBuilder { + let path = "/fake/inline-additionalProperties" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: requestBody) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + test json serialization of form data + + - parameter param: (form) field1 + - parameter param2: (form) field2 + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + test json serialization of form data + - GET /fake/jsonFormData + - parameter param: (form) field1 + - parameter param2: (form) field2 + - returns: RequestBuilder + */ + open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { + let path = "/fake/jsonFormData" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "param": param, + "param2": param2 + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift new file mode 100644 index 00000000000..8bb79ddd28f --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -0,0 +1,49 @@ +// +// FakeClassnameTags123API.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + + + +open class FakeClassnameTags123API { + /** + To test class name in snake case + + - parameter client: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testClassname(client: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + To test class name in snake case + - PATCH /fake_classname_test + - To test class name in snake case + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query + - parameter client: (body) client model + - returns: RequestBuilder + */ + open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { + let path = "/fake_classname_test" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: client) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift new file mode 100644 index 00000000000..c525e66cce5 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -0,0 +1,358 @@ +// +// PetAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + + + +open class PetAPI { + /** + Add a new pet to the store + + - parameter pet: (body) Pet object that needs to be added to the store + - parameter completion: completion handler to receive the data and the error objects + */ + open class func addPet(pet: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Add a new pet to the store + - POST /pet + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter pet: (body) Pet object that needs to be added to the store + - returns: RequestBuilder + */ + open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { + let path = "/pet" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: pet) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Deletes a pet + + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Deletes a pet + - DELETE /pet/{petId} + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + - returns: RequestBuilder + */ + open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + let nillableHeaders: [String: Any?] = [ + "api_key": apiKey + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + * enum for parameter status + */ + public enum Status_findPetsByStatus: String { + case available = "available" + case pending = "pending" + case sold = "sold" + } + + /** + Finds Pets by status + + - parameter status: (query) Status values that need to be considered for filter + - parameter completion: completion handler to receive the data and the error objects + */ + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + Finds Pets by status + - GET /pet/findByStatus + - Multiple status values can be provided with comma separated strings + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter status: (query) Status values that need to be considered for filter + - returns: RequestBuilder<[Pet]> + */ + open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + let path = "/pet/findByStatus" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "status": status + ]) + + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Finds Pets by tags + + - parameter tags: (query) Tags to filter by + - parameter completion: completion handler to receive the data and the error objects + */ + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + Finds Pets by tags + - GET /pet/findByTags + - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter tags: (query) Tags to filter by + - returns: RequestBuilder<[Pet]> + */ + open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { + let path = "/pet/findByTags" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "tags": tags + ]) + + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Find pet by ID + + - parameter petId: (path) ID of pet to return + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { + getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + Find pet by ID + - GET /pet/{petId} + - Returns a single pet + - API Key: + - type: apiKey api_key + - name: api_key + - parameter petId: (path) ID of pet to return + - returns: RequestBuilder + */ + open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Update an existing pet + + - parameter pet: (body) Pet object that needs to be added to the store + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updatePet(pet: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Update an existing pet + - PUT /pet + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter pet: (body) Pet object that needs to be added to the store + - returns: RequestBuilder + */ + open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { + let path = "/pet" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: pet) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Updates a pet in the store with form data + + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Updates a pet in the store with form data + - POST /pet/{petId} + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - returns: RequestBuilder + */ + open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "name": name, + "status": status + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + uploads an image + + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + uploads an image + - POST /pet/{petId}/uploadImage + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { + var path = "/pet/{petId}/uploadImage" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "additionalMetadata": additionalMetadata, + "file": file + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift new file mode 100644 index 00000000000..920eff9816b --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -0,0 +1,152 @@ +// +// StoreAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + + + +open class StoreAPI { + /** + Delete purchase order by ID + + - parameter orderId: (path) ID of the order that needs to be deleted + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Delete purchase order by ID + - DELETE /store/order/{order_id} + - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + - parameter orderId: (path) ID of the order that needs to be deleted + - returns: RequestBuilder + */ + open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { + var path = "/store/order/{order_id}" + let orderIdPreEscape = "\(orderId)" + let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Returns pet inventories by status + + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { + getInventoryWithRequestBuilder().execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + Returns pet inventories by status + - GET /store/inventory + - Returns a map of status codes to quantities + - API Key: + - type: apiKey api_key + - name: api_key + - returns: RequestBuilder<[String:Int]> + */ + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + let path = "/store/inventory" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Find purchase order by ID + + - parameter orderId: (path) ID of pet that needs to be fetched + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + Find purchase order by ID + - GET /store/order/{order_id} + - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + - parameter orderId: (path) ID of pet that needs to be fetched + - returns: RequestBuilder + */ + open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { + var path = "/store/order/{order_id}" + let orderIdPreEscape = "\(orderId)" + let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Place an order for a pet + + - parameter order: (body) order placed for purchasing the pet + - parameter completion: completion handler to receive the data and the error objects + */ + open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + Place an order for a pet + - POST /store/order + - parameter order: (body) order placed for purchasing the pet + - returns: RequestBuilder + */ + open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { + let path = "/store/order" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: order) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift new file mode 100644 index 00000000000..e9457fc88a6 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -0,0 +1,305 @@ +// +// UserAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + + + +open class UserAPI { + /** + Create user + + - parameter user: (body) Created user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUser(user: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Create user + - POST /user + - This can only be done by the logged in user. + - parameter user: (body) Created user object + - returns: RequestBuilder + */ + open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { + let path = "/user" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Creates list of users with given input array + - POST /user/createWithArray + - parameter user: (body) List of user object + - returns: RequestBuilder + */ + open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { + let path = "/user/createWithArray" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUsersWithListInput(user: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Creates list of users with given input array + - POST /user/createWithList + - parameter user: (body) List of user object + - returns: RequestBuilder + */ + open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { + let path = "/user/createWithList" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Delete user + + - parameter username: (path) The name that needs to be deleted + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Delete user + - DELETE /user/{username} + - This can only be done by the logged in user. + - parameter username: (path) The name that needs to be deleted + - returns: RequestBuilder + */ + open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(username)" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Get user by user name + + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { + getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + Get user by user name + - GET /user/{username} + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - returns: RequestBuilder + */ + open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(username)" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Logs user into the system + + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - parameter completion: completion handler to receive the data and the error objects + */ + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + Logs user into the system + - GET /user/login + - responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)] + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - returns: RequestBuilder + */ + open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { + let path = "/user/login" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "username": username, + "password": password + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Logs out current logged in user session + + - parameter completion: completion handler to receive the data and the error objects + */ + open class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Logs out current logged in user session + - GET /user/logout + - returns: RequestBuilder + */ + open class func logoutUserWithRequestBuilder() -> RequestBuilder { + let path = "/user/logout" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Updated user + + - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updateUser(username: String, user: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + + /** + Updated user + - PUT /user/{username} + - This can only be done by the logged in user. + - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object + - returns: RequestBuilder + */ + open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(username)" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift new file mode 100644 index 00000000000..280b4e53389 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -0,0 +1,413 @@ +// AlamofireImplementations.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + +class AlamofireRequestBuilderFactory: RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type { + return AlamofireRequestBuilder.self + } + + func getBuilder() -> RequestBuilder.Type { + return AlamofireDecodableRequestBuilder.self + } +} + +// Store manager to retain its reference +private var managerStore: [String: Alamofire.SessionManager] = [:] + +open class AlamofireRequestBuilder: RequestBuilder { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) + } + + /** + May be overridden by a subclass if you want to control the session + configuration. + */ + open func createSessionManager() -> Alamofire.SessionManager { + let configuration = URLSessionConfiguration.default + configuration.httpAdditionalHeaders = buildHeaders() + return Alamofire.SessionManager(configuration: configuration) + } + + /** + May be overridden by a subclass if you want to control the Content-Type + that is given to an uploaded form part. + + Return nil to use the default behavior (inferring the Content-Type from + the file extension). Return the desired Content-Type otherwise. + */ + open func contentTypeForFormPart(fileURL: URL) -> String? { + return nil + } + + /** + May be overridden by a subclass if you want to control the request + configuration (e.g. to override the cache policy). + */ + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { + return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) + } + + override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + let managerId:String = UUID().uuidString + // Create a new manager for each request to customize its request header + let manager = createSessionManager() + managerStore[managerId] = manager + + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + + let xMethod = Alamofire.HTTPMethod(rawValue: method) + let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } + .map { $0.0 } + + if fileKeys.count > 0 { + manager.upload(multipartFormData: { mpForm in + for (k, v) in self.parameters! { + switch v { + case let fileURL as URL: + if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { + mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) + } + else { + mpForm.append(fileURL, withName: k) + } + case let string as String: + mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) + case let number as NSNumber: + mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) + default: + fatalError("Unprocessable value \(v) with key \(k)") + } + } + }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in + switch encodingResult { + case .success(let upload, _, _): + if let onProgressReady = self.onProgressReady { + onProgressReady(upload.uploadProgress) + } + self.processRequest(request: upload, managerId, completion) + case .failure(let encodingError): + completion(nil, ErrorResponse.error(415, nil, encodingError)) + } + }) + } else { + let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) + if let onProgressReady = self.onProgressReady { + onProgressReady(request.progress) + } + processRequest(request: request, managerId, completion) + } + + } + + fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + if let credential = self.credential { + request.authenticate(usingCredential: credential) + } + + let cleanupRequest = { + _ = managerStore.removeValue(forKey: managerId) + } + + let validatedRequest = request.validate() + + switch T.self { + case is String.Type: + validatedRequest.responseString(completionHandler: { (stringResponse) in + cleanupRequest() + + if stringResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!) + ) + return + } + + completion( + Response( + response: stringResponse.response!, + body: ((stringResponse.result.value ?? "") as! T) + ), + nil + ) + }) + case is URL.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + do { + + guard !dataResponse.result.isFailure else { + throw DownloadException.responseFailed + } + + guard let data = dataResponse.data else { + throw DownloadException.responseDataMissing + } + + guard let request = request.request else { + throw DownloadException.requestMissing + } + + let fileManager = FileManager.default + let urlRequest = try request.asURLRequest() + let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] + let requestURL = try self.getURL(from: urlRequest) + + var requestPath = try self.getPath(from: requestURL) + + if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { + requestPath = requestPath.appending("/\(headerFileName)") + } + + let filePath = documentsDirectory.appendingPathComponent(requestPath) + let directoryPath = filePath.deletingLastPathComponent().path + + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) + try data.write(to: filePath, options: .atomic) + + completion( + Response( + response: dataResponse.response!, + body: (filePath as! T) + ), + nil + ) + + } catch let requestParserError as DownloadException { + completion(nil, ErrorResponse.error(400, dataResponse.data, requestParserError)) + } catch let error { + completion(nil, ErrorResponse.error(400, dataResponse.data, error)) + } + return + }) + case is Void.Type: + validatedRequest.responseData(completionHandler: { (voidResponse) in + cleanupRequest() + + if voidResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) + ) + return + } + + completion( + Response( + response: voidResponse.response!, + body: nil), + nil + ) + }) + default: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + if dataResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) + ) + return + } + + completion( + Response( + response: dataResponse.response!, + body: (dataResponse.data as! T) + ), + nil + ) + }) + } + } + + open func buildHeaders() -> [String: String] { + var httpHeaders = SessionManager.defaultHTTPHeaders + for (key, value) in self.headers { + httpHeaders[key] = value + } + return httpHeaders + } + + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + + guard let contentDisposition = contentDisposition else { + return nil + } + + let items = contentDisposition.components(separatedBy: ";") + + var filename : String? = nil + + for contentItem in items { + + let filenameKey = "filename=" + guard let range = contentItem.range(of: filenameKey) else { + break + } + + filename = contentItem + return filename? + .replacingCharacters(in: range, with:"") + .replacingOccurrences(of: "\"", with: "") + .trimmingCharacters(in: .whitespacesAndNewlines) + } + + return filename + + } + + fileprivate func getPath(from url : URL) throws -> String { + + guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { + throw DownloadException.requestMissingPath + } + + if path.hasPrefix("/") { + path.remove(at: path.startIndex) + } + + return path + + } + + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + return url + } + +} + +fileprivate enum DownloadException : Error { + case responseDataMissing + case responseFailed + case requestMissing + case requestMissingPath + case requestMissingURL +} + +public enum AlamofireDecodableRequestBuilderError: Error { + case emptyDataResponse + case nilHTTPResponse + case jsonDecoding(DecodingError) + case generalError(Error) +} + +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { + + override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + if let credential = self.credential { + request.authenticate(usingCredential: credential) + } + + let cleanupRequest = { + _ = managerStore.removeValue(forKey: managerId) + } + + let validatedRequest = request.validate() + + switch T.self { + case is String.Type: + validatedRequest.responseString(completionHandler: { (stringResponse) in + cleanupRequest() + + if stringResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error as Error!) + ) + return + } + + completion( + Response( + response: stringResponse.response!, + body: ((stringResponse.result.value ?? "") as! T) + ), + nil + ) + }) + case is Void.Type: + validatedRequest.responseData(completionHandler: { (voidResponse) in + cleanupRequest() + + if voidResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) + ) + return + } + + completion( + Response( + response: voidResponse.response!, + body: nil), + nil + ) + }) + case is Data.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + if dataResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) + ) + return + } + + completion( + Response( + response: dataResponse.response!, + body: (dataResponse.data as! T) + ), + nil + ) + }) + default: + validatedRequest.responseData(completionHandler: { (dataResponse: DataResponse) in + cleanupRequest() + + guard dataResponse.result.isSuccess else { + completion(nil, ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)) + return + } + + guard let data = dataResponse.data, !data.isEmpty else { + completion(nil, ErrorResponse.error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse)) + return + } + + guard let httpResponse = dataResponse.response else { + completion(nil, ErrorResponse.error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse)) + return + } + + var responseObj: Response? = nil + + let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) + if decodeResult.error == nil { + responseObj = Response(response: httpResponse, body: decodeResult.decodableObj) + } + + completion(responseObj, decodeResult.error) + }) + } + } + +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift new file mode 100644 index 00000000000..2d50e463ae1 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -0,0 +1,67 @@ +// +// CodableHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public typealias EncodeResult = (data: Data?, error: Error?) + +open class CodableHelper { + + open static var dateformatter: DateFormatter? + + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { + var returnedDecodable: T? = nil + var returnedError: Error? = nil + + let decoder = JSONDecoder() + if let df = self.dateformatter { + decoder.dateDecodingStrategy = .formatted(df) + } else { + decoder.dataDecodingStrategy = .base64 + let formatter = DateFormatter() + formatter.calendar = Calendar(identifier: .iso8601) + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX" + decoder.dateDecodingStrategy = .formatted(formatter) + } + + do { + returnedDecodable = try decoder.decode(type, from: data) + } catch { + returnedError = error + } + + return (returnedDecodable, returnedError) + } + + open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T : Encodable { + var returnedData: Data? + var returnedError: Error? = nil + + let encoder = JSONEncoder() + if prettyPrint { + encoder.outputFormatting = .prettyPrinted + } + encoder.dataEncodingStrategy = .base64 + let formatter = DateFormatter() + formatter.calendar = Calendar(identifier: .iso8601) + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX" + encoder.dateEncodingStrategy = .formatted(formatter) + + do { + returnedData = try encoder.encode(value) + } catch { + returnedError = error + } + + return (returnedData, returnedError) + } + +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift new file mode 100644 index 00000000000..f8180752b67 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -0,0 +1,15 @@ +// Configuration.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class Configuration { + + // This value is used to configure the date formatter that is used to serialize dates into JSON format. + // You must set it prior to encoding any dates, and it will only be read once. + open static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift new file mode 100644 index 00000000000..abe218b4e7a --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -0,0 +1,173 @@ +// Extensions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +private func encodeIfPossible(_ object: T) -> Any { + if let encodableObject = object as? JSONEncodable { + return encodableObject.encodeToJSON() + } else { + return object as Any + } +} + +extension Array: JSONEncodable { + func encodeToJSON() -> Any { + return self.map(encodeIfPossible) + } +} + +extension Dictionary: JSONEncodable { + func encodeToJSON() -> Any { + var dictionary = [AnyHashable: Any]() + for (key, value) in self { + dictionary[key] = encodeIfPossible(value) + } + return dictionary as Any + } +} + +extension Data: JSONEncodable { + func encodeToJSON() -> Any { + return self.base64EncodedString(options: Data.Base64EncodingOptions()) + } +} + +private let dateFormatter: DateFormatter = { + let fmt = DateFormatter() + fmt.dateFormat = Configuration.dateFormat + fmt.locale = Locale(identifier: "en_US_POSIX") + return fmt +}() + +extension Date: JSONEncodable { + func encodeToJSON() -> Any { + return dateFormatter.string(from: self) as Any + } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { + return self.uuidString + } +} + +extension String: CodingKey { + + public var stringValue: String { + return self + } + + public init?(stringValue: String) { + self.init(stringLiteral: stringValue) + } + + public var intValue: Int? { + return nil + } + + public init?(intValue: Int) { + return nil + } + +} + +extension KeyedEncodingContainerProtocol { + + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + var arrayContainer = nestedUnkeyedContainer(forKey: key) + try arrayContainer.encode(contentsOf: values) + } + + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + if let values = values { + try encodeArray(values, forKey: key) + } + } + + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + for (key, value) in pairs { + try encode(value, forKey: key) + } + } + + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + if let pairs = pairs { + try encodeMap(pairs) + } + } + +} + +extension KeyedDecodingContainerProtocol { + + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + var tmpArray = [T]() + + var nestedContainer = try nestedUnkeyedContainer(forKey: key) + while !nestedContainer.isAtEnd { + let arrayValue = try nestedContainer.decode(T.self) + tmpArray.append(arrayValue) + } + + return tmpArray + } + + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil + + if contains(key) { + tmpArray = try decodeArray(T.self, forKey: key) + } + + return tmpArray + } + + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] + + for key in allKeys { + if !excludedKeys.contains(key) { + let value = try decode(T.self, forKey: key) + map[key] = value + } + } + + return map + } + +} + + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift new file mode 100644 index 00000000000..ca05906d420 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -0,0 +1,54 @@ +// +// JSONDataEncoding.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + +public struct JSONDataEncoding: ParameterEncoding { + + // MARK: Properties + + private static let jsonDataKey = "jsonData" + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. This should have a single key/value + /// pair with "jsonData" as the key and a Data object as the value. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { + return urlRequest + } + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = jsonData + + return urlRequest + } + + public static func encodingParameters(jsonData: Data?) -> Parameters? { + var returnedParams: Parameters? = nil + if let jsonData = jsonData, !jsonData.isEmpty { + var params = Parameters() + params[jsonDataKey] = jsonData + returnedParams = params + } + return returnedParams + } + +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift new file mode 100644 index 00000000000..70449515842 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -0,0 +1,43 @@ +// +// JSONEncodingHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire + +open class JSONEncodingHelper { + + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? = nil + + // Encode the Encodable object + if let encodableObj = encodableObj { + let encodeResult = CodableHelper.encode(encodableObj, prettyPrint: true) + if encodeResult.error == nil { + params = JSONDataEncoding.encodingParameters(jsonData: encodeResult.data) + } + } + + return params + } + + open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { + var params: Parameters? = nil + + if let encodableObj = encodableObj { + do { + let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) + params = JSONDataEncoding.encodingParameters(jsonData: data) + } catch { + print(error) + return nil + } + } + + return params + } + +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift new file mode 100644 index 00000000000..42f8186ae4a --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -0,0 +1,36 @@ +// Models.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +protocol JSONEncodable { + func encodeToJSON() -> Any +} + +public enum ErrorResponse : Error { + case error(Int, Data?, Error) +} + +open class Response { + open let statusCode: Int + open let header: [String: String] + open let body: T? + + public init(statusCode: Int, header: [String: String], body: T?) { + self.statusCode = statusCode + self.header = header + self.body = body + } + + public convenience init(response: HTTPURLResponse, body: T?) { + let rawHeader = response.allHeaderFields + var header = [String:String]() + for case let (key, value) as (String, String) in rawHeader { + header[key] = value + } + self.init(statusCode: response.statusCode, header: header, body: body) + } +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift new file mode 100644 index 00000000000..4e018486ad7 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -0,0 +1,29 @@ +// +// AdditionalPropertiesClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct AdditionalPropertiesClass: Codable { + + public var mapProperty: [String:String]? + public var mapOfMapProperty: [String:[String:String]]? + + public init(mapProperty: [String:String]?, mapOfMapProperty: [String:[String:String]]?) { + self.mapProperty = mapProperty + self.mapOfMapProperty = mapOfMapProperty + } + + public enum CodingKeys: String, CodingKey { + case mapProperty = "map_property" + case mapOfMapProperty = "map_of_map_property" + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift new file mode 100644 index 00000000000..befb84b1dfa --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -0,0 +1,24 @@ +// +// Animal.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Animal: Codable { + + public var className: String? + public var color: String? = "red" + + public init(className: String?, color: String?) { + self.className = className + self.color = color + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift new file mode 100644 index 00000000000..e7bea63f8ed --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -0,0 +1,11 @@ +// +// AnimalFarm.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift new file mode 100644 index 00000000000..a22e9aaebbb --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -0,0 +1,26 @@ +// +// ApiResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ApiResponse: Codable { + + public var code: Int? + public var type: String? + public var message: String? + + public init(code: Int?, type: String?, message: String?) { + self.code = code + self.type = type + self.message = message + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift new file mode 100644 index 00000000000..4e5a5ca1445 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -0,0 +1,26 @@ +// +// ArrayOfArrayOfNumberOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ArrayOfArrayOfNumberOnly: Codable { + + public var arrayArrayNumber: [[Double]]? + + public init(arrayArrayNumber: [[Double]]?) { + self.arrayArrayNumber = arrayArrayNumber + } + + public enum CodingKeys: String, CodingKey { + case arrayArrayNumber = "ArrayArrayNumber" + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift new file mode 100644 index 00000000000..7d059d36833 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -0,0 +1,26 @@ +// +// ArrayOfNumberOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ArrayOfNumberOnly: Codable { + + public var arrayNumber: [Double]? + + public init(arrayNumber: [Double]?) { + self.arrayNumber = arrayNumber + } + + public enum CodingKeys: String, CodingKey { + case arrayNumber = "ArrayNumber" + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift new file mode 100644 index 00000000000..9c56fed50c2 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -0,0 +1,32 @@ +// +// ArrayTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ArrayTest: Codable { + + public var arrayOfString: [String]? + public var arrayArrayOfInteger: [[Int64]]? + public var arrayArrayOfModel: [[ReadOnlyFirst]]? + + public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + self.arrayOfString = arrayOfString + self.arrayArrayOfInteger = arrayArrayOfInteger + self.arrayArrayOfModel = arrayArrayOfModel + } + + public enum CodingKeys: String, CodingKey { + case arrayOfString = "array_of_string" + case arrayArrayOfInteger = "array_array_of_integer" + case arrayArrayOfModel = "array_array_of_model" + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift new file mode 100644 index 00000000000..98cda23dac9 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -0,0 +1,42 @@ +// +// Capitalization.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Capitalization: Codable { + + public var smallCamel: String? + public var capitalCamel: String? + public var smallSnake: String? + public var capitalSnake: String? + public var sCAETHFlowPoints: String? + /** Name of the pet */ + public var ATT_NAME: String? + + public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + self.smallCamel = smallCamel + self.capitalCamel = capitalCamel + self.smallSnake = smallSnake + self.capitalSnake = capitalSnake + self.sCAETHFlowPoints = sCAETHFlowPoints + self.ATT_NAME = ATT_NAME + } + + public enum CodingKeys: String, CodingKey { + case smallCamel + case capitalCamel = "CapitalCamel" + case smallSnake = "small_Snake" + case capitalSnake = "Capital_Snake" + case sCAETHFlowPoints = "SCA_ETH_Flow_Points" + case ATT_NAME + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift new file mode 100644 index 00000000000..c83ab1d0d97 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -0,0 +1,26 @@ +// +// Cat.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Cat: Codable { + + public var className: String? + public var color: String? = "red" + public var declawed: Bool? + + public init(className: String?, color: String?, declawed: Bool?) { + self.className = className + self.color = color + self.declawed = declawed + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift new file mode 100644 index 00000000000..77fba95c1d7 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -0,0 +1,29 @@ +// +// Category.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Category: Codable { + + public var _id: Int64? + public var name: String? + + public init(_id: Int64?, name: String?) { + self._id = _id + self.name = name + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case name + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift new file mode 100644 index 00000000000..f673ed127cd --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -0,0 +1,23 @@ +// +// ClassModel.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Model for testing model with \"_class\" property */ + +public struct ClassModel: Codable { + + public var _class: String? + + public init(_class: String?) { + self._class = _class + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift new file mode 100644 index 00000000000..51390b6c4ea --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -0,0 +1,22 @@ +// +// Client.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Client: Codable { + + public var client: String? + + public init(client: String?) { + self.client = client + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift new file mode 100644 index 00000000000..9a301649533 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -0,0 +1,26 @@ +// +// Dog.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Dog: Codable { + + public var className: String? + public var color: String? = "red" + public var breed: String? + + public init(className: String?, color: String?, breed: String?) { + self.className = className + self.color = color + self.breed = breed + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift new file mode 100644 index 00000000000..8713961520e --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -0,0 +1,37 @@ +// +// EnumArrays.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct EnumArrays: Codable { + + public enum JustSymbol: String, Codable { + case greaterThanOrEqualTo = ">=" + case dollar = "$" + } + public enum ArrayEnum: String, Codable { + case fish = "fish" + case crab = "crab" + } + public var justSymbol: JustSymbol? + public var arrayEnum: [ArrayEnum]? + + public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + self.justSymbol = justSymbol + self.arrayEnum = arrayEnum + } + + public enum CodingKeys: String, CodingKey { + case justSymbol = "just_symbol" + case arrayEnum = "array_enum" + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift new file mode 100644 index 00000000000..7280a621fec --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -0,0 +1,15 @@ +// +// EnumClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +public enum EnumClass: String, Codable { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift new file mode 100644 index 00000000000..ed93ec357bd --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -0,0 +1,56 @@ +// +// EnumTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct EnumTest: Codable { + + public enum EnumString: String, Codable { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } + public enum EnumStringRequired: String, Codable { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } + public enum EnumInteger: Int, Codable { + case _1 = 1 + case number1 = -1 + } + public enum EnumNumber: Double, Codable { + case _11 = 1.1 + case number12 = -1.2 + } + public var enumString: EnumString? + public var enumStringRequired: EnumStringRequired? + public var enumInteger: EnumInteger? + public var enumNumber: EnumNumber? + public var outerEnum: OuterEnum? + + public init(enumString: EnumString?, enumStringRequired: EnumStringRequired?, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + self.enumString = enumString + self.enumStringRequired = enumStringRequired + self.enumInteger = enumInteger + self.enumNumber = enumNumber + self.outerEnum = outerEnum + } + + public enum CodingKeys: String, CodingKey { + case enumString = "enum_string" + case enumStringRequired = "enum_string_required" + case enumInteger = "enum_integer" + case enumNumber = "enum_number" + case outerEnum + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift new file mode 100644 index 00000000000..7b26d8d80e4 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -0,0 +1,46 @@ +// +// FormatTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct FormatTest: Codable { + + public var integer: Int? + public var int32: Int? + public var int64: Int64? + public var number: Double? + public var float: Float? + public var double: Double? + public var string: String? + public var byte: Data? + public var binary: URL? + public var date: Date? + public var dateTime: Date? + public var uuid: UUID? + public var password: String? + + public init(integer: Int?, int32: Int?, int64: Int64?, number: Double?, float: Float?, double: Double?, string: String?, byte: Data?, binary: URL?, date: Date?, dateTime: Date?, uuid: UUID?, password: String?) { + self.integer = integer + self.int32 = int32 + self.int64 = int64 + self.number = number + self.float = float + self.double = double + self.string = string + self.byte = byte + self.binary = binary + self.date = date + self.dateTime = dateTime + self.uuid = uuid + self.password = password + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift new file mode 100644 index 00000000000..554aee1081a --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -0,0 +1,24 @@ +// +// HasOnlyReadOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct HasOnlyReadOnly: Codable { + + public var bar: String? + public var foo: String? + + public init(bar: String?, foo: String?) { + self.bar = bar + self.foo = foo + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift new file mode 100644 index 00000000000..8997340ff4b --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -0,0 +1,26 @@ +// +// List.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct List: Codable { + + public var _123list: String? + + public init(_123list: String?) { + self._123list = _123list + } + + public enum CodingKeys: String, CodingKey { + case _123list = "123-list" + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift new file mode 100644 index 00000000000..dfbbee8428e --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -0,0 +1,33 @@ +// +// MapTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct MapTest: Codable { + + public enum MapOfEnumString: String, Codable { + case upper = "UPPER" + case lower = "lower" + } + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?) { + self.mapMapOfString = mapMapOfString + self.mapOfEnumString = mapOfEnumString + } + + public enum CodingKeys: String, CodingKey { + case mapMapOfString = "map_map_of_string" + case mapOfEnumString = "map_of_enum_string" + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift new file mode 100644 index 00000000000..7116108fd7a --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -0,0 +1,26 @@ +// +// MixedPropertiesAndAdditionalPropertiesClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + + public var uuid: UUID? + public var dateTime: Date? + public var map: [String:Animal]? + + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + self.uuid = uuid + self.dateTime = dateTime + self.map = map + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift new file mode 100644 index 00000000000..fc1d0606b7b --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -0,0 +1,30 @@ +// +// Model200Response.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Model for testing model name starting with number */ + +public struct Model200Response: Codable { + + public var name: Int? + public var _class: String? + + public init(name: Int?, _class: String?) { + self.name = name + self._class = _class + } + + public enum CodingKeys: String, CodingKey { + case name + case _class = "class" + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift new file mode 100644 index 00000000000..bd7ad7ee6f7 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -0,0 +1,36 @@ +// +// Name.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Model for testing model name same as property name */ + +public struct Name: Codable { + + public var name: Int? + public var snakeCase: Int? + public var property: String? + public var _123number: Int? + + public init(name: Int?, snakeCase: Int?, property: String?, _123number: Int?) { + self.name = name + self.snakeCase = snakeCase + self.property = property + self._123number = _123number + } + + public enum CodingKeys: String, CodingKey { + case name + case snakeCase = "snake_case" + case property + case _123number = "123Number" + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift new file mode 100644 index 00000000000..e6fb206093a --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -0,0 +1,26 @@ +// +// NumberOnly.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct NumberOnly: Codable { + + public var justNumber: Double? + + public init(justNumber: Double?) { + self.justNumber = justNumber + } + + public enum CodingKeys: String, CodingKey { + case justNumber = "JustNumber" + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift new file mode 100644 index 00000000000..5cad29458b7 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -0,0 +1,47 @@ +// +// Order.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Order: Codable { + + public enum Status: String, Codable { + case placed = "placed" + case approved = "approved" + case delivered = "delivered" + } + public var _id: Int64? + public var petId: Int64? + public var quantity: Int? + public var shipDate: Date? + /** Order Status */ + public var status: Status? + public var complete: Bool? = false + + public init(_id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + self._id = _id + self.petId = petId + self.quantity = quantity + self.shipDate = shipDate + self.status = status + self.complete = complete + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case petId + case quantity + case shipDate + case status + case complete + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift new file mode 100644 index 00000000000..edc4523d9f0 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -0,0 +1,32 @@ +// +// OuterComposite.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct OuterComposite: Codable { + + public var myNumber: Double? + public var myString: String? + public var myBoolean: Bool? + + public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { + self.myNumber = myNumber + self.myString = myString + self.myBoolean = myBoolean + } + + public enum CodingKeys: String, CodingKey { + case myNumber = "my_number" + case myString = "my_string" + case myBoolean = "my_boolean" + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift new file mode 100644 index 00000000000..bd1643d279e --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -0,0 +1,15 @@ +// +// OuterEnum.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +public enum OuterEnum: String, Codable { + case placed = "placed" + case approved = "approved" + case delivered = "delivered" +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift new file mode 100644 index 00000000000..533e1b86190 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -0,0 +1,47 @@ +// +// Pet.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Pet: Codable { + + public enum Status: String, Codable { + case available = "available" + case pending = "pending" + case sold = "sold" + } + public var _id: Int64? + public var category: Category? + public var name: String? + public var photoUrls: [String]? + public var tags: [Tag]? + /** pet status in the store */ + public var status: Status? + + public init(_id: Int64?, category: Category?, name: String?, photoUrls: [String]?, tags: [Tag]?, status: Status?) { + self._id = _id + self.category = category + self.name = name + self.photoUrls = photoUrls + self.tags = tags + self.status = status + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case category + case name + case photoUrls + case tags + case status + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift new file mode 100644 index 00000000000..48b655a5b0a --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -0,0 +1,24 @@ +// +// ReadOnlyFirst.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct ReadOnlyFirst: Codable { + + public var bar: String? + public var baz: String? + + public init(bar: String?, baz: String?) { + self.bar = bar + self.baz = baz + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift new file mode 100644 index 00000000000..de4b218999b --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -0,0 +1,27 @@ +// +// Return.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + +/** Model for testing reserved words */ + +public struct Return: Codable { + + public var _return: Int? + + public init(_return: Int?) { + self._return = _return + } + + public enum CodingKeys: String, CodingKey { + case _return = "return" + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift new file mode 100644 index 00000000000..213d896ba98 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -0,0 +1,26 @@ +// +// SpecialModelName.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct SpecialModelName: Codable { + + public var specialPropertyName: Int64? + + public init(specialPropertyName: Int64?) { + self.specialPropertyName = specialPropertyName + } + + public enum CodingKeys: String, CodingKey { + case specialPropertyName = "$special[property.name]" + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift new file mode 100644 index 00000000000..20f50efd3ac --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -0,0 +1,29 @@ +// +// Tag.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct Tag: Codable { + + public var _id: Int64? + public var name: String? + + public init(_id: Int64?, name: String?) { + self._id = _id + self.name = name + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case name + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift new file mode 100644 index 00000000000..d9c564d2a1f --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -0,0 +1,48 @@ +// +// User.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + + + +public struct User: Codable { + + public var _id: Int64? + public var username: String? + public var firstName: String? + public var lastName: String? + public var email: String? + public var password: String? + public var phone: String? + /** User Status */ + public var userStatus: Int? + + public init(_id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + self._id = _id + self.username = username + self.firstName = firstName + self.lastName = lastName + self.email = email + self.password = password + self.phone = phone + self.userStatus = userStatus + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case username + case firstName + case lastName + case email + case password + case phone + case userStatus + } + + +} + diff --git a/samples/client/petstore/swift4/unwrapRequired/git_push.sh b/samples/client/petstore/swift4/unwrapRequired/git_push.sh new file mode 100644 index 00000000000..8442b80bb44 --- /dev/null +++ b/samples/client/petstore/swift4/unwrapRequired/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + From e23b2f6fccd4303b3c5a4b0647d49ad450f28003 Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Thu, 21 Jun 2018 18:28:58 +0900 Subject: [PATCH 19/35] [Scala][client] Rename script, sample folder, template dir (#334) * Rename scripts akka-scala-petstore.sh -> scala-akka-petstore.sh * Rename sample folder: akka-scala -> scala-akka * Rename templateDir: akka-scala -> scala-akka-client * Rename scripts: scala-petstore.sh -> scala-httpclient-petstore.sh * Rename sample folder: scala -> scala-httpclient * Rename templateDir: scala -> scala-httpclient * update circle pom.xml for new scala path * remove duplicated scala test --- CI/pom.xml.circleci | 4 ++-- CI/pom.xml.circleci.java7 | 4 ++-- ...kka-scala-petstore.sh => scala-akka-petstore.sh} | 2 +- ...ala-petstore.sh => scala-httpclient-petstore.sh} | 2 +- ...kka-scala-petstore.sh => scala-akka-petstore.sh} | 2 +- ...ala-petstore.sh => scala-httpclient-petstore.sh} | 2 +- ...ala-petstore.sh => scala-httpclient-petstore.sh} | 2 +- ...a-scala-petstore.bat => scala-akka-petstore.bat} | 2 +- ...a-petstore.bat => scala-httpclient-petstore.bat} | 2 +- .../codegen/languages/ScalaAkkaClientCodegen.java | 2 +- .../codegen/languages/ScalaHttpClientCodegen.java | 2 +- .../README.mustache | 0 .../{akka-scala => scala-akka-client}/api.mustache | 0 .../apiInvoker.mustache | 0 .../apiRequest.mustache | 0 .../apiSettings.mustache | 0 .../build.sbt.mustache | 0 .../enumsSerializers.mustache | 0 .../javadoc.mustache | 0 .../licenseInfo.mustache | 0 .../methodParameters.mustache | 0 .../model.mustache | 0 .../operationReturnType.mustache | 0 .../paramCreation.mustache | 0 .../{akka-scala => scala-akka-client}/pom.mustache | 0 .../reference.mustache | 0 .../requests.mustache | 0 .../responseState.mustache | 0 .../{scala => scala-httpclient}/README.mustache | 0 .../{scala => scala-httpclient}/api.mustache | 0 .../{scala => scala-httpclient}/apiInvoker.mustache | 0 .../build.gradle.mustache | 0 .../{scala => scala-httpclient}/build.sbt.mustache | 0 .../{scala => scala-httpclient}/client.mustache | 0 .../git_push.sh.mustache | 0 .../{scala => scala-httpclient}/gitignore.mustache | 0 .../{scala => scala-httpclient}/gradle-wrapper.jar | Bin .../gradle-wrapper.properties.mustache | 0 .../gradle.properties.mustache | 0 .../gradlew.bat.mustache | 0 .../{scala => scala-httpclient}/gradlew.mustache | 0 .../licenseInfo.mustache | 0 .../{scala => scala-httpclient}/model.mustache | 0 .../{scala => scala-httpclient}/pom.mustache | 0 .../settings.gradle.mustache | 0 pom.xml | 6 ++---- .../{scala => scala-httpclient}/.gitignore | 0 .../.openapi-generator-ignore | 0 .../.openapi-generator/VERSION | 0 .../{scala => scala-httpclient}/LICENSE | 0 .../{scala => scala-httpclient}/build.gradle | 0 .../{scala => scala-httpclient}/build.sbt | 0 .../{scala => scala-httpclient}/git_push.sh | 0 .../{scala => scala-httpclient}/gradle.properties | 0 .../gradle/wrapper/gradle-wrapper.jar | Bin .../gradle/wrapper/gradle-wrapper.properties | 0 .../{scala => scala-httpclient}/gradlew | 0 .../{scala => scala-httpclient}/gradlew.bat | 0 .../{scala => scala-httpclient}/pom.xml | 0 .../{scala => scala-httpclient}/settings.gradle | 0 .../main/scala/io/swagger/client/ApiInvoker.scala | 0 .../main/scala/io/swagger/client/AsyncClient.scala | 0 .../main/scala/io/swagger/client/api/FakeApi.scala | 0 .../scala/io/swagger/client/model/ModelReturn.scala | 0 .../.openapi-generator-ignore | 0 .../.openapi-generator/VERSION | 0 .../petstore/{akka-scala => scala-akka}/README.md | 0 .../petstore/{akka-scala => scala-akka}/build.sbt | 0 .../petstore/{akka-scala => scala-akka}/pom.xml | 0 .../src/main/resources/reference.conf | 0 .../openapitools/client/api/EnumsSerializers.scala | 0 .../scala/org/openapitools/client/api/PetApi.scala | 0 .../org/openapitools/client/api/StoreApi.scala | 0 .../scala/org/openapitools/client/api/UserApi.scala | 0 .../org/openapitools/client/core/ApiInvoker.scala | 0 .../org/openapitools/client/core/ApiRequest.scala | 0 .../org/openapitools/client/core/ApiSettings.scala | 0 .../org/openapitools/client/core/requests.scala | 0 .../org/openapitools/client/model/ApiResponse.scala | 0 .../org/openapitools/client/model/Category.scala | 0 .../scala/org/openapitools/client/model/Order.scala | 0 .../scala/org/openapitools/client/model/Pet.scala | 0 .../scala/org/openapitools/client/model/Tag.scala | 0 .../scala/org/openapitools/client/model/User.scala | 0 .../petstore/{scala => scala-httpclient}/.gitignore | 0 .../.openapi-generator-ignore | 0 .../.openapi-generator/VERSION | 0 .../{scala => scala-httpclient}/build.gradle | 0 .../petstore/{scala => scala-httpclient}/build.sbt | 0 .../{scala => scala-httpclient}/git_push.sh | 0 .../{scala => scala-httpclient}/gradle.properties | 0 .../gradle/wrapper/gradle-wrapper.jar | Bin .../gradle/wrapper/gradle-wrapper.properties | 0 .../petstore/{scala => scala-httpclient}/gradlew | 0 .../{scala => scala-httpclient}/gradlew.bat | 0 .../petstore/{scala => scala-httpclient}/pom.xml | 0 .../{scala => scala-httpclient}/settings.gradle | 0 .../scala/org/openapitools/client/ApiInvoker.scala | 0 .../scala/org/openapitools/client/AsyncClient.scala | 0 .../scala/org/openapitools/client/api/PetApi.scala | 0 .../org/openapitools/client/api/StoreApi.scala | 0 .../scala/org/openapitools/client/api/UserApi.scala | 0 .../org/openapitools/client/model/ApiResponse.scala | 0 .../org/openapitools/client/model/Category.scala | 0 .../scala/org/openapitools/client/model/Order.scala | 0 .../scala/org/openapitools/client/model/Pet.scala | 0 .../scala/org/openapitools/client/model/Tag.scala | 0 .../scala/org/openapitools/client/model/User.scala | 0 .../src/test/scala/PetApiTest.scala | 0 .../src/test/scala/StoreApiTest.scala | 0 .../src/test/scala/UserApiTest.scala | 0 111 files changed, 15 insertions(+), 17 deletions(-) rename bin/openapi3/{akka-scala-petstore.sh => scala-akka-petstore.sh} (80%) rename bin/openapi3/{scala-petstore.sh => scala-httpclient-petstore.sh} (84%) rename bin/{akka-scala-petstore.sh => scala-akka-petstore.sh} (81%) rename bin/{scala-petstore.sh => scala-httpclient-petstore.sh} (83%) rename bin/security/{scala-petstore.sh => scala-httpclient-petstore.sh} (81%) rename bin/windows/{akka-scala-petstore.bat => scala-akka-petstore.bat} (88%) rename bin/windows/{scala-petstore.bat => scala-httpclient-petstore.bat} (94%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/README.mustache (100%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/api.mustache (100%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/apiInvoker.mustache (100%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/apiRequest.mustache (100%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/apiSettings.mustache (100%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/build.sbt.mustache (100%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/enumsSerializers.mustache (100%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/javadoc.mustache (100%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/licenseInfo.mustache (100%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/methodParameters.mustache (100%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/model.mustache (100%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/operationReturnType.mustache (100%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/paramCreation.mustache (100%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/pom.mustache (100%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/reference.mustache (100%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/requests.mustache (100%) rename modules/openapi-generator/src/main/resources/{akka-scala => scala-akka-client}/responseState.mustache (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/README.mustache (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/api.mustache (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/apiInvoker.mustache (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/build.gradle.mustache (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/build.sbt.mustache (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/client.mustache (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/git_push.sh.mustache (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/gitignore.mustache (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/gradle-wrapper.jar (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/gradle-wrapper.properties.mustache (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/gradle.properties.mustache (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/gradlew.bat.mustache (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/gradlew.mustache (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/licenseInfo.mustache (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/model.mustache (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/pom.mustache (100%) rename modules/openapi-generator/src/main/resources/{scala => scala-httpclient}/settings.gradle.mustache (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/.gitignore (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/.openapi-generator-ignore (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/.openapi-generator/VERSION (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/LICENSE (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/build.gradle (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/build.sbt (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/git_push.sh (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/gradle.properties (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/gradle/wrapper/gradle-wrapper.jar (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/gradle/wrapper/gradle-wrapper.properties (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/gradlew (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/gradlew.bat (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/pom.xml (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/settings.gradle (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/src/main/scala/io/swagger/client/ApiInvoker.scala (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/src/main/scala/io/swagger/client/AsyncClient.scala (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/src/main/scala/io/swagger/client/api/FakeApi.scala (100%) rename samples/client/petstore-security-test/{scala => scala-httpclient}/src/main/scala/io/swagger/client/model/ModelReturn.scala (100%) rename samples/client/petstore/{akka-scala => scala-akka}/.openapi-generator-ignore (100%) rename samples/client/petstore/{akka-scala => scala-akka}/.openapi-generator/VERSION (100%) rename samples/client/petstore/{akka-scala => scala-akka}/README.md (100%) rename samples/client/petstore/{akka-scala => scala-akka}/build.sbt (100%) rename samples/client/petstore/{akka-scala => scala-akka}/pom.xml (100%) rename samples/client/petstore/{akka-scala => scala-akka}/src/main/resources/reference.conf (100%) rename samples/client/petstore/{akka-scala => scala-akka}/src/main/scala/org/openapitools/client/api/EnumsSerializers.scala (100%) rename samples/client/petstore/{akka-scala => scala-akka}/src/main/scala/org/openapitools/client/api/PetApi.scala (100%) rename samples/client/petstore/{akka-scala => scala-akka}/src/main/scala/org/openapitools/client/api/StoreApi.scala (100%) rename samples/client/petstore/{akka-scala => scala-akka}/src/main/scala/org/openapitools/client/api/UserApi.scala (100%) rename samples/client/petstore/{akka-scala => scala-akka}/src/main/scala/org/openapitools/client/core/ApiInvoker.scala (100%) rename samples/client/petstore/{akka-scala => scala-akka}/src/main/scala/org/openapitools/client/core/ApiRequest.scala (100%) rename samples/client/petstore/{akka-scala => scala-akka}/src/main/scala/org/openapitools/client/core/ApiSettings.scala (100%) rename samples/client/petstore/{akka-scala => scala-akka}/src/main/scala/org/openapitools/client/core/requests.scala (100%) rename samples/client/petstore/{akka-scala => scala-akka}/src/main/scala/org/openapitools/client/model/ApiResponse.scala (100%) rename samples/client/petstore/{akka-scala => scala-akka}/src/main/scala/org/openapitools/client/model/Category.scala (100%) rename samples/client/petstore/{akka-scala => scala-akka}/src/main/scala/org/openapitools/client/model/Order.scala (100%) rename samples/client/petstore/{akka-scala => scala-akka}/src/main/scala/org/openapitools/client/model/Pet.scala (100%) rename samples/client/petstore/{akka-scala => scala-akka}/src/main/scala/org/openapitools/client/model/Tag.scala (100%) rename samples/client/petstore/{akka-scala => scala-akka}/src/main/scala/org/openapitools/client/model/User.scala (100%) rename samples/client/petstore/{scala => scala-httpclient}/.gitignore (100%) rename samples/client/petstore/{scala => scala-httpclient}/.openapi-generator-ignore (100%) rename samples/client/petstore/{scala => scala-httpclient}/.openapi-generator/VERSION (100%) rename samples/client/petstore/{scala => scala-httpclient}/build.gradle (100%) rename samples/client/petstore/{scala => scala-httpclient}/build.sbt (100%) rename samples/client/petstore/{scala => scala-httpclient}/git_push.sh (100%) rename samples/client/petstore/{scala => scala-httpclient}/gradle.properties (100%) rename samples/client/petstore/{scala => scala-httpclient}/gradle/wrapper/gradle-wrapper.jar (100%) rename samples/client/petstore/{scala => scala-httpclient}/gradle/wrapper/gradle-wrapper.properties (100%) rename samples/client/petstore/{scala => scala-httpclient}/gradlew (100%) rename samples/client/petstore/{scala => scala-httpclient}/gradlew.bat (100%) rename samples/client/petstore/{scala => scala-httpclient}/pom.xml (100%) rename samples/client/petstore/{scala => scala-httpclient}/settings.gradle (100%) rename samples/client/petstore/{scala => scala-httpclient}/src/main/scala/org/openapitools/client/ApiInvoker.scala (100%) rename samples/client/petstore/{scala => scala-httpclient}/src/main/scala/org/openapitools/client/AsyncClient.scala (100%) rename samples/client/petstore/{scala => scala-httpclient}/src/main/scala/org/openapitools/client/api/PetApi.scala (100%) rename samples/client/petstore/{scala => scala-httpclient}/src/main/scala/org/openapitools/client/api/StoreApi.scala (100%) rename samples/client/petstore/{scala => scala-httpclient}/src/main/scala/org/openapitools/client/api/UserApi.scala (100%) rename samples/client/petstore/{scala => scala-httpclient}/src/main/scala/org/openapitools/client/model/ApiResponse.scala (100%) rename samples/client/petstore/{scala => scala-httpclient}/src/main/scala/org/openapitools/client/model/Category.scala (100%) rename samples/client/petstore/{scala => scala-httpclient}/src/main/scala/org/openapitools/client/model/Order.scala (100%) rename samples/client/petstore/{scala => scala-httpclient}/src/main/scala/org/openapitools/client/model/Pet.scala (100%) rename samples/client/petstore/{scala => scala-httpclient}/src/main/scala/org/openapitools/client/model/Tag.scala (100%) rename samples/client/petstore/{scala => scala-httpclient}/src/main/scala/org/openapitools/client/model/User.scala (100%) rename samples/client/petstore/{scala => scala-httpclient}/src/test/scala/PetApiTest.scala (100%) rename samples/client/petstore/{scala => scala-httpclient}/src/test/scala/StoreApiTest.scala (100%) rename samples/client/petstore/{scala => scala-httpclient}/src/test/scala/UserApiTest.scala (100%) diff --git a/CI/pom.xml.circleci b/CI/pom.xml.circleci index 1d663a33a39..4ad72fab8f6 100644 --- a/CI/pom.xml.circleci +++ b/CI/pom.xml.circleci @@ -836,8 +836,8 @@ samples/client/petstore/go - samples/client/petstore/akka-scala - samples/client/petstore/scala + samples/client/petstore/scala-akka + samples/client/petstore/scala-httpclient samples/client/petstore/scalaz samples/client/petstore/clojure samples/client/petstore/java/feign diff --git a/CI/pom.xml.circleci.java7 b/CI/pom.xml.circleci.java7 index 0315b2cd8c7..f36d9ddfd20 100644 --- a/CI/pom.xml.circleci.java7 +++ b/CI/pom.xml.circleci.java7 @@ -834,8 +834,8 @@ - samples/client/petstore/akka-scala - samples/client/petstore/scala + samples/client/petstore/scala-akka + samples/client/petstore/scala-httpclient samples/client/petstore/scalaz samples/client/petstore/clojure samples/client/petstore/java/feign diff --git a/bin/openapi3/akka-scala-petstore.sh b/bin/openapi3/scala-akka-petstore.sh similarity index 80% rename from bin/openapi3/akka-scala-petstore.sh rename to bin/openapi3/scala-akka-petstore.sh index e63ca93bb35..7f6e6bf0eb0 100755 --- a/bin/openapi3/akka-scala-petstore.sh +++ b/bin/openapi3/scala-akka-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 --artifact-id "scala-akka-petstore-client" -t modules/openapi-generator/src/main/resources/akka-scala -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g akka-scala -o samples/client/petstore/akka-scala $@" +ags="generate --artifact-id "scala-akka-petstore-client" -t modules/openapi-generator/src/main/resources/scala-akka-client -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g akka-scala -o samples/client/petstore/scala-akka $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/scala-petstore.sh b/bin/openapi3/scala-httpclient-petstore.sh similarity index 84% rename from bin/openapi3/scala-petstore.sh rename to bin/openapi3/scala-httpclient-petstore.sh index 8161ab9ea08..268f9e5775f 100755 --- a/bin/openapi3/scala-petstore.sh +++ b/bin/openapi3/scala-httpclient-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/scala -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala -o samples/client/petstore/scala $@" +ags="generate -t modules/openapi-generator/src/main/resources/scala-httpclient -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala -o samples/client/petstore/scala-httpclient $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/akka-scala-petstore.sh b/bin/scala-akka-petstore.sh similarity index 81% rename from bin/akka-scala-petstore.sh rename to bin/scala-akka-petstore.sh index 72b0d5c1767..502155ba15c 100755 --- a/bin/akka-scala-petstore.sh +++ b/bin/scala-akka-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 --artifact-id "scala-akka-petstore-client" -t modules/openapi-generator/src/main/resources/akka-scala -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g scala-akka -o samples/client/petstore/akka-scala $@" +ags="generate --artifact-id "scala-akka-petstore-client" -t modules/openapi-generator/src/main/resources/scala-akka-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g scala-akka -o samples/client/petstore/scala-akka $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/scala-petstore.sh b/bin/scala-httpclient-petstore.sh similarity index 83% rename from bin/scala-petstore.sh rename to bin/scala-httpclient-petstore.sh index a3282fca21b..dc7151945d3 100755 --- a/bin/scala-petstore.sh +++ b/bin/scala-httpclient-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/scala -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g scala-httpclient -o samples/client/petstore/scala $@" +ags="generate -t modules/openapi-generator/src/main/resources/scala-httpclient -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g scala-httpclient -o samples/client/petstore/scala-httpclient $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/security/scala-petstore.sh b/bin/security/scala-httpclient-petstore.sh similarity index 81% rename from bin/security/scala-petstore.sh rename to bin/security/scala-httpclient-petstore.sh index 950f6a74bbb..6616a6eb26d 100755 --- a/bin/security/scala-petstore.sh +++ b/bin/security/scala-httpclient-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/scala -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g scala-httpclient -o samples/client/petstore-security-test/scala $@" +ags="generate -t modules/openapi-generator/src/main/resources/scala-httpclient -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g scala-httpclient -o samples/client/petstore-security-test/scala-httpclient $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/akka-scala-petstore.bat b/bin/windows/scala-akka-petstore.bat similarity index 88% rename from bin/windows/akka-scala-petstore.bat rename to bin/windows/scala-akka-petstore.bat index 0ea9ad668a7..131859e4ec1 100755 --- a/bin/windows/akka-scala-petstore.bat +++ b/bin/windows/scala-akka-petstore.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "scala-akka-petstore-client" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g scala-akka -o samples\client\petstore\akka-scala +set ags=generate --artifact-id "scala-akka-petstore-client" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g scala-akka -o samples\client\petstore\scala-akka java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/scala-petstore.bat b/bin/windows/scala-httpclient-petstore.bat similarity index 94% rename from bin/windows/scala-petstore.bat rename to bin/windows/scala-httpclient-petstore.bat index 8d8c2f1753f..c30461d6efd 100755 --- a/bin/windows/scala-petstore.bat +++ b/bin/windows/scala-httpclient-petstore.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g scala-httpclient -o samples\client\petstore\scala +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g scala-httpclient -o samples\client\petstore\scala-httpclient java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java index 78e740b8fa4..ab491cabfca 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaAkkaClientCodegen.java @@ -63,7 +63,7 @@ public class ScalaAkkaClientCodegen extends AbstractScalaCodegen implements Code outputFolder = "generated-code/scala-akka"; modelTemplateFiles.put("model.mustache", ".scala"); apiTemplateFiles.put("api.mustache", ".scala"); - embeddedTemplateDir = templateDir = "akka-scala"; + embeddedTemplateDir = templateDir = "scala-akka-client"; apiPackage = mainPackage + ".api"; modelPackage = mainPackage + ".model"; invokerPackage = mainPackage + ".core"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaHttpClientCodegen.java index 32a8fe5c2df..b23a7f75ce1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ScalaHttpClientCodegen.java @@ -43,7 +43,7 @@ public class ScalaHttpClientCodegen extends AbstractScalaCodegen implements Code outputFolder = "generated-code/scala-http-client"; modelTemplateFiles.put("model.mustache", ".scala"); apiTemplateFiles.put("api.mustache", ".scala"); - embeddedTemplateDir = templateDir = "scala"; + embeddedTemplateDir = templateDir = "scala-httpclient"; apiPackage = "org.openapitools.client.api"; modelPackage = "org.openapitools.client.model"; diff --git a/modules/openapi-generator/src/main/resources/akka-scala/README.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/README.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/README.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/README.mustache diff --git a/modules/openapi-generator/src/main/resources/akka-scala/api.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/api.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/api.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/api.mustache diff --git a/modules/openapi-generator/src/main/resources/akka-scala/apiInvoker.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/apiInvoker.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/apiInvoker.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/apiInvoker.mustache diff --git a/modules/openapi-generator/src/main/resources/akka-scala/apiRequest.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/apiRequest.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/apiRequest.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/apiRequest.mustache diff --git a/modules/openapi-generator/src/main/resources/akka-scala/apiSettings.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/apiSettings.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/apiSettings.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/apiSettings.mustache diff --git a/modules/openapi-generator/src/main/resources/akka-scala/build.sbt.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/build.sbt.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/build.sbt.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/build.sbt.mustache diff --git a/modules/openapi-generator/src/main/resources/akka-scala/enumsSerializers.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/enumsSerializers.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/enumsSerializers.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/enumsSerializers.mustache diff --git a/modules/openapi-generator/src/main/resources/akka-scala/javadoc.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/javadoc.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/javadoc.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/javadoc.mustache diff --git a/modules/openapi-generator/src/main/resources/akka-scala/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/licenseInfo.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/licenseInfo.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/licenseInfo.mustache diff --git a/modules/openapi-generator/src/main/resources/akka-scala/methodParameters.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/methodParameters.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/methodParameters.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/methodParameters.mustache diff --git a/modules/openapi-generator/src/main/resources/akka-scala/model.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/model.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/model.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/model.mustache diff --git a/modules/openapi-generator/src/main/resources/akka-scala/operationReturnType.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/operationReturnType.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/operationReturnType.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/operationReturnType.mustache diff --git a/modules/openapi-generator/src/main/resources/akka-scala/paramCreation.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/paramCreation.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/paramCreation.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/paramCreation.mustache diff --git a/modules/openapi-generator/src/main/resources/akka-scala/pom.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/pom.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/pom.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/pom.mustache diff --git a/modules/openapi-generator/src/main/resources/akka-scala/reference.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/reference.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/reference.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/reference.mustache diff --git a/modules/openapi-generator/src/main/resources/akka-scala/requests.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/requests.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/requests.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/requests.mustache diff --git a/modules/openapi-generator/src/main/resources/akka-scala/responseState.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/responseState.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/akka-scala/responseState.mustache rename to modules/openapi-generator/src/main/resources/scala-akka-client/responseState.mustache diff --git a/modules/openapi-generator/src/main/resources/scala/README.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/README.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/README.mustache rename to modules/openapi-generator/src/main/resources/scala-httpclient/README.mustache diff --git a/modules/openapi-generator/src/main/resources/scala/api.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/api.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/api.mustache rename to modules/openapi-generator/src/main/resources/scala-httpclient/api.mustache diff --git a/modules/openapi-generator/src/main/resources/scala/apiInvoker.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/apiInvoker.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/apiInvoker.mustache rename to modules/openapi-generator/src/main/resources/scala-httpclient/apiInvoker.mustache diff --git a/modules/openapi-generator/src/main/resources/scala/build.gradle.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/build.gradle.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/build.gradle.mustache rename to modules/openapi-generator/src/main/resources/scala-httpclient/build.gradle.mustache diff --git a/modules/openapi-generator/src/main/resources/scala/build.sbt.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/build.sbt.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/build.sbt.mustache rename to modules/openapi-generator/src/main/resources/scala-httpclient/build.sbt.mustache diff --git a/modules/openapi-generator/src/main/resources/scala/client.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/client.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/client.mustache rename to modules/openapi-generator/src/main/resources/scala-httpclient/client.mustache diff --git a/modules/openapi-generator/src/main/resources/scala/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/git_push.sh.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/git_push.sh.mustache rename to modules/openapi-generator/src/main/resources/scala-httpclient/git_push.sh.mustache diff --git a/modules/openapi-generator/src/main/resources/scala/gitignore.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/gitignore.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/gitignore.mustache rename to modules/openapi-generator/src/main/resources/scala-httpclient/gitignore.mustache diff --git a/modules/openapi-generator/src/main/resources/scala/gradle-wrapper.jar b/modules/openapi-generator/src/main/resources/scala-httpclient/gradle-wrapper.jar similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/gradle-wrapper.jar rename to modules/openapi-generator/src/main/resources/scala-httpclient/gradle-wrapper.jar diff --git a/modules/openapi-generator/src/main/resources/scala/gradle-wrapper.properties.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/gradle-wrapper.properties.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/gradle-wrapper.properties.mustache rename to modules/openapi-generator/src/main/resources/scala-httpclient/gradle-wrapper.properties.mustache diff --git a/modules/openapi-generator/src/main/resources/scala/gradle.properties.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/gradle.properties.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/gradle.properties.mustache rename to modules/openapi-generator/src/main/resources/scala-httpclient/gradle.properties.mustache diff --git a/modules/openapi-generator/src/main/resources/scala/gradlew.bat.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/gradlew.bat.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/gradlew.bat.mustache rename to modules/openapi-generator/src/main/resources/scala-httpclient/gradlew.bat.mustache diff --git a/modules/openapi-generator/src/main/resources/scala/gradlew.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/gradlew.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/gradlew.mustache rename to modules/openapi-generator/src/main/resources/scala-httpclient/gradlew.mustache diff --git a/modules/openapi-generator/src/main/resources/scala/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/licenseInfo.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/licenseInfo.mustache rename to modules/openapi-generator/src/main/resources/scala-httpclient/licenseInfo.mustache diff --git a/modules/openapi-generator/src/main/resources/scala/model.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/model.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/model.mustache rename to modules/openapi-generator/src/main/resources/scala-httpclient/model.mustache diff --git a/modules/openapi-generator/src/main/resources/scala/pom.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/pom.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/pom.mustache rename to modules/openapi-generator/src/main/resources/scala-httpclient/pom.mustache diff --git a/modules/openapi-generator/src/main/resources/scala/settings.gradle.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/settings.gradle.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/scala/settings.gradle.mustache rename to modules/openapi-generator/src/main/resources/scala-httpclient/settings.gradle.mustache diff --git a/pom.xml b/pom.xml index f0643cd3662..a3328919724 100644 --- a/pom.xml +++ b/pom.xml @@ -608,7 +608,7 @@ - scala-client + scala-httpclient env @@ -616,7 +616,7 @@ - samples/client/petstore/scala + samples/client/petstore/scala-httpclient @@ -937,8 +937,6 @@ samples/client/petstore/php/OpenAPIClient-php samples/openapi3/client/petstore/php/OpenAPIClient-php - samples/client/petstore/scala - samples/client/petstore/akka-scala samples/client/petstore/javascript samples/client/petstore/javascript-es6 samples/client/petstore/javascript-promise diff --git a/samples/client/petstore-security-test/scala/.gitignore b/samples/client/petstore-security-test/scala-httpclient/.gitignore similarity index 100% rename from samples/client/petstore-security-test/scala/.gitignore rename to samples/client/petstore-security-test/scala-httpclient/.gitignore diff --git a/samples/client/petstore-security-test/scala/.openapi-generator-ignore b/samples/client/petstore-security-test/scala-httpclient/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore-security-test/scala/.openapi-generator-ignore rename to samples/client/petstore-security-test/scala-httpclient/.openapi-generator-ignore diff --git a/samples/client/petstore-security-test/scala/.openapi-generator/VERSION b/samples/client/petstore-security-test/scala-httpclient/.openapi-generator/VERSION similarity index 100% rename from samples/client/petstore-security-test/scala/.openapi-generator/VERSION rename to samples/client/petstore-security-test/scala-httpclient/.openapi-generator/VERSION diff --git a/samples/client/petstore-security-test/scala/LICENSE b/samples/client/petstore-security-test/scala-httpclient/LICENSE similarity index 100% rename from samples/client/petstore-security-test/scala/LICENSE rename to samples/client/petstore-security-test/scala-httpclient/LICENSE diff --git a/samples/client/petstore-security-test/scala/build.gradle b/samples/client/petstore-security-test/scala-httpclient/build.gradle similarity index 100% rename from samples/client/petstore-security-test/scala/build.gradle rename to samples/client/petstore-security-test/scala-httpclient/build.gradle diff --git a/samples/client/petstore-security-test/scala/build.sbt b/samples/client/petstore-security-test/scala-httpclient/build.sbt similarity index 100% rename from samples/client/petstore-security-test/scala/build.sbt rename to samples/client/petstore-security-test/scala-httpclient/build.sbt diff --git a/samples/client/petstore-security-test/scala/git_push.sh b/samples/client/petstore-security-test/scala-httpclient/git_push.sh similarity index 100% rename from samples/client/petstore-security-test/scala/git_push.sh rename to samples/client/petstore-security-test/scala-httpclient/git_push.sh diff --git a/samples/client/petstore-security-test/scala/gradle.properties b/samples/client/petstore-security-test/scala-httpclient/gradle.properties similarity index 100% rename from samples/client/petstore-security-test/scala/gradle.properties rename to samples/client/petstore-security-test/scala-httpclient/gradle.properties diff --git a/samples/client/petstore-security-test/scala/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore-security-test/scala-httpclient/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from samples/client/petstore-security-test/scala/gradle/wrapper/gradle-wrapper.jar rename to samples/client/petstore-security-test/scala-httpclient/gradle/wrapper/gradle-wrapper.jar diff --git a/samples/client/petstore-security-test/scala/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore-security-test/scala-httpclient/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from samples/client/petstore-security-test/scala/gradle/wrapper/gradle-wrapper.properties rename to samples/client/petstore-security-test/scala-httpclient/gradle/wrapper/gradle-wrapper.properties diff --git a/samples/client/petstore-security-test/scala/gradlew b/samples/client/petstore-security-test/scala-httpclient/gradlew similarity index 100% rename from samples/client/petstore-security-test/scala/gradlew rename to samples/client/petstore-security-test/scala-httpclient/gradlew diff --git a/samples/client/petstore-security-test/scala/gradlew.bat b/samples/client/petstore-security-test/scala-httpclient/gradlew.bat similarity index 100% rename from samples/client/petstore-security-test/scala/gradlew.bat rename to samples/client/petstore-security-test/scala-httpclient/gradlew.bat diff --git a/samples/client/petstore-security-test/scala/pom.xml b/samples/client/petstore-security-test/scala-httpclient/pom.xml similarity index 100% rename from samples/client/petstore-security-test/scala/pom.xml rename to samples/client/petstore-security-test/scala-httpclient/pom.xml diff --git a/samples/client/petstore-security-test/scala/settings.gradle b/samples/client/petstore-security-test/scala-httpclient/settings.gradle similarity index 100% rename from samples/client/petstore-security-test/scala/settings.gradle rename to samples/client/petstore-security-test/scala-httpclient/settings.gradle diff --git a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala b/samples/client/petstore-security-test/scala-httpclient/src/main/scala/io/swagger/client/ApiInvoker.scala similarity index 100% rename from samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/ApiInvoker.scala rename to samples/client/petstore-security-test/scala-httpclient/src/main/scala/io/swagger/client/ApiInvoker.scala diff --git a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/AsyncClient.scala b/samples/client/petstore-security-test/scala-httpclient/src/main/scala/io/swagger/client/AsyncClient.scala similarity index 100% rename from samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/AsyncClient.scala rename to samples/client/petstore-security-test/scala-httpclient/src/main/scala/io/swagger/client/AsyncClient.scala diff --git a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/api/FakeApi.scala b/samples/client/petstore-security-test/scala-httpclient/src/main/scala/io/swagger/client/api/FakeApi.scala similarity index 100% rename from samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/api/FakeApi.scala rename to samples/client/petstore-security-test/scala-httpclient/src/main/scala/io/swagger/client/api/FakeApi.scala diff --git a/samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/model/ModelReturn.scala b/samples/client/petstore-security-test/scala-httpclient/src/main/scala/io/swagger/client/model/ModelReturn.scala similarity index 100% rename from samples/client/petstore-security-test/scala/src/main/scala/io/swagger/client/model/ModelReturn.scala rename to samples/client/petstore-security-test/scala-httpclient/src/main/scala/io/swagger/client/model/ModelReturn.scala diff --git a/samples/client/petstore/akka-scala/.openapi-generator-ignore b/samples/client/petstore/scala-akka/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/akka-scala/.openapi-generator-ignore rename to samples/client/petstore/scala-akka/.openapi-generator-ignore diff --git a/samples/client/petstore/akka-scala/.openapi-generator/VERSION b/samples/client/petstore/scala-akka/.openapi-generator/VERSION similarity index 100% rename from samples/client/petstore/akka-scala/.openapi-generator/VERSION rename to samples/client/petstore/scala-akka/.openapi-generator/VERSION diff --git a/samples/client/petstore/akka-scala/README.md b/samples/client/petstore/scala-akka/README.md similarity index 100% rename from samples/client/petstore/akka-scala/README.md rename to samples/client/petstore/scala-akka/README.md diff --git a/samples/client/petstore/akka-scala/build.sbt b/samples/client/petstore/scala-akka/build.sbt similarity index 100% rename from samples/client/petstore/akka-scala/build.sbt rename to samples/client/petstore/scala-akka/build.sbt diff --git a/samples/client/petstore/akka-scala/pom.xml b/samples/client/petstore/scala-akka/pom.xml similarity index 100% rename from samples/client/petstore/akka-scala/pom.xml rename to samples/client/petstore/scala-akka/pom.xml diff --git a/samples/client/petstore/akka-scala/src/main/resources/reference.conf b/samples/client/petstore/scala-akka/src/main/resources/reference.conf similarity index 100% rename from samples/client/petstore/akka-scala/src/main/resources/reference.conf rename to samples/client/petstore/scala-akka/src/main/resources/reference.conf diff --git a/samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/api/EnumsSerializers.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/EnumsSerializers.scala similarity index 100% rename from samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/api/EnumsSerializers.scala rename to samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/EnumsSerializers.scala diff --git a/samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/api/PetApi.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/PetApi.scala similarity index 100% rename from samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/api/PetApi.scala rename to samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/PetApi.scala diff --git a/samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/api/StoreApi.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/StoreApi.scala similarity index 100% rename from samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/api/StoreApi.scala rename to samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/StoreApi.scala diff --git a/samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala similarity index 100% rename from samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/api/UserApi.scala rename to samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala diff --git a/samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/core/ApiInvoker.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala similarity index 100% rename from samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/core/ApiInvoker.scala rename to samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala diff --git a/samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/core/ApiRequest.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiRequest.scala similarity index 100% rename from samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/core/ApiRequest.scala rename to samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiRequest.scala diff --git a/samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/core/ApiSettings.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiSettings.scala similarity index 100% rename from samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/core/ApiSettings.scala rename to samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiSettings.scala diff --git a/samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/core/requests.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/requests.scala similarity index 100% rename from samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/core/requests.scala rename to samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/requests.scala diff --git a/samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/model/ApiResponse.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/ApiResponse.scala similarity index 100% rename from samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/model/ApiResponse.scala rename to samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/ApiResponse.scala diff --git a/samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/model/Category.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Category.scala similarity index 100% rename from samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/model/Category.scala rename to samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Category.scala diff --git a/samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/model/Order.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Order.scala similarity index 100% rename from samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/model/Order.scala rename to samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Order.scala diff --git a/samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/model/Pet.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Pet.scala similarity index 100% rename from samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/model/Pet.scala rename to samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Pet.scala diff --git a/samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/model/Tag.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Tag.scala similarity index 100% rename from samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/model/Tag.scala rename to samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/Tag.scala diff --git a/samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/model/User.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/User.scala similarity index 100% rename from samples/client/petstore/akka-scala/src/main/scala/org/openapitools/client/model/User.scala rename to samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/model/User.scala diff --git a/samples/client/petstore/scala/.gitignore b/samples/client/petstore/scala-httpclient/.gitignore similarity index 100% rename from samples/client/petstore/scala/.gitignore rename to samples/client/petstore/scala-httpclient/.gitignore diff --git a/samples/client/petstore/scala/.openapi-generator-ignore b/samples/client/petstore/scala-httpclient/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/scala/.openapi-generator-ignore rename to samples/client/petstore/scala-httpclient/.openapi-generator-ignore diff --git a/samples/client/petstore/scala/.openapi-generator/VERSION b/samples/client/petstore/scala-httpclient/.openapi-generator/VERSION similarity index 100% rename from samples/client/petstore/scala/.openapi-generator/VERSION rename to samples/client/petstore/scala-httpclient/.openapi-generator/VERSION diff --git a/samples/client/petstore/scala/build.gradle b/samples/client/petstore/scala-httpclient/build.gradle similarity index 100% rename from samples/client/petstore/scala/build.gradle rename to samples/client/petstore/scala-httpclient/build.gradle diff --git a/samples/client/petstore/scala/build.sbt b/samples/client/petstore/scala-httpclient/build.sbt similarity index 100% rename from samples/client/petstore/scala/build.sbt rename to samples/client/petstore/scala-httpclient/build.sbt diff --git a/samples/client/petstore/scala/git_push.sh b/samples/client/petstore/scala-httpclient/git_push.sh similarity index 100% rename from samples/client/petstore/scala/git_push.sh rename to samples/client/petstore/scala-httpclient/git_push.sh diff --git a/samples/client/petstore/scala/gradle.properties b/samples/client/petstore/scala-httpclient/gradle.properties similarity index 100% rename from samples/client/petstore/scala/gradle.properties rename to samples/client/petstore/scala-httpclient/gradle.properties diff --git a/samples/client/petstore/scala/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/scala-httpclient/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from samples/client/petstore/scala/gradle/wrapper/gradle-wrapper.jar rename to samples/client/petstore/scala-httpclient/gradle/wrapper/gradle-wrapper.jar diff --git a/samples/client/petstore/scala/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/scala-httpclient/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from samples/client/petstore/scala/gradle/wrapper/gradle-wrapper.properties rename to samples/client/petstore/scala-httpclient/gradle/wrapper/gradle-wrapper.properties diff --git a/samples/client/petstore/scala/gradlew b/samples/client/petstore/scala-httpclient/gradlew similarity index 100% rename from samples/client/petstore/scala/gradlew rename to samples/client/petstore/scala-httpclient/gradlew diff --git a/samples/client/petstore/scala/gradlew.bat b/samples/client/petstore/scala-httpclient/gradlew.bat similarity index 100% rename from samples/client/petstore/scala/gradlew.bat rename to samples/client/petstore/scala-httpclient/gradlew.bat diff --git a/samples/client/petstore/scala/pom.xml b/samples/client/petstore/scala-httpclient/pom.xml similarity index 100% rename from samples/client/petstore/scala/pom.xml rename to samples/client/petstore/scala-httpclient/pom.xml diff --git a/samples/client/petstore/scala/settings.gradle b/samples/client/petstore/scala-httpclient/settings.gradle similarity index 100% rename from samples/client/petstore/scala/settings.gradle rename to samples/client/petstore/scala-httpclient/settings.gradle diff --git a/samples/client/petstore/scala/src/main/scala/org/openapitools/client/ApiInvoker.scala b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/ApiInvoker.scala similarity index 100% rename from samples/client/petstore/scala/src/main/scala/org/openapitools/client/ApiInvoker.scala rename to samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/ApiInvoker.scala diff --git a/samples/client/petstore/scala/src/main/scala/org/openapitools/client/AsyncClient.scala b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/AsyncClient.scala similarity index 100% rename from samples/client/petstore/scala/src/main/scala/org/openapitools/client/AsyncClient.scala rename to samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/AsyncClient.scala diff --git a/samples/client/petstore/scala/src/main/scala/org/openapitools/client/api/PetApi.scala b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/PetApi.scala similarity index 100% rename from samples/client/petstore/scala/src/main/scala/org/openapitools/client/api/PetApi.scala rename to samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/PetApi.scala diff --git a/samples/client/petstore/scala/src/main/scala/org/openapitools/client/api/StoreApi.scala b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/StoreApi.scala similarity index 100% rename from samples/client/petstore/scala/src/main/scala/org/openapitools/client/api/StoreApi.scala rename to samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/StoreApi.scala diff --git a/samples/client/petstore/scala/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/UserApi.scala similarity index 100% rename from samples/client/petstore/scala/src/main/scala/org/openapitools/client/api/UserApi.scala rename to samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/api/UserApi.scala diff --git a/samples/client/petstore/scala/src/main/scala/org/openapitools/client/model/ApiResponse.scala b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/ApiResponse.scala similarity index 100% rename from samples/client/petstore/scala/src/main/scala/org/openapitools/client/model/ApiResponse.scala rename to samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/ApiResponse.scala diff --git a/samples/client/petstore/scala/src/main/scala/org/openapitools/client/model/Category.scala b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/Category.scala similarity index 100% rename from samples/client/petstore/scala/src/main/scala/org/openapitools/client/model/Category.scala rename to samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/Category.scala diff --git a/samples/client/petstore/scala/src/main/scala/org/openapitools/client/model/Order.scala b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/Order.scala similarity index 100% rename from samples/client/petstore/scala/src/main/scala/org/openapitools/client/model/Order.scala rename to samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/Order.scala diff --git a/samples/client/petstore/scala/src/main/scala/org/openapitools/client/model/Pet.scala b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/Pet.scala similarity index 100% rename from samples/client/petstore/scala/src/main/scala/org/openapitools/client/model/Pet.scala rename to samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/Pet.scala diff --git a/samples/client/petstore/scala/src/main/scala/org/openapitools/client/model/Tag.scala b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/Tag.scala similarity index 100% rename from samples/client/petstore/scala/src/main/scala/org/openapitools/client/model/Tag.scala rename to samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/Tag.scala diff --git a/samples/client/petstore/scala/src/main/scala/org/openapitools/client/model/User.scala b/samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/User.scala similarity index 100% rename from samples/client/petstore/scala/src/main/scala/org/openapitools/client/model/User.scala rename to samples/client/petstore/scala-httpclient/src/main/scala/org/openapitools/client/model/User.scala diff --git a/samples/client/petstore/scala/src/test/scala/PetApiTest.scala b/samples/client/petstore/scala-httpclient/src/test/scala/PetApiTest.scala similarity index 100% rename from samples/client/petstore/scala/src/test/scala/PetApiTest.scala rename to samples/client/petstore/scala-httpclient/src/test/scala/PetApiTest.scala diff --git a/samples/client/petstore/scala/src/test/scala/StoreApiTest.scala b/samples/client/petstore/scala-httpclient/src/test/scala/StoreApiTest.scala similarity index 100% rename from samples/client/petstore/scala/src/test/scala/StoreApiTest.scala rename to samples/client/petstore/scala-httpclient/src/test/scala/StoreApiTest.scala diff --git a/samples/client/petstore/scala/src/test/scala/UserApiTest.scala b/samples/client/petstore/scala-httpclient/src/test/scala/UserApiTest.scala similarity index 100% rename from samples/client/petstore/scala/src/test/scala/UserApiTest.scala rename to samples/client/petstore/scala-httpclient/src/test/scala/UserApiTest.scala From 12ab7e27521dce18b7fb27e40ce2eb636f4fac29 Mon Sep 17 00:00:00 2001 From: Geoff Brown Date: Thu, 21 Jun 2018 05:34:22 -0400 Subject: [PATCH 20/35] Use case sensitivity when checking reserved words (PHNX-1040) (#3) (#351) Motivation ------------- Open API generator previously wasn't case sensitive when checking for reserved words in the typescript generator. This will allow us to have the "Package" model in ProductCatalogs without needing to rename anything. Modifications ------------------ Duplicated the C# logic for reserved words (per the @jimschubert from openapitools' suggestion) --- .../languages/AbstractTypeScriptClientCodegen.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 7f2801a7be3..850b3205f26 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -48,7 +48,9 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp importMapping.clear(); supportsInheritance = true; - setReservedWordsLowerCase(Arrays.asList( + + // NOTE: TypeScript uses camel cased reserved words, while models are title cased. We don't want lowercase comparisons. + reservedWords.addAll(Arrays.asList( // local variable names used in API methods (endpoints) "varLocalPath", "queryParameters", "headerParams", "formParams", "useFormData", "varLocalDeferred", "requestOptions", @@ -344,6 +346,12 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp } } + + @Override + protected boolean isReservedWord(String word) { + // NOTE: This differs from super's implementation in that TypeScript does _not_ want case insensitive matching. + return reservedWords.contains(word); + } @Override public String getSchemaType(Schema p) { From 5884db97d494d9c3d173058c103a88a6b6c33fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bresson?= Date: Thu, 21 Jun 2018 15:05:38 +0200 Subject: [PATCH 21/35] Fixes for maven deploy (#366) gradle-plugin-mvn-wrapper: * Fix disabling of install and deploy * Set skipNexusStagingDeployMojo to true --- .../openapi-generator-gradle-plugin/pom.xml | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index 4e85925416a..aa640ff4257 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -13,6 +13,9 @@ openapi-generator-gradle-plugin (maven wrapper) This is a maven wrapper to call gradle during installation phase + + true + @@ -23,19 +26,28 @@ - + + + + + + maven-install-plugin + + true + + + + + maven-deploy-plugin + + true + + + + - - - - org.apache.maven.plugins - maven-install-plugin - 2.5.2 - - true - - + org.fortasoft @@ -65,15 +77,6 @@ - - - org.apache.maven.plugins - maven-deploy-plugin - 2.8.2 - - true - - From a0f71cc32856207b8869704ad07d2d46e53e5a24 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 21 Jun 2018 21:59:56 +0800 Subject: [PATCH 22/35] update go client, server petstore samples (#365) --- .../.openapi-generator/VERSION | 2 +- .../go/go-petstore-withXml/api/openapi.yaml | 1241 +++++++++-------- .../go/go-petstore-withXml/api_fake.go | 4 +- .../go/go-petstore-withXml/configuration.go | 2 +- .../go/go-petstore-withXml/docs/EnumTest.md | 2 +- .../go/go-petstore-withXml/docs/FakeApi.md | 2 +- .../go/go-petstore-withXml/docs/FormatTest.md | 2 +- .../go/go-petstore-withXml/docs/Pet.md | 2 +- .../go/go-petstore-withXml/model_enum_test.go | 2 +- .../go-petstore-withXml/model_format_test.go | 2 +- .../go/go-petstore-withXml/model_pet.go | 2 +- .../go/go-petstore/.openapi-generator/VERSION | 2 +- .../petstore/go/go-petstore/api/openapi.yaml | 1241 +++++++++-------- .../petstore/go/go-petstore/configuration.go | 2 +- .../petstore/go/go-petstore/docs/EnumTest.md | 2 +- .../go/go-petstore/docs/FormatTest.md | 2 +- .../petstore/go/go-petstore/docs/Pet.md | 2 +- .../go/go-petstore/model_enum_test.go | 2 +- .../go/go-petstore/model_format_test.go | 2 +- .../petstore/go/go-petstore/model_pet.go | 2 +- .../go-api-server/.openapi-generator/VERSION | 2 +- 21 files changed, 1266 insertions(+), 1256 deletions(-) diff --git a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION index 096bf47efe3..82602aa4190 100644 --- a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml index 443788211b9..c5c2dfaffa7 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml @@ -1,31 +1,27 @@ openapi: 3.0.1 info: - title: OpenAPI Petstore description: 'This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: " \' license: name: Apache-2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore version: 1.0.0 servers: - url: http://petstore.swagger.io:80/v2 tags: -- name: pet - description: Everything about your Pets -- name: store - description: Access to Petstore orders -- name: user - description: Operations about user +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user paths: /pet: - put: - tags: - - pet - summary: Update an existing pet - operationId: updatePet + post: + operationId: addPet requestBody: - description: Pet object that needs to be added to the store content: application/json: schema: @@ -33,144 +29,171 @@ paths: application/xml: schema: $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + 405: + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + operationId: updatePet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store required: true responses: 400: + content: {} description: Invalid ID supplied - content: {} 404: + content: {} description: Pet not found - content: {} 405: - description: Validation exception content: {} + description: Validation exception security: - petstore_auth: - write:pets - read:pets - post: + summary: Update an existing pet tags: - pet - summary: Add a new pet to the store - operationId: addPet - 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 - responses: - 405: - description: Invalid input - content: {} - security: - - petstore_auth: - - write:pets - - read:pets /pet/findByStatus: get: - tags: - - pet - summary: Finds Pets by status description: Multiple status values can be provided with comma separated strings operationId: findPetsByStatus parameters: - - name: status - in: query - description: Status values that need to be considered for filter - required: true + - description: Status values that need to be considered for filter explode: false + in: query + name: status + required: true schema: - type: array items: - type: string default: available enum: - available - pending - sold + type: string + type: array + style: form responses: 200: - description: successful operation content: application/xml: schema: - type: array items: $ref: '#/components/schemas/Pet' + type: array application/json: schema: - type: array items: $ref: '#/components/schemas/Pet' + type: array + description: successful operation 400: - description: Invalid status value content: {} + description: Invalid status value security: - petstore_auth: - write:pets - read:pets - /pet/findByTags: - get: + summary: Finds Pets by status tags: - pet - summary: Finds Pets by tags + /pet/findByTags: + get: + deprecated: true description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - - name: tags - in: query - description: Tags to filter by - required: true + - description: Tags to filter by explode: false + in: query + name: tags + required: true schema: - type: array items: type: string + type: array + style: form responses: 200: - description: successful operation content: application/xml: schema: - type: array items: $ref: '#/components/schemas/Pet' + type: array application/json: schema: - type: array items: $ref: '#/components/schemas/Pet' + type: array + description: successful operation 400: - description: Invalid tag value content: {} - deprecated: true + description: Invalid tag value security: - petstore_auth: - write:pets - read:pets - /pet/{petId}: - get: + summary: Finds Pets by tags tags: - pet - summary: Find pet by ID + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + 400: + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + get: description: Returns a single pet operationId: getPetById parameters: - - name: petId + - description: ID of pet to return in: path - description: ID of pet to return + name: petId required: true schema: - type: integer format: int64 + type: integer responses: 200: - description: successful operation content: application/xml: schema: @@ -178,143 +201,118 @@ paths: application/json: schema: $ref: '#/components/schemas/Pet' + description: successful operation 400: + content: {} description: Invalid ID supplied - content: {} 404: - description: Pet not found content: {} + description: Pet not found security: - api_key: [] - post: + summary: Find pet by ID tags: - pet - summary: Updates a pet in the store with form data + post: operationId: updatePetWithForm parameters: - - name: petId + - description: ID of pet that needs to be updated in: path - description: ID of pet that needs to be updated + name: petId required: true schema: - type: integer format: int64 + type: integer requestBody: content: application/x-www-form-urlencoded: schema: properties: name: - type: string description: Updated name of the pet - status: type: string + status: description: Updated status of the pet + type: string responses: 405: - description: Invalid input content: {} + description: Invalid input security: - petstore_auth: - write:pets - read:pets - delete: + summary: Updates a pet in the store with form data tags: - pet - summary: Deletes a pet - operationId: deletePet - parameters: - - name: api_key - in: header - schema: - type: string - - name: petId - in: path - description: Pet id to delete - required: true - schema: - type: integer - format: int64 - responses: - 400: - description: Invalid pet value - content: {} - security: - - petstore_auth: - - write:pets - - read:pets /pet/{petId}/uploadImage: post: - tags: - - pet - summary: uploads an image operationId: uploadFile parameters: - - name: petId + - description: ID of pet to update in: path - description: ID of pet to update + name: petId required: true schema: - type: integer format: int64 + type: integer requestBody: content: multipart/form-data: schema: properties: additionalMetadata: - type: string description: Additional data to pass to server - file: type: string + file: description: file to upload format: binary + type: string responses: 200: - description: successful operation content: application/json: schema: $ref: '#/components/schemas/ApiResponse' + description: successful operation security: - petstore_auth: - write:pets - read:pets + summary: uploads an image + tags: + - pet /store/inventory: get: - tags: - - store - summary: Returns pet inventories by status description: Returns a map of status codes to quantities operationId: getInventory responses: 200: - description: successful operation content: application/json: schema: - type: object additionalProperties: - type: integer format: int32 + type: integer + type: object + description: successful operation security: - api_key: [] - /store/order: - post: + summary: Returns pet inventories by status tags: - store - summary: Place an order for a pet + /store/order: + post: operationId: placeOrder requestBody: - description: order placed for purchasing the pet content: '*/*': schema: $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet required: true responses: 200: - description: successful operation content: application/xml: schema: @@ -322,187 +320,207 @@ paths: application/json: schema: $ref: '#/components/schemas/Order' + description: successful operation 400: + content: {} description: Invalid Order - content: {} + summary: Place an order for a pet + tags: + - store /store/order/{order_id}: - get: - tags: - - store - summary: Find purchase order by ID - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - operationId: getOrderById - parameters: - - name: order_id - in: path - description: ID of pet that needs to be fetched - required: true - schema: - maximum: 5 - minimum: 1 - type: integer - format: int64 - responses: - 200: - description: successful operation - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - 400: - description: Invalid ID supplied - content: {} - 404: - description: Order not found - content: {} delete: - tags: - - store - summary: Delete purchase order by ID description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - - name: order_id + - description: ID of the order that needs to be deleted in: path - description: ID of the order that needs to be deleted + name: order_id required: true schema: type: string responses: 400: + content: {} description: Invalid ID supplied - content: {} 404: - description: Order not found content: {} + description: Order not found + summary: Delete purchase order by ID + tags: + - store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + 200: + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + 400: + content: {} + description: Invalid ID supplied + 404: + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store /user: post: - tags: - - user - summary: Create user description: This can only be done by the logged in user. operationId: createUser requestBody: - description: Created user object content: '*/*': schema: $ref: '#/components/schemas/User' + description: Created user object required: true responses: default: - description: successful operation content: {} + description: successful operation + summary: Create user + tags: + - user /user/createWithArray: post: - tags: - - user - summary: Creates list of users with given input array operationId: createUsersWithArrayInput requestBody: - description: List of user object content: '*/*': schema: - type: array items: $ref: '#/components/schemas/User' + type: array + description: List of user object required: true responses: default: - description: successful operation content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user /user/createWithList: post: - tags: - - user - summary: Creates list of users with given input array operationId: createUsersWithListInput requestBody: - description: List of user object content: '*/*': schema: - type: array items: $ref: '#/components/schemas/User' + type: array + description: List of user object required: true responses: default: - description: successful operation content: {} - /user/login: - get: + description: successful operation + summary: Creates list of users with given input array tags: - user - summary: Logs user into the system + /user/login: + get: operationId: loginUser parameters: - - name: username + - description: The user name for login in: query - description: The user name for login + name: username required: true schema: type: string - - name: password + - description: The password for login in clear text in: query - description: The password for login in clear text + name: password required: true schema: type: string responses: 200: + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string description: successful operation headers: X-Rate-Limit: description: calls per hour allowed by the user schema: - type: integer format: int32 + type: integer X-Expires-After: description: date in UTC when token expires schema: - type: string format: date-time - content: - application/xml: - schema: - type: string - application/json: - schema: type: string 400: - description: Invalid username/password supplied content: {} - /user/logout: - get: + description: Invalid username/password supplied + summary: Logs user into the system tags: - user - summary: Logs out current logged in user session + /user/logout: + get: operationId: logoutUser responses: default: - description: successful operation content: {} - /user/{username}: - get: + description: successful operation + summary: Logs out current logged in user session tags: - user - summary: Get user by user name + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + in: path + name: username + required: true + schema: + type: string + responses: + 400: + content: {} + description: Invalid username supplied + 404: + content: {} + description: User not found + summary: Delete user + tags: + - user + get: operationId: getUserByName parameters: - - name: username + - description: The name that needs to be fetched. Use user1 for testing. in: path - description: The name that needs to be fetched. Use user1 for testing. + name: username required: true schema: type: string responses: 200: - description: successful operation content: application/xml: schema: @@ -510,188 +528,188 @@ paths: application/json: schema: $ref: '#/components/schemas/User' + description: successful operation 400: + content: {} description: Invalid username supplied - content: {} 404: - description: User not found content: {} - put: + description: User not found + summary: Get user by user name tags: - user - summary: Updated user + put: description: This can only be done by the logged in user. operationId: updateUser parameters: - - name: username + - description: name that need to be deleted in: path - description: name that need to be deleted + name: username required: true schema: type: string requestBody: - description: Updated user object content: '*/*': schema: $ref: '#/components/schemas/User' + description: Updated user object required: true responses: 400: + content: {} description: Invalid user supplied - content: {} 404: - description: User not found content: {} - delete: + description: User not found + summary: Updated user tags: - user - summary: Delete user - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - name: username - in: path - description: The name that needs to be deleted - required: true - schema: - type: string - responses: - 400: - description: Invalid username supplied - content: {} - 404: - description: User not found - content: {} /fake_classname_test: patch: - tags: - - fake_classname_tags 123#$%^ - summary: To test class name in snake case description: To test class name in snake case operationId: testClassname requestBody: - description: client model content: application/json: schema: $ref: '#/components/schemas/Client' + description: client model required: true responses: 200: - description: successful operation content: application/json: schema: $ref: '#/components/schemas/Client' + description: successful operation security: - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ /fake: get: - tags: - - fake - summary: To test enum parameters description: To test enum parameters operationId: testEnumParameters parameters: - - name: enum_header_string_array - in: header - description: Header parameter enum test (string array) - schema: - type: array - items: - type: string - default: $ - enum: - - '>' - - $ - - name: enum_header_string - in: header - description: Header parameter enum test (string) - schema: - type: string - default: -efg - enum: - - _abc - - -efg - - (xyz) - - name: enum_query_string_array - in: query - description: Query parameter enum test (string array) + - description: Header parameter enum test (string array) explode: false + in: header + name: enum_header_string_array schema: - type: array items: - type: string default: $ enum: - '>' - $ - - name: enum_query_string - in: query - description: Query parameter enum test (string) + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string schema: - type: string default: -efg enum: - _abc - -efg - (xyz) - - name: enum_query_integer + type: string + - description: Query parameter enum test (string array) + explode: false in: query - description: Query parameter enum test (double) + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer schema: - type: integer - format: int32 enum: - 1 - -2 - - name: enum_query_double + format: int32 + type: integer + - description: Query parameter enum test (double) in: query - description: Query parameter enum test (double) + name: enum_query_double schema: - type: number - format: double enum: - 1.1 - -1.2 + format: double + type: number requestBody: content: application/x-www-form-urlencoded: schema: properties: enum_form_string_array: - type: array description: Form parameter enum test (string array) items: - type: string default: $ enum: - '>' - $ + type: string + type: array enum_form_string: - type: string - description: Form parameter enum test (string) default: -efg + description: Form parameter enum test (string) enum: - _abc - -efg - (xyz) + type: string responses: 400: + content: {} description: Invalid request - content: {} 404: - description: Not found content: {} - post: + description: Not found + summary: To test enum parameters tags: - fake - summary: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + post: description: | Fake endpoint for testing various parameters 假端點 @@ -702,238 +720,223 @@ paths: content: application/x-www-form-urlencoded: schema: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string required: - byte - double - number - pattern_without_delimiter - properties: - integer: - maximum: 100 - minimum: 10 - type: integer - description: None - int32: - maximum: 200 - minimum: 20 - type: integer - description: None - format: int32 - int64: - type: integer - description: None - format: int64 - number: - maximum: 543.2 - minimum: 32.1 - type: number - description: None - float: - maximum: 987.6 - type: number - description: None - format: float - double: - maximum: 123.4 - minimum: 67.8 - type: number - description: None - format: double - string: - pattern: /[a-z]/i - type: string - description: None - pattern_without_delimiter: - pattern: ^[A-Z].* - type: string - description: None - byte: - type: string - description: None - format: byte - binary: - type: string - description: None - format: binary - date: - type: string - description: None - format: date - dateTime: - type: string - description: None - format: date-time - password: - maxLength: 64 - minLength: 10 - type: string - description: None - format: password - callback: - type: string - description: None required: true responses: 400: + content: {} description: Invalid username supplied - content: {} 404: - description: User not found content: {} + description: User not found security: - http_basic_test: [] - patch: + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 tags: - fake - summary: To test "client" model - description: To test "client" model - operationId: testClientModel - requestBody: - description: client model - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - required: true - responses: - 200: - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Client' /fake/outer/number: post: - tags: - - fake description: Test serialization of outer number types operationId: fakeOuterNumberSerialize requestBody: - description: Input number as post body content: '*/*': schema: $ref: '#/components/schemas/OuterNumber' + description: Input number as post body required: false responses: 200: - description: Output number content: '*/*': schema: $ref: '#/components/schemas/OuterNumber' - /fake/outer/string: - post: + description: Output number tags: - fake + /fake/outer/string: + post: description: Test serialization of outer string types operationId: fakeOuterStringSerialize requestBody: - description: Input string as post body content: '*/*': schema: $ref: '#/components/schemas/OuterString' + description: Input string as post body required: false responses: 200: - description: Output string content: '*/*': schema: $ref: '#/components/schemas/OuterString' - /fake/outer/boolean: - post: + description: Output string tags: - fake + /fake/outer/boolean: + post: description: Test serialization of outer boolean types operationId: fakeOuterBooleanSerialize requestBody: - description: Input boolean as post body content: '*/*': schema: $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body required: false responses: 200: - description: Output boolean content: '*/*': schema: $ref: '#/components/schemas/OuterBoolean' - /fake/outer/composite: - post: + description: Output boolean tags: - fake + /fake/outer/composite: + post: description: Test serialization of object with outer number type operationId: fakeOuterCompositeSerialize requestBody: - description: Input composite as post body content: '*/*': schema: $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body required: false responses: 200: - description: Output composite content: '*/*': schema: $ref: '#/components/schemas/OuterComposite' - /fake/jsonFormData: - get: + description: Output composite tags: - fake - summary: test json serialization of form data + /fake/jsonFormData: + get: operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string required: - param - param2 - properties: - param: - type: string - description: field1 - param2: - type: string - description: field2 required: true responses: 200: - description: successful operation content: {} - /fake/inline-additionalProperties: - post: + description: successful operation + summary: test json serialization of form data tags: - fake - summary: test inline additionalProperties + /fake/inline-additionalProperties: + post: operationId: testInlineAdditionalProperties requestBody: - description: request body content: application/json: schema: - type: object additionalProperties: type: string + type: object + description: request body required: true responses: 200: - description: successful operation content: {} - /fake/body-with-query-params: - put: + description: successful operation + summary: test inline additionalProperties tags: - fake + /fake/body-with-query-params: + put: operationId: testBodyWithQueryParams parameters: - - name: query - in: query + - in: query + name: query required: true schema: type: string @@ -945,50 +948,60 @@ paths: required: true responses: 200: - description: Success content: {} + description: Success + tags: + - fake /another-fake/dummy: patch: - tags: - - $another-fake? - summary: To test special tags description: To test special tags operationId: test_special_tags requestBody: - description: client model content: application/json: schema: $ref: '#/components/schemas/Client' + description: client model required: true responses: 200: - description: successful operation content: application/json: schema: $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? components: schemas: Category: - type: object - properties: - id: - type: integer - format: int64 - name: - type: string example: name: name id: 6 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object xml: name: Category User: - type: object + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username properties: id: - type: integer format: int64 + type: integer x-is-unique: true username: type: string @@ -1003,31 +1016,22 @@ components: phone: type: string userStatus: - type: integer description: User Status format: int32 - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username + type: integer + type: object xml: name: User OuterNumber: type: number ArrayOfNumberOnly: - type: object properties: ArrayNumber: - type: array items: type: number - Capitalization: + type: array type: object + Capitalization: properties: smallCamel: type: string @@ -1040,154 +1044,131 @@ components: SCA_ETH_Flow_Points: type: string ATT_NAME: - type: string description: | Name of the pet - MixedPropertiesAndAdditionalPropertiesClass: + type: string type: object + MixedPropertiesAndAdditionalPropertiesClass: properties: uuid: - type: string format: uuid - dateTime: type: string + dateTime: format: date-time + type: string map: - type: object additionalProperties: $ref: '#/components/schemas/Animal' - ApiResponse: + type: object type: object - properties: - code: - type: integer - format: int32 - type: - type: string - message: - type: string + ApiResponse: example: code: 0 type: type message: message - Name: - required: - - name + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string type: object + Name: + description: Model for testing model name same as property name properties: name: - type: integer format: int32 - snake_case: type: integer + snake_case: format: int32 readOnly: true + type: integer property: type: string 123Number: - type: integer readOnly: true - description: Model for testing model name same as property name + type: integer + required: + - name + type: object xml: name: Name EnumClass: - type: string default: -efg enum: - _abc - -efg - (xyz) + type: string List: - type: object properties: 123-list: type: string - NumberOnly: type: object + NumberOnly: properties: JustNumber: type: number - 200_response: type: object + 200_response: + description: Model for testing model name starting with number properties: name: - type: integer format: int32 + type: integer class: type: string - description: Model for testing model name starting with number + type: object xml: name: Name Client: - type: object + example: + client: client properties: client: type: string - example: - client: client + type: object Dog: allOf: - $ref: '#/components/schemas/Animal' - - type: object - properties: + - properties: breed: type: string + type: object Enum_Test: - required: - - enum_string_required - type: object properties: enum_string: - type: string enum: - UPPER - lower - "" + type: string enum_string_required: - type: string enum: - UPPER - lower - "" + type: string enum_integer: - type: integer - format: int32 enum: - 1 - -1 + format: int32 + type: integer enum_number: - type: number - format: double enum: - 1.1 - -1.2 + format: double + type: number outerEnum: $ref: '#/components/schemas/OuterEnum' - Order: + required: + - enum_string_required type: object - properties: - id: - type: integer - format: int64 - petId: - type: integer - format: int64 - quantity: - type: integer - format: int32 - shipDate: - type: string - format: date-time - status: - type: string - description: Order Status - enum: - - placed - - approved - - delivered - complete: - type: boolean - default: false + Order: example: petId: 6 quantity: 1 @@ -1195,83 +1176,107 @@ components: shipDate: 2000-01-23T04:56:07.000+00:00 complete: false status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object xml: name: Order AdditionalPropertiesClass: - type: object properties: map_property: - type: object additionalProperties: type: string - map_of_map_property: type: object + map_of_map_property: additionalProperties: - type: object additionalProperties: type: string - $special[model.name]: + type: object + type: object type: object + $special[model.name]: properties: $special[property.name]: - type: integer format: int64 + type: integer + type: object xml: name: $special[model.name] Return: - type: object + description: Model for testing reserved words properties: return: - type: integer format: int32 - description: Model for testing reserved words + type: integer + type: object xml: name: Return ReadOnlyFirst: - type: object properties: bar: - type: string readOnly: true + type: string baz: type: string - ArrayOfArrayOfNumberOnly: type: object + ArrayOfArrayOfNumberOnly: properties: ArrayArrayNumber: - type: array items: - type: array items: type: number + type: array + type: array + type: object OuterEnum: - type: string enum: - placed - approved - delivered + type: string ArrayTest: - type: object properties: array_of_string: - type: array items: type: string + type: array array_array_of_integer: - type: array items: - type: array items: - type: integer format: int64 - array_array_of_model: - type: array - items: + type: integer type: array + type: array + array_array_of_model: + items: items: $ref: '#/components/schemas/ReadOnlyFirst' - OuterComposite: + type: array + type: array type: object + OuterComposite: + example: {} properties: my_number: $ref: '#/components/schemas/OuterNumber' @@ -1279,179 +1284,144 @@ components: $ref: '#/components/schemas/OuterString' my_boolean: $ref: '#/components/schemas/OuterBoolean' - example: {} - format_test: - required: - - byte - - date - - number - - password type: object + format_test: properties: integer: maximum: 1E+2 minimum: 1E+1 type: integer int32: + format: int32 maximum: 2E+2 minimum: 2E+1 type: integer - format: int32 int64: - type: integer format: int64 + type: integer number: maximum: 543.2 minimum: 32.1 type: number float: + format: float maximum: 987.6 minimum: 54.3 type: number - format: float double: + format: double maximum: 123.4 minimum: 67.8 type: number - format: double string: pattern: /[a-z]/i type: string byte: + format: byte pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ type: string - format: byte binary: - type: string format: binary + type: string date: - type: string format: date + type: string dateTime: - type: string format: date-time - uuid: type: string + uuid: format: uuid + type: string password: + format: password maxLength: 64 minLength: 10 type: string - format: password - EnumArrays: + required: + - byte + - date + - number + - password type: object + EnumArrays: properties: just_symbol: - type: string enum: - '>=' - $ + type: string array_enum: - type: array items: - type: string enum: - fish - crab + type: string + type: array + type: object OuterString: type: string ClassModel: - type: object + description: Model for testing model with "_class" property properties: _class: type: string - description: Model for testing model with "_class" property + type: object OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body Animal: - required: - - className - type: object + discriminator: + propertyName: className properties: className: type: string color: - type: string default: red - discriminator: - propertyName: className + type: string + required: + - className + type: object Cat: allOf: - $ref: '#/components/schemas/Animal' - - type: object - properties: + - properties: declawed: type: boolean + type: object MapTest: - type: object properties: map_map_of_string: - type: object additionalProperties: - type: object additionalProperties: type: string - map_of_enum_string: + type: object type: object + map_of_enum_string: additionalProperties: - type: string enum: - UPPER - lower - Tag: + type: string + type: object type: object - properties: - id: - type: integer - format: int64 - name: - type: string + Tag: example: name: name id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object xml: name: Tag AnimalFarm: - type: array items: $ref: '#/components/schemas/Animal' + type: array Pet: - required: - - name - - photoUrls - type: object - properties: - id: - type: integer - format: int64 - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - type: string - example: doggie - photoUrls: - type: array - xml: - name: photoUrl - wrapped: true - items: - type: string - tags: - type: array - xml: - name: tag - wrapped: true - items: - $ref: '#/components/schemas/Tag' - status: - type: string - description: pet status in the store - enum: - - available - - pending - - sold example: photoUrls: - photoUrls @@ -1467,34 +1437,69 @@ components: - name: name id: 1 status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object xml: name: Pet hasOnlyReadOnly: - type: object properties: bar: - type: string readOnly: true + type: string foo: - type: string readOnly: true + type: string + type: object securitySchemes: petstore_auth: - type: oauth2 flows: implicit: authorizationUrl: http://petstore.swagger.io/api/oauth/dialog scopes: write:pets: modify pets in your account read:pets: read your pets + type: oauth2 http_basic_test: - type: http scheme: basic + type: http api_key: - type: apiKey - name: api_key in: header - api_key_query: + name: api_key type: apiKey - name: api_key_query + api_key_query: in: query + name: api_key_query + type: apiKey diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_fake.go index 615fd230af0..271a39f3613 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake.go @@ -730,7 +730,7 @@ To test enum parameters * @param "EnumQueryString" (optional.String) - Query parameter enum test (string) * @param "EnumQueryInteger" (optional.Int32) - Query parameter enum test (double) * @param "EnumQueryDouble" (optional.Float64) - Query parameter enum test (double) - * @param "EnumFormStringArray" (optional.[]string) - Form parameter enum test (string array) + * @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array) * @param "EnumFormString" (optional.String) - Form parameter enum test (string) */ @@ -741,7 +741,7 @@ type TestEnumParametersOpts struct { EnumQueryString optional.String EnumQueryInteger optional.Int32 EnumQueryDouble optional.Float64 - EnumFormStringArray optional.[]string + EnumFormStringArray optional.Interface EnumFormString optional.String } diff --git a/samples/client/petstore/go/go-petstore-withXml/configuration.go b/samples/client/petstore/go/go-petstore-withXml/configuration.go index 5a93320f70c..19ccc325fa9 100644 --- a/samples/client/petstore/go/go-petstore-withXml/configuration.go +++ b/samples/client/petstore/go/go-petstore-withXml/configuration.go @@ -24,7 +24,7 @@ func (c contextKey) String() string { } var ( - // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. + // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/EnumTest.md b/samples/client/petstore/go/go-petstore-withXml/docs/EnumTest.md index bd077c462cb..85eab0e1d40 100644 --- a/samples/client/petstore/go/go-petstore-withXml/docs/EnumTest.md +++ b/samples/client/petstore/go/go-petstore-withXml/docs/EnumTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **EnumStringRequired** | **string** | | **EnumInteger** | **int32** | | [optional] **EnumNumber** | **float64** | | [optional] -**OuterEnum** | [***OuterEnum**](OuterEnum.md) | | [optional] +**OuterEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md b/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md index 783a26a42b3..5cc42304f3e 100644 --- a/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md +++ b/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md @@ -287,7 +287,7 @@ Name | Type | Description | Notes **enumQueryString** | **optional.String**| Query parameter enum test (string) | [default to -efg] **enumQueryInteger** | **optional.Int32**| Query parameter enum test (double) | **enumQueryDouble** | **optional.Float64**| Query parameter enum test (double) | - **enumFormStringArray** | **optional.[]string**| Form parameter enum test (string array) | [default to $] + **enumFormStringArray** | [**optional.Interface of []string**](string.md)| Form parameter enum test (string array) | [default to $] **enumFormString** | **optional.String**| Form parameter enum test (string) | [default to -efg] ### Return type diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/FormatTest.md b/samples/client/petstore/go/go-petstore-withXml/docs/FormatTest.md index 1af8963ef61..5f70da85aa2 100644 --- a/samples/client/petstore/go/go-petstore-withXml/docs/FormatTest.md +++ b/samples/client/petstore/go/go-petstore-withXml/docs/FormatTest.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **Double** | **float64** | | [optional] **String** | **string** | | [optional] **Byte** | **string** | | -**Binary** | [****os.File**](*os.File.md) | | [optional] +**Binary** | [***os.File**](*os.File.md) | | [optional] **Date** | **string** | | **DateTime** | [**time.Time**](time.Time.md) | | [optional] **Uuid** | **string** | | [optional] diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/Pet.md b/samples/client/petstore/go/go-petstore-withXml/docs/Pet.md index d89a8473d95..049c82eb5a0 100644 --- a/samples/client/petstore/go/go-petstore-withXml/docs/Pet.md +++ b/samples/client/petstore/go/go-petstore-withXml/docs/Pet.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Id** | **int64** | | [optional] -**Category** | [***Category**](Category.md) | | [optional] +**Category** | [**Category**](Category.md) | | [optional] **Name** | **string** | | **PhotoUrls** | **[]string** | | **Tags** | [**[]Tag**](Tag.md) | | [optional] diff --git a/samples/client/petstore/go/go-petstore-withXml/model_enum_test.go b/samples/client/petstore/go/go-petstore-withXml/model_enum_test.go index 82f47647b60..a9e3f2555b1 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_enum_test.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_enum_test.go @@ -14,5 +14,5 @@ type EnumTest struct { EnumStringRequired string `json:"enum_string_required" xml:"enum_string_required"` EnumInteger int32 `json:"enum_integer,omitempty" xml:"enum_integer"` EnumNumber float64 `json:"enum_number,omitempty" xml:"enum_number"` - OuterEnum *OuterEnum `json:"outerEnum,omitempty" xml:"outerEnum"` + OuterEnum OuterEnum `json:"outerEnum,omitempty" xml:"outerEnum"` } diff --git a/samples/client/petstore/go/go-petstore-withXml/model_format_test.go b/samples/client/petstore/go/go-petstore-withXml/model_format_test.go index ecf31f631f2..9bfa6008c25 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_format_test.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_format_test.go @@ -22,7 +22,7 @@ type FormatTest struct { Double float64 `json:"double,omitempty" xml:"double"` String string `json:"string,omitempty" xml:"string"` Byte string `json:"byte" xml:"byte"` - Binary **os.File `json:"binary,omitempty" xml:"binary"` + Binary *os.File `json:"binary,omitempty" xml:"binary"` Date string `json:"date" xml:"date"` DateTime time.Time `json:"dateTime,omitempty" xml:"dateTime"` Uuid string `json:"uuid,omitempty" xml:"uuid"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_pet.go b/samples/client/petstore/go/go-petstore-withXml/model_pet.go index f572643ff15..ca15bb5e8a2 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_pet.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_pet.go @@ -11,7 +11,7 @@ package petstore type Pet struct { Id int64 `json:"id,omitempty" xml:"id"` - Category *Category `json:"category,omitempty" xml:"category"` + Category Category `json:"category,omitempty" xml:"category"` Name string `json:"name" xml:"name"` PhotoUrls []string `json:"photoUrls" xml:"photoUrls"` Tags []Tag `json:"tags,omitempty" xml:"tags"` diff --git a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION index 096bf47efe3..82602aa4190 100644 --- a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index 443788211b9..c5c2dfaffa7 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -1,31 +1,27 @@ openapi: 3.0.1 info: - title: OpenAPI Petstore description: 'This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: " \' license: name: Apache-2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore version: 1.0.0 servers: - url: http://petstore.swagger.io:80/v2 tags: -- name: pet - description: Everything about your Pets -- name: store - description: Access to Petstore orders -- name: user - description: Operations about user +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user paths: /pet: - put: - tags: - - pet - summary: Update an existing pet - operationId: updatePet + post: + operationId: addPet requestBody: - description: Pet object that needs to be added to the store content: application/json: schema: @@ -33,144 +29,171 @@ paths: application/xml: schema: $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + 405: + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + operationId: updatePet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store required: true responses: 400: + content: {} description: Invalid ID supplied - content: {} 404: + content: {} description: Pet not found - content: {} 405: - description: Validation exception content: {} + description: Validation exception security: - petstore_auth: - write:pets - read:pets - post: + summary: Update an existing pet tags: - pet - summary: Add a new pet to the store - operationId: addPet - 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 - responses: - 405: - description: Invalid input - content: {} - security: - - petstore_auth: - - write:pets - - read:pets /pet/findByStatus: get: - tags: - - pet - summary: Finds Pets by status description: Multiple status values can be provided with comma separated strings operationId: findPetsByStatus parameters: - - name: status - in: query - description: Status values that need to be considered for filter - required: true + - description: Status values that need to be considered for filter explode: false + in: query + name: status + required: true schema: - type: array items: - type: string default: available enum: - available - pending - sold + type: string + type: array + style: form responses: 200: - description: successful operation content: application/xml: schema: - type: array items: $ref: '#/components/schemas/Pet' + type: array application/json: schema: - type: array items: $ref: '#/components/schemas/Pet' + type: array + description: successful operation 400: - description: Invalid status value content: {} + description: Invalid status value security: - petstore_auth: - write:pets - read:pets - /pet/findByTags: - get: + summary: Finds Pets by status tags: - pet - summary: Finds Pets by tags + /pet/findByTags: + get: + deprecated: true description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - - name: tags - in: query - description: Tags to filter by - required: true + - description: Tags to filter by explode: false + in: query + name: tags + required: true schema: - type: array items: type: string + type: array + style: form responses: 200: - description: successful operation content: application/xml: schema: - type: array items: $ref: '#/components/schemas/Pet' + type: array application/json: schema: - type: array items: $ref: '#/components/schemas/Pet' + type: array + description: successful operation 400: - description: Invalid tag value content: {} - deprecated: true + description: Invalid tag value security: - petstore_auth: - write:pets - read:pets - /pet/{petId}: - get: + summary: Finds Pets by tags tags: - pet - summary: Find pet by ID + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + 400: + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + get: description: Returns a single pet operationId: getPetById parameters: - - name: petId + - description: ID of pet to return in: path - description: ID of pet to return + name: petId required: true schema: - type: integer format: int64 + type: integer responses: 200: - description: successful operation content: application/xml: schema: @@ -178,143 +201,118 @@ paths: application/json: schema: $ref: '#/components/schemas/Pet' + description: successful operation 400: + content: {} description: Invalid ID supplied - content: {} 404: - description: Pet not found content: {} + description: Pet not found security: - api_key: [] - post: + summary: Find pet by ID tags: - pet - summary: Updates a pet in the store with form data + post: operationId: updatePetWithForm parameters: - - name: petId + - description: ID of pet that needs to be updated in: path - description: ID of pet that needs to be updated + name: petId required: true schema: - type: integer format: int64 + type: integer requestBody: content: application/x-www-form-urlencoded: schema: properties: name: - type: string description: Updated name of the pet - status: type: string + status: description: Updated status of the pet + type: string responses: 405: - description: Invalid input content: {} + description: Invalid input security: - petstore_auth: - write:pets - read:pets - delete: + summary: Updates a pet in the store with form data tags: - pet - summary: Deletes a pet - operationId: deletePet - parameters: - - name: api_key - in: header - schema: - type: string - - name: petId - in: path - description: Pet id to delete - required: true - schema: - type: integer - format: int64 - responses: - 400: - description: Invalid pet value - content: {} - security: - - petstore_auth: - - write:pets - - read:pets /pet/{petId}/uploadImage: post: - tags: - - pet - summary: uploads an image operationId: uploadFile parameters: - - name: petId + - description: ID of pet to update in: path - description: ID of pet to update + name: petId required: true schema: - type: integer format: int64 + type: integer requestBody: content: multipart/form-data: schema: properties: additionalMetadata: - type: string description: Additional data to pass to server - file: type: string + file: description: file to upload format: binary + type: string responses: 200: - description: successful operation content: application/json: schema: $ref: '#/components/schemas/ApiResponse' + description: successful operation security: - petstore_auth: - write:pets - read:pets + summary: uploads an image + tags: + - pet /store/inventory: get: - tags: - - store - summary: Returns pet inventories by status description: Returns a map of status codes to quantities operationId: getInventory responses: 200: - description: successful operation content: application/json: schema: - type: object additionalProperties: - type: integer format: int32 + type: integer + type: object + description: successful operation security: - api_key: [] - /store/order: - post: + summary: Returns pet inventories by status tags: - store - summary: Place an order for a pet + /store/order: + post: operationId: placeOrder requestBody: - description: order placed for purchasing the pet content: '*/*': schema: $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet required: true responses: 200: - description: successful operation content: application/xml: schema: @@ -322,187 +320,207 @@ paths: application/json: schema: $ref: '#/components/schemas/Order' + description: successful operation 400: + content: {} description: Invalid Order - content: {} + summary: Place an order for a pet + tags: + - store /store/order/{order_id}: - get: - tags: - - store - summary: Find purchase order by ID - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - operationId: getOrderById - parameters: - - name: order_id - in: path - description: ID of pet that needs to be fetched - required: true - schema: - maximum: 5 - minimum: 1 - type: integer - format: int64 - responses: - 200: - description: successful operation - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - 400: - description: Invalid ID supplied - content: {} - 404: - description: Order not found - content: {} delete: - tags: - - store - summary: Delete purchase order by ID description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - - name: order_id + - description: ID of the order that needs to be deleted in: path - description: ID of the order that needs to be deleted + name: order_id required: true schema: type: string responses: 400: + content: {} description: Invalid ID supplied - content: {} 404: - description: Order not found content: {} + description: Order not found + summary: Delete purchase order by ID + tags: + - store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + 200: + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + 400: + content: {} + description: Invalid ID supplied + 404: + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store /user: post: - tags: - - user - summary: Create user description: This can only be done by the logged in user. operationId: createUser requestBody: - description: Created user object content: '*/*': schema: $ref: '#/components/schemas/User' + description: Created user object required: true responses: default: - description: successful operation content: {} + description: successful operation + summary: Create user + tags: + - user /user/createWithArray: post: - tags: - - user - summary: Creates list of users with given input array operationId: createUsersWithArrayInput requestBody: - description: List of user object content: '*/*': schema: - type: array items: $ref: '#/components/schemas/User' + type: array + description: List of user object required: true responses: default: - description: successful operation content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user /user/createWithList: post: - tags: - - user - summary: Creates list of users with given input array operationId: createUsersWithListInput requestBody: - description: List of user object content: '*/*': schema: - type: array items: $ref: '#/components/schemas/User' + type: array + description: List of user object required: true responses: default: - description: successful operation content: {} - /user/login: - get: + description: successful operation + summary: Creates list of users with given input array tags: - user - summary: Logs user into the system + /user/login: + get: operationId: loginUser parameters: - - name: username + - description: The user name for login in: query - description: The user name for login + name: username required: true schema: type: string - - name: password + - description: The password for login in clear text in: query - description: The password for login in clear text + name: password required: true schema: type: string responses: 200: + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string description: successful operation headers: X-Rate-Limit: description: calls per hour allowed by the user schema: - type: integer format: int32 + type: integer X-Expires-After: description: date in UTC when token expires schema: - type: string format: date-time - content: - application/xml: - schema: - type: string - application/json: - schema: type: string 400: - description: Invalid username/password supplied content: {} - /user/logout: - get: + description: Invalid username/password supplied + summary: Logs user into the system tags: - user - summary: Logs out current logged in user session + /user/logout: + get: operationId: logoutUser responses: default: - description: successful operation content: {} - /user/{username}: - get: + description: successful operation + summary: Logs out current logged in user session tags: - user - summary: Get user by user name + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + in: path + name: username + required: true + schema: + type: string + responses: + 400: + content: {} + description: Invalid username supplied + 404: + content: {} + description: User not found + summary: Delete user + tags: + - user + get: operationId: getUserByName parameters: - - name: username + - description: The name that needs to be fetched. Use user1 for testing. in: path - description: The name that needs to be fetched. Use user1 for testing. + name: username required: true schema: type: string responses: 200: - description: successful operation content: application/xml: schema: @@ -510,188 +528,188 @@ paths: application/json: schema: $ref: '#/components/schemas/User' + description: successful operation 400: + content: {} description: Invalid username supplied - content: {} 404: - description: User not found content: {} - put: + description: User not found + summary: Get user by user name tags: - user - summary: Updated user + put: description: This can only be done by the logged in user. operationId: updateUser parameters: - - name: username + - description: name that need to be deleted in: path - description: name that need to be deleted + name: username required: true schema: type: string requestBody: - description: Updated user object content: '*/*': schema: $ref: '#/components/schemas/User' + description: Updated user object required: true responses: 400: + content: {} description: Invalid user supplied - content: {} 404: - description: User not found content: {} - delete: + description: User not found + summary: Updated user tags: - user - summary: Delete user - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - name: username - in: path - description: The name that needs to be deleted - required: true - schema: - type: string - responses: - 400: - description: Invalid username supplied - content: {} - 404: - description: User not found - content: {} /fake_classname_test: patch: - tags: - - fake_classname_tags 123#$%^ - summary: To test class name in snake case description: To test class name in snake case operationId: testClassname requestBody: - description: client model content: application/json: schema: $ref: '#/components/schemas/Client' + description: client model required: true responses: 200: - description: successful operation content: application/json: schema: $ref: '#/components/schemas/Client' + description: successful operation security: - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ /fake: get: - tags: - - fake - summary: To test enum parameters description: To test enum parameters operationId: testEnumParameters parameters: - - name: enum_header_string_array - in: header - description: Header parameter enum test (string array) - schema: - type: array - items: - type: string - default: $ - enum: - - '>' - - $ - - name: enum_header_string - in: header - description: Header parameter enum test (string) - schema: - type: string - default: -efg - enum: - - _abc - - -efg - - (xyz) - - name: enum_query_string_array - in: query - description: Query parameter enum test (string array) + - description: Header parameter enum test (string array) explode: false + in: header + name: enum_header_string_array schema: - type: array items: - type: string default: $ enum: - '>' - $ - - name: enum_query_string - in: query - description: Query parameter enum test (string) + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string schema: - type: string default: -efg enum: - _abc - -efg - (xyz) - - name: enum_query_integer + type: string + - description: Query parameter enum test (string array) + explode: false in: query - description: Query parameter enum test (double) + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer schema: - type: integer - format: int32 enum: - 1 - -2 - - name: enum_query_double + format: int32 + type: integer + - description: Query parameter enum test (double) in: query - description: Query parameter enum test (double) + name: enum_query_double schema: - type: number - format: double enum: - 1.1 - -1.2 + format: double + type: number requestBody: content: application/x-www-form-urlencoded: schema: properties: enum_form_string_array: - type: array description: Form parameter enum test (string array) items: - type: string default: $ enum: - '>' - $ + type: string + type: array enum_form_string: - type: string - description: Form parameter enum test (string) default: -efg + description: Form parameter enum test (string) enum: - _abc - -efg - (xyz) + type: string responses: 400: + content: {} description: Invalid request - content: {} 404: - description: Not found content: {} - post: + description: Not found + summary: To test enum parameters tags: - fake - summary: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + post: description: | Fake endpoint for testing various parameters 假端點 @@ -702,238 +720,223 @@ paths: content: application/x-www-form-urlencoded: schema: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string required: - byte - double - number - pattern_without_delimiter - properties: - integer: - maximum: 100 - minimum: 10 - type: integer - description: None - int32: - maximum: 200 - minimum: 20 - type: integer - description: None - format: int32 - int64: - type: integer - description: None - format: int64 - number: - maximum: 543.2 - minimum: 32.1 - type: number - description: None - float: - maximum: 987.6 - type: number - description: None - format: float - double: - maximum: 123.4 - minimum: 67.8 - type: number - description: None - format: double - string: - pattern: /[a-z]/i - type: string - description: None - pattern_without_delimiter: - pattern: ^[A-Z].* - type: string - description: None - byte: - type: string - description: None - format: byte - binary: - type: string - description: None - format: binary - date: - type: string - description: None - format: date - dateTime: - type: string - description: None - format: date-time - password: - maxLength: 64 - minLength: 10 - type: string - description: None - format: password - callback: - type: string - description: None required: true responses: 400: + content: {} description: Invalid username supplied - content: {} 404: - description: User not found content: {} + description: User not found security: - http_basic_test: [] - patch: + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 tags: - fake - summary: To test "client" model - description: To test "client" model - operationId: testClientModel - requestBody: - description: client model - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - required: true - responses: - 200: - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Client' /fake/outer/number: post: - tags: - - fake description: Test serialization of outer number types operationId: fakeOuterNumberSerialize requestBody: - description: Input number as post body content: '*/*': schema: $ref: '#/components/schemas/OuterNumber' + description: Input number as post body required: false responses: 200: - description: Output number content: '*/*': schema: $ref: '#/components/schemas/OuterNumber' - /fake/outer/string: - post: + description: Output number tags: - fake + /fake/outer/string: + post: description: Test serialization of outer string types operationId: fakeOuterStringSerialize requestBody: - description: Input string as post body content: '*/*': schema: $ref: '#/components/schemas/OuterString' + description: Input string as post body required: false responses: 200: - description: Output string content: '*/*': schema: $ref: '#/components/schemas/OuterString' - /fake/outer/boolean: - post: + description: Output string tags: - fake + /fake/outer/boolean: + post: description: Test serialization of outer boolean types operationId: fakeOuterBooleanSerialize requestBody: - description: Input boolean as post body content: '*/*': schema: $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body required: false responses: 200: - description: Output boolean content: '*/*': schema: $ref: '#/components/schemas/OuterBoolean' - /fake/outer/composite: - post: + description: Output boolean tags: - fake + /fake/outer/composite: + post: description: Test serialization of object with outer number type operationId: fakeOuterCompositeSerialize requestBody: - description: Input composite as post body content: '*/*': schema: $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body required: false responses: 200: - description: Output composite content: '*/*': schema: $ref: '#/components/schemas/OuterComposite' - /fake/jsonFormData: - get: + description: Output composite tags: - fake - summary: test json serialization of form data + /fake/jsonFormData: + get: operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string required: - param - param2 - properties: - param: - type: string - description: field1 - param2: - type: string - description: field2 required: true responses: 200: - description: successful operation content: {} - /fake/inline-additionalProperties: - post: + description: successful operation + summary: test json serialization of form data tags: - fake - summary: test inline additionalProperties + /fake/inline-additionalProperties: + post: operationId: testInlineAdditionalProperties requestBody: - description: request body content: application/json: schema: - type: object additionalProperties: type: string + type: object + description: request body required: true responses: 200: - description: successful operation content: {} - /fake/body-with-query-params: - put: + description: successful operation + summary: test inline additionalProperties tags: - fake + /fake/body-with-query-params: + put: operationId: testBodyWithQueryParams parameters: - - name: query - in: query + - in: query + name: query required: true schema: type: string @@ -945,50 +948,60 @@ paths: required: true responses: 200: - description: Success content: {} + description: Success + tags: + - fake /another-fake/dummy: patch: - tags: - - $another-fake? - summary: To test special tags description: To test special tags operationId: test_special_tags requestBody: - description: client model content: application/json: schema: $ref: '#/components/schemas/Client' + description: client model required: true responses: 200: - description: successful operation content: application/json: schema: $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? components: schemas: Category: - type: object - properties: - id: - type: integer - format: int64 - name: - type: string example: name: name id: 6 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object xml: name: Category User: - type: object + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username properties: id: - type: integer format: int64 + type: integer x-is-unique: true username: type: string @@ -1003,31 +1016,22 @@ components: phone: type: string userStatus: - type: integer description: User Status format: int32 - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username + type: integer + type: object xml: name: User OuterNumber: type: number ArrayOfNumberOnly: - type: object properties: ArrayNumber: - type: array items: type: number - Capitalization: + type: array type: object + Capitalization: properties: smallCamel: type: string @@ -1040,154 +1044,131 @@ components: SCA_ETH_Flow_Points: type: string ATT_NAME: - type: string description: | Name of the pet - MixedPropertiesAndAdditionalPropertiesClass: + type: string type: object + MixedPropertiesAndAdditionalPropertiesClass: properties: uuid: - type: string format: uuid - dateTime: type: string + dateTime: format: date-time + type: string map: - type: object additionalProperties: $ref: '#/components/schemas/Animal' - ApiResponse: + type: object type: object - properties: - code: - type: integer - format: int32 - type: - type: string - message: - type: string + ApiResponse: example: code: 0 type: type message: message - Name: - required: - - name + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string type: object + Name: + description: Model for testing model name same as property name properties: name: - type: integer format: int32 - snake_case: type: integer + snake_case: format: int32 readOnly: true + type: integer property: type: string 123Number: - type: integer readOnly: true - description: Model for testing model name same as property name + type: integer + required: + - name + type: object xml: name: Name EnumClass: - type: string default: -efg enum: - _abc - -efg - (xyz) + type: string List: - type: object properties: 123-list: type: string - NumberOnly: type: object + NumberOnly: properties: JustNumber: type: number - 200_response: type: object + 200_response: + description: Model for testing model name starting with number properties: name: - type: integer format: int32 + type: integer class: type: string - description: Model for testing model name starting with number + type: object xml: name: Name Client: - type: object + example: + client: client properties: client: type: string - example: - client: client + type: object Dog: allOf: - $ref: '#/components/schemas/Animal' - - type: object - properties: + - properties: breed: type: string + type: object Enum_Test: - required: - - enum_string_required - type: object properties: enum_string: - type: string enum: - UPPER - lower - "" + type: string enum_string_required: - type: string enum: - UPPER - lower - "" + type: string enum_integer: - type: integer - format: int32 enum: - 1 - -1 + format: int32 + type: integer enum_number: - type: number - format: double enum: - 1.1 - -1.2 + format: double + type: number outerEnum: $ref: '#/components/schemas/OuterEnum' - Order: + required: + - enum_string_required type: object - properties: - id: - type: integer - format: int64 - petId: - type: integer - format: int64 - quantity: - type: integer - format: int32 - shipDate: - type: string - format: date-time - status: - type: string - description: Order Status - enum: - - placed - - approved - - delivered - complete: - type: boolean - default: false + Order: example: petId: 6 quantity: 1 @@ -1195,83 +1176,107 @@ components: shipDate: 2000-01-23T04:56:07.000+00:00 complete: false status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object xml: name: Order AdditionalPropertiesClass: - type: object properties: map_property: - type: object additionalProperties: type: string - map_of_map_property: type: object + map_of_map_property: additionalProperties: - type: object additionalProperties: type: string - $special[model.name]: + type: object + type: object type: object + $special[model.name]: properties: $special[property.name]: - type: integer format: int64 + type: integer + type: object xml: name: $special[model.name] Return: - type: object + description: Model for testing reserved words properties: return: - type: integer format: int32 - description: Model for testing reserved words + type: integer + type: object xml: name: Return ReadOnlyFirst: - type: object properties: bar: - type: string readOnly: true + type: string baz: type: string - ArrayOfArrayOfNumberOnly: type: object + ArrayOfArrayOfNumberOnly: properties: ArrayArrayNumber: - type: array items: - type: array items: type: number + type: array + type: array + type: object OuterEnum: - type: string enum: - placed - approved - delivered + type: string ArrayTest: - type: object properties: array_of_string: - type: array items: type: string + type: array array_array_of_integer: - type: array items: - type: array items: - type: integer format: int64 - array_array_of_model: - type: array - items: + type: integer type: array + type: array + array_array_of_model: + items: items: $ref: '#/components/schemas/ReadOnlyFirst' - OuterComposite: + type: array + type: array type: object + OuterComposite: + example: {} properties: my_number: $ref: '#/components/schemas/OuterNumber' @@ -1279,179 +1284,144 @@ components: $ref: '#/components/schemas/OuterString' my_boolean: $ref: '#/components/schemas/OuterBoolean' - example: {} - format_test: - required: - - byte - - date - - number - - password type: object + format_test: properties: integer: maximum: 1E+2 minimum: 1E+1 type: integer int32: + format: int32 maximum: 2E+2 minimum: 2E+1 type: integer - format: int32 int64: - type: integer format: int64 + type: integer number: maximum: 543.2 minimum: 32.1 type: number float: + format: float maximum: 987.6 minimum: 54.3 type: number - format: float double: + format: double maximum: 123.4 minimum: 67.8 type: number - format: double string: pattern: /[a-z]/i type: string byte: + format: byte pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ type: string - format: byte binary: - type: string format: binary + type: string date: - type: string format: date + type: string dateTime: - type: string format: date-time - uuid: type: string + uuid: format: uuid + type: string password: + format: password maxLength: 64 minLength: 10 type: string - format: password - EnumArrays: + required: + - byte + - date + - number + - password type: object + EnumArrays: properties: just_symbol: - type: string enum: - '>=' - $ + type: string array_enum: - type: array items: - type: string enum: - fish - crab + type: string + type: array + type: object OuterString: type: string ClassModel: - type: object + description: Model for testing model with "_class" property properties: _class: type: string - description: Model for testing model with "_class" property + type: object OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body Animal: - required: - - className - type: object + discriminator: + propertyName: className properties: className: type: string color: - type: string default: red - discriminator: - propertyName: className + type: string + required: + - className + type: object Cat: allOf: - $ref: '#/components/schemas/Animal' - - type: object - properties: + - properties: declawed: type: boolean + type: object MapTest: - type: object properties: map_map_of_string: - type: object additionalProperties: - type: object additionalProperties: type: string - map_of_enum_string: + type: object type: object + map_of_enum_string: additionalProperties: - type: string enum: - UPPER - lower - Tag: + type: string + type: object type: object - properties: - id: - type: integer - format: int64 - name: - type: string + Tag: example: name: name id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object xml: name: Tag AnimalFarm: - type: array items: $ref: '#/components/schemas/Animal' + type: array Pet: - required: - - name - - photoUrls - type: object - properties: - id: - type: integer - format: int64 - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - type: string - example: doggie - photoUrls: - type: array - xml: - name: photoUrl - wrapped: true - items: - type: string - tags: - type: array - xml: - name: tag - wrapped: true - items: - $ref: '#/components/schemas/Tag' - status: - type: string - description: pet status in the store - enum: - - available - - pending - - sold example: photoUrls: - photoUrls @@ -1467,34 +1437,69 @@ components: - name: name id: 1 status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object xml: name: Pet hasOnlyReadOnly: - type: object properties: bar: - type: string readOnly: true + type: string foo: - type: string readOnly: true + type: string + type: object securitySchemes: petstore_auth: - type: oauth2 flows: implicit: authorizationUrl: http://petstore.swagger.io/api/oauth/dialog scopes: write:pets: modify pets in your account read:pets: read your pets + type: oauth2 http_basic_test: - type: http scheme: basic + type: http api_key: - type: apiKey - name: api_key in: header - api_key_query: + name: api_key type: apiKey - name: api_key_query + api_key_query: in: query + name: api_key_query + type: apiKey diff --git a/samples/client/petstore/go/go-petstore/configuration.go b/samples/client/petstore/go/go-petstore/configuration.go index 5a93320f70c..19ccc325fa9 100644 --- a/samples/client/petstore/go/go-petstore/configuration.go +++ b/samples/client/petstore/go/go-petstore/configuration.go @@ -24,7 +24,7 @@ func (c contextKey) String() string { } var ( - // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. + // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. diff --git a/samples/client/petstore/go/go-petstore/docs/EnumTest.md b/samples/client/petstore/go/go-petstore/docs/EnumTest.md index bd077c462cb..85eab0e1d40 100644 --- a/samples/client/petstore/go/go-petstore/docs/EnumTest.md +++ b/samples/client/petstore/go/go-petstore/docs/EnumTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **EnumStringRequired** | **string** | | **EnumInteger** | **int32** | | [optional] **EnumNumber** | **float64** | | [optional] -**OuterEnum** | [***OuterEnum**](OuterEnum.md) | | [optional] +**OuterEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/FormatTest.md b/samples/client/petstore/go/go-petstore/docs/FormatTest.md index 1af8963ef61..5f70da85aa2 100644 --- a/samples/client/petstore/go/go-petstore/docs/FormatTest.md +++ b/samples/client/petstore/go/go-petstore/docs/FormatTest.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **Double** | **float64** | | [optional] **String** | **string** | | [optional] **Byte** | **string** | | -**Binary** | [****os.File**](*os.File.md) | | [optional] +**Binary** | [***os.File**](*os.File.md) | | [optional] **Date** | **string** | | **DateTime** | [**time.Time**](time.Time.md) | | [optional] **Uuid** | **string** | | [optional] diff --git a/samples/client/petstore/go/go-petstore/docs/Pet.md b/samples/client/petstore/go/go-petstore/docs/Pet.md index d89a8473d95..049c82eb5a0 100644 --- a/samples/client/petstore/go/go-petstore/docs/Pet.md +++ b/samples/client/petstore/go/go-petstore/docs/Pet.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Id** | **int64** | | [optional] -**Category** | [***Category**](Category.md) | | [optional] +**Category** | [**Category**](Category.md) | | [optional] **Name** | **string** | | **PhotoUrls** | **[]string** | | **Tags** | [**[]Tag**](Tag.md) | | [optional] diff --git a/samples/client/petstore/go/go-petstore/model_enum_test.go b/samples/client/petstore/go/go-petstore/model_enum_test.go index 71786fa5484..f85f31501a0 100644 --- a/samples/client/petstore/go/go-petstore/model_enum_test.go +++ b/samples/client/petstore/go/go-petstore/model_enum_test.go @@ -14,5 +14,5 @@ type EnumTest struct { EnumStringRequired string `json:"enum_string_required"` EnumInteger int32 `json:"enum_integer,omitempty"` EnumNumber float64 `json:"enum_number,omitempty"` - OuterEnum *OuterEnum `json:"outerEnum,omitempty"` + OuterEnum OuterEnum `json:"outerEnum,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_format_test.go b/samples/client/petstore/go/go-petstore/model_format_test.go index 6af8f1915e9..d723bdfee39 100644 --- a/samples/client/petstore/go/go-petstore/model_format_test.go +++ b/samples/client/petstore/go/go-petstore/model_format_test.go @@ -22,7 +22,7 @@ type FormatTest struct { Double float64 `json:"double,omitempty"` String string `json:"string,omitempty"` Byte string `json:"byte"` - Binary **os.File `json:"binary,omitempty"` + Binary *os.File `json:"binary,omitempty"` Date string `json:"date"` DateTime time.Time `json:"dateTime,omitempty"` Uuid string `json:"uuid,omitempty"` diff --git a/samples/client/petstore/go/go-petstore/model_pet.go b/samples/client/petstore/go/go-petstore/model_pet.go index be0dcd3062f..4930dbb92e8 100644 --- a/samples/client/petstore/go/go-petstore/model_pet.go +++ b/samples/client/petstore/go/go-petstore/model_pet.go @@ -11,7 +11,7 @@ package petstore type Pet struct { Id int64 `json:"id,omitempty"` - Category *Category `json:"category,omitempty"` + Category Category `json:"category,omitempty"` Name string `json:"name"` PhotoUrls []string `json:"photoUrls"` Tags []Tag `json:"tags,omitempty"` diff --git a/samples/server/petstore/go-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-api-server/.openapi-generator/VERSION index ad121e8340e..82602aa4190 100644 --- a/samples/server/petstore/go-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.1-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file From f4a534855c7d99ffedc7cf802daa634630fdc782 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 21 Jun 2018 22:16:12 +0800 Subject: [PATCH 23/35] add an update to the Q&A (#371) --- docs/qna.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/qna.md b/docs/qna.md index 73e03b08de0..ec921b8958f 100644 --- a/docs/qna.md +++ b/docs/qna.md @@ -16,6 +16,8 @@ There are several reasons: 1. According to SmartBear, [Swagger Codegen 2.x and 3.x should be supported in parallel for a while](https://github.com/swagger-api/swagger-codegen/issues/7754#issuecomment-375039048) without the possibility to work with git branches to merge the fixes from one branch to the next. Having to implement everything twice is not a good idea and the best use of the Swagger Codegen community resources. 1. Having a community-driven version can bring the project to the next level. +UPDATE: After the public launch of OpenAPI Generator, some of the core team members were contacted by Ron (SmartBear) and we explained to him the reasons of the fork as explained above. We also asked him to contact team@openapitools.org if he wants to discuss further but so far we don't see any email from him to team@openapitools.org. + #### Has anything been done in attempt to address the issues before deciding to fork Swagger Codegen and maintain a community-driven version? There were several conversations with SmartBear (Ron, Hugo) via emails, gitter, Skype call and GitHub issues. From a897feef50989d8b0d0238c067eebaef4f7f6c70 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 21 Jun 2018 22:59:02 +0800 Subject: [PATCH 24/35] Fix alias to map in the model's properties (#360) * add test case for ref to map (boolean) in fake petstore spec * fix alias to map in model properties * remove logging from new method * update samples for the new map test case * fix javadoc string * skip testSanitizeNestedInvalidValue in php test * skip test in php oas3 client * add logic to handle outer enum * update samples * fix alias in model's allOf * generate models for map def * update petstore samples * update petstore samples --- .../openapitools/codegen/DefaultCodegen.java | 49 +- .../codegen/utils/ModelUtils.java | 95 +- .../resources/2_0/pathWithHtmlEntity.yaml | 58 + ...ith-fake-endpoints-models-for-testing.yaml | 9 + .../go/go-petstore/.openapi-generator/VERSION | 2 +- .../client/petstore/go/go-petstore/README.md | 1 + .../petstore/go/go-petstore/api/openapi.yaml | 1261 +++++++++-------- .../petstore/go/go-petstore/configuration.go | 2 +- .../petstore/go/go-petstore/docs/MapTest.md | 2 + .../go/go-petstore/docs/StringBooleanMap.md | 9 + .../petstore/go/go-petstore/model_map_test.go | 2 + .../go-petstore/model_string_boolean_map.go | 13 + .../openapitools/client/model/MapTest.java | 59 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 65 + .../java/google-api-client/docs/MapTest.md | 2 + .../docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 59 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 65 + .../petstore/java/jersey1/docs/MapTest.md | 2 + .../java/jersey1/docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 59 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 65 + .../java/jersey2-java6/docs/MapTest.md | 2 + .../jersey2-java6/docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 59 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 64 + .../java/jersey2-java8/docs/MapTest.md | 2 + .../jersey2-java8/docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 59 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 65 + .../petstore/java/jersey2/docs/MapTest.md | 2 + .../java/jersey2/docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 59 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 65 + .../docs/MapTest.md | 2 + .../docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 65 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 91 ++ .../petstore/java/okhttp-gson/docs/MapTest.md | 2 + .../java/okhttp-gson/docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 61 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 65 + .../java/rest-assured/docs/MapTest.md | 2 + .../rest-assured/docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 61 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 65 + .../petstore/java/resteasy/docs/MapTest.md | 2 + .../java/resteasy/docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 59 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 65 + .../java/resttemplate-withXml/docs/MapTest.md | 2 + .../docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 65 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 70 + .../java/resttemplate/docs/MapTest.md | 2 + .../resttemplate/docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 59 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 65 + .../openapitools/client/model/MapTest.java | 61 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 65 + .../java/retrofit2-play24/docs/MapTest.md | 2 + .../retrofit2-play24/docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 60 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 67 + .../java/retrofit2-play25/docs/MapTest.md | 2 + .../retrofit2-play25/docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 60 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 67 + .../petstore/java/retrofit2/docs/MapTest.md | 2 + .../java/retrofit2/docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 61 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 65 + .../petstore/java/retrofit2rx/docs/MapTest.md | 2 + .../java/retrofit2rx/docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 61 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 65 + .../java/retrofit2rx2/docs/MapTest.md | 2 + .../retrofit2rx2/docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 61 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 65 + .../petstore/java/vertx/docs/MapTest.md | 2 + .../java/vertx/docs/StringBooleanMap.md | 9 + .../openapitools/client/model/MapTest.java | 59 +- .../client/model/OuterComposite.java | 2 +- .../client/model/StringBooleanMap.java | 65 + .../petstore/php/OpenAPIClient-php/README.md | 1 + .../OpenAPIClient-php/docs/Model/MapTest.md | 2 + .../docs/Model/StringBooleanMap.md | 9 + .../OpenAPIClient-php/lib/Model/MapTest.php | 70 +- .../lib/Model/StringBooleanMap.php | 276 ++++ .../test/Model/MapTestTest.php | 14 + .../test/Model/StringBooleanMapTest.php | 78 + samples/client/petstore/ruby/README.md | 1 + samples/client/petstore/ruby/docs/MapTest.md | 2 + .../petstore/ruby/docs/StringBooleanMap.md | 7 + samples/client/petstore/ruby/lib/petstore.rb | 1 + .../ruby/lib/petstore/models/map_test.rb | 28 +- .../lib/petstore/models/string_boolean_map.rb | 174 +++ .../spec/models/string_boolean_map_spec.rb | 35 + .../go-api-server/.openapi-generator/VERSION | 2 +- .../java/org/openapitools/model/MapTest.java | 51 + .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 40 + .../java/org/openapitools/model/MapTest.java | 61 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 65 + .../java/org/openapitools/model/MapTest.java | 45 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 56 + .../src/main/openapi/openapi.yaml | 22 +- .../java/org/openapitools/model/MapTest.java | 45 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 56 + .../jaxrs-spec/src/main/openapi/openapi.yaml | 22 +- .../java/org/openapitools/model/MapTest.java | 61 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 64 + .../java/org/openapitools/model/MapTest.java | 61 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 64 + .../java/org/openapitools/model/MapTest.java | 61 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 64 + .../java/org/openapitools/model/MapTest.java | 61 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 64 + .../php-ze-ph/src/App/DTO/MapTest.php | 16 + .../src/App/DTO/StringBooleanMap.php | 11 + .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/model/MapTest.java | 65 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 51 + .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/model/MapTest.java | 65 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 51 + .../openapitools/api/FakeApiController.java | 2 +- .../java/org/openapitools/model/MapTest.java | 65 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 51 + .../openapitools/api/FakeApiController.java | 2 +- .../java/org/openapitools/model/MapTest.java | 65 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 51 + .../org/openapitools/api/FakeApiDelegate.java | 2 +- .../java/org/openapitools/model/MapTest.java | 65 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 51 + .../java/org/openapitools/model/MapTest.java | 65 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 51 + .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/model/MapTest.java | 65 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 51 + .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/model/MapTest.java | 65 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 51 + .../src/main/resources/openapi.yaml | 22 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/model/MapTest.java | 65 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 51 + .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/model/MapTest.java | 65 +- .../openapitools/model/OuterComposite.java | 2 +- .../openapitools/model/StringBooleanMap.java | 51 + 186 files changed, 6263 insertions(+), 807 deletions(-) create mode 100644 samples/client/petstore/go/go-petstore/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/go/go-petstore/model_string_boolean_map.go create mode 100644 samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/google-api-client/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/jersey1/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/jersey2-java6/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/jersey2-java8/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/jersey2/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/okhttp-gson/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/rest-assured/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/resteasy/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/resttemplate/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/retrofit2-play24/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/retrofit2-play25/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/retrofit2/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/retrofit2rx/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/retrofit2rx2/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/java/vertx/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/StringBooleanMap.java create mode 100644 samples/client/petstore/php/OpenAPIClient-php/docs/Model/StringBooleanMap.md create mode 100644 samples/client/petstore/php/OpenAPIClient-php/lib/Model/StringBooleanMap.php create mode 100644 samples/client/petstore/php/OpenAPIClient-php/test/Model/StringBooleanMapTest.php create mode 100644 samples/client/petstore/ruby/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/ruby/lib/petstore/models/string_boolean_map.rb create mode 100644 samples/client/petstore/ruby/spec/models/string_boolean_map_spec.rb create mode 100644 samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/StringBooleanMap.php create mode 100644 samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/StringBooleanMap.java create mode 100644 samples/server/petstore/springboot/src/main/java/org/openapitools/model/StringBooleanMap.java 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 7c37731bc63..fe0400f11ba 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 @@ -1167,7 +1167,7 @@ public class DefaultCodegen implements CodegenConfig { // TODO better logic to handle compose schema if (schema instanceof ComposedSchema) { // composed schema ComposedSchema cs = (ComposedSchema) schema; - if(cs.getAllOf() != null) { + if (cs.getAllOf() != null) { for (Schema s : cs.getAllOf()) { if (s != null) { // using the first schema defined in allOf @@ -1383,6 +1383,9 @@ public class DefaultCodegen implements CodegenConfig { typeAliases = getAllAliases(allDefinitions); } + // unalias schema + schema = ModelUtils.unaliasSchema(allDefinitions, schema); + CodegenModel m = CodegenModelFactory.newInstance(CodegenModelType.MODEL); if (reservedWords.contains(name)) { @@ -1508,9 +1511,8 @@ public class DefaultCodegen implements CodegenConfig { addProperties(allProperties, allRequired, child, allDefinitions); } } - addVars(m, properties, required, allProperties, allRequired); - // TODO - //} else if (schema instanceof RefModel) { + addVars(m, unaliasPropertySchema(allDefinitions, properties), required, allProperties, allRequired); + } else { m.dataType = getSchemaType(schema); if (schema.getEnum() != null && !schema.getEnum().isEmpty()) { @@ -1522,7 +1524,7 @@ public class DefaultCodegen implements CodegenConfig { if (ModelUtils.isMapSchema(schema)) { addAdditionPropertiesToCodeGenModel(m, schema); } - addVars(m, schema.getProperties(), schema.getRequired()); + addVars(m, unaliasPropertySchema(allDefinitions, schema.getProperties()), schema.getRequired()); } if (m.vars != null) { @@ -1591,7 +1593,6 @@ public class DefaultCodegen implements CodegenConfig { return null; } LOGGER.debug("debugging fromProperty for " + name + " : " + p); - CodegenProperty property = CodegenModelFactory.newInstance(CodegenModelType.PROPERTY); property.name = toVarName(name); property.baseName = name; @@ -1832,7 +1833,6 @@ public class DefaultCodegen implements CodegenConfig { // property.baseType = getSimpleRef(p.get$ref()); //} // --END of revision - setNonArrayMapProperty(property, type); } @@ -3047,6 +3047,24 @@ public class DefaultCodegen implements CodegenConfig { } } + /** + * Loop through propertiies and unalias the reference if $ref (reference) is defined + * + * @param allSchemas all schemas defined in the spec + * @param properties model properties (schemas) + * @return model properties with direct reference to schemas + */ + private Map unaliasPropertySchema(Map allSchemas, Map properties) { + if (properties != null) { + for (String key : properties.keySet()) { + properties.put(key, ModelUtils.unaliasSchema(allSchemas, properties.get(key))); + + } + } + + return properties; + } + private void addVars(CodegenModel model, Map properties, List required) { addVars(model, properties, required, null, null); } @@ -3160,9 +3178,11 @@ public class DefaultCodegen implements CodegenConfig { String oasName = entry.getKey(); Schema schema = entry.getValue(); String schemaType = getPrimitiveType(schema); - if (schemaType != null && !schemaType.equals("object") && !schemaType.equals("array") && schema.getEnum() == null) { + if (schemaType != null && !schemaType.equals("object") && !schemaType.equals("array") + && schema.getEnum() == null && !ModelUtils.isMapSchema(schema)) { aliases.put(oasName, schemaType); } + } return aliases; @@ -3896,14 +3916,14 @@ public class DefaultCodegen implements CodegenConfig { } Set existingMediaTypes = new HashSet<>(); - for (Map mediaType: codegenOperation.produces) { + for (Map mediaType : codegenOperation.produces) { existingMediaTypes.add(mediaType.get("mediaType")); } int count = 0; for (String key : produces) { // escape quotation to avoid code injection, "*/*" is a special case, do nothing - String encodedKey = "*/*".equals(key)? key : escapeText(escapeQuotationMark(key)); + String encodedKey = "*/*".equals(key) ? key : escapeText(escapeQuotationMark(key)); //Only unique media types should be added to "produces" if (!existingMediaTypes.contains(encodedKey)) { Map mediaType = new HashMap(); @@ -3925,7 +3945,7 @@ public class DefaultCodegen implements CodegenConfig { /** * returns the list of MIME types the APIs can produce * - * @param openAPI current specification instance + * @param openAPI current specification instance * @param operation Operation * @return a set of MIME types */ @@ -4024,10 +4044,9 @@ public class DefaultCodegen implements CodegenConfig { codegenParameter.isListContainer = true; codegenParameter.description = s.getDescription(); codegenParameter.dataType = getTypeDeclaration(s); - if (codegenParameter.baseType != null && codegenParameter.enumName != null){ + if (codegenParameter.baseType != null && codegenParameter.enumName != null) { codegenParameter.datatypeWithEnum = codegenParameter.dataType.replace(codegenParameter.baseType, codegenParameter.enumName); - } - else { + } else { LOGGER.warn("Could not compute datatypeWithEnum from " + codegenParameter.baseType + ", " + codegenParameter.enumName); } //TODO fix collectformat for form parameters @@ -4338,7 +4357,7 @@ public class DefaultCodegen implements CodegenConfig { public void generateYAMLSpecFile(Map objs) { OpenAPI openAPI = (OpenAPI) objs.get("openAPI"); String yaml = SerializerUtils.toYamlString(openAPI); - if(yaml != null) { + if (yaml != null) { objs.put("openapi-yaml", yaml); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index 78c4a20407d..4b201181705 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -90,15 +90,16 @@ public class ModelUtils { /** * Return the list of all schemas in the 'components/schemas' section used in the openAPI specification + * * @param openAPI specification * @return schemas a list of used schemas */ public static List getAllUsedSchemas(OpenAPI openAPI) { List allUsedSchemas = new ArrayList(); visitOpenAPI(openAPI, (s, t) -> { - if(s.get$ref() != null) { + if (s.get$ref() != null) { String ref = getSimpleRef(s.get$ref()); - if(!allUsedSchemas.contains(ref)) { + if (!allUsedSchemas.contains(ref)) { allUsedSchemas.add(ref); } } @@ -108,6 +109,7 @@ public class ModelUtils { /** * Return the list of unused schemas in the 'components/schemas' section of an openAPI specification + * * @param openAPI specification * @return schemas a list of unused schemas */ @@ -118,7 +120,7 @@ public class ModelUtils { unusedSchemas.addAll(schemas.keySet()); visitOpenAPI(openAPI, (s, t) -> { - if(s.get$ref() != null) { + if (s.get$ref() != null) { unusedSchemas.remove(getSimpleRef(s.get$ref())); } }); @@ -127,6 +129,7 @@ public class ModelUtils { /** * Return the list of schemas in the 'components/schemas' used only in a 'application/x-www-form-urlencoded' or 'multipart/form-data' mime time + * * @param openAPI specification * @return schemas a list of schemas */ @@ -135,7 +138,7 @@ public class ModelUtils { List schemasUsedInOtherCases = new ArrayList(); visitOpenAPI(openAPI, (s, t) -> { - if(s.get$ref() != null) { + if (s.get$ref() != null) { String ref = getSimpleRef(s.get$ref()); if ("application/x-www-form-urlencoded".equalsIgnoreCase(t) || "multipart/form-data".equalsIgnoreCase(t)) { @@ -167,7 +170,7 @@ public class ModelUtils { if (allOperations != null) { for (Operation operation : allOperations) { //Params: - if(operation.getParameters() != null) { + if (operation.getParameters() != null) { for (Parameter p : operation.getParameters()) { Parameter parameter = getReferencedParameter(openAPI, p); if (parameter.getSchema() != null) { @@ -187,7 +190,7 @@ public class ModelUtils { } //Responses: - if(operation.getResponses() != null) { + if (operation.getResponses() != null) { for (ApiResponse r : operation.getResponses().values()) { ApiResponse apiResponse = getReferencedApiResponse(openAPI, r); if (apiResponse != null && apiResponse.getContent() != null) { @@ -207,51 +210,51 @@ public class ModelUtils { private static void visitSchema(OpenAPI openAPI, Schema schema, String mimeType, List visitedSchemas, OpenAPISchemaVisitor visitor) { visitor.visit(schema, mimeType); - if(schema.get$ref() != null) { + if (schema.get$ref() != null) { String ref = getSimpleRef(schema.get$ref()); - if(!visitedSchemas.contains(ref)) { + if (!visitedSchemas.contains(ref)) { visitedSchemas.add(ref); Schema referencedSchema = getSchemas(openAPI).get(ref); - if(referencedSchema != null) { + if (referencedSchema != null) { visitSchema(openAPI, referencedSchema, mimeType, visitedSchemas, visitor); } } } - if(schema instanceof ComposedSchema) { + if (schema instanceof ComposedSchema) { List oneOf = ((ComposedSchema) schema).getOneOf(); - if(oneOf != null) { + if (oneOf != null) { for (Schema s : oneOf) { visitSchema(openAPI, s, mimeType, visitedSchemas, visitor); } } List allOf = ((ComposedSchema) schema).getAllOf(); - if(allOf != null) { + if (allOf != null) { for (Schema s : allOf) { visitSchema(openAPI, s, mimeType, visitedSchemas, visitor); } } List anyOf = ((ComposedSchema) schema).getAnyOf(); - if(anyOf != null) { + if (anyOf != null) { for (Schema s : anyOf) { visitSchema(openAPI, s, mimeType, visitedSchemas, visitor); } } - } else if(schema instanceof ArraySchema) { + } else if (schema instanceof ArraySchema) { Schema itemsSchema = ((ArraySchema) schema).getItems(); - if(itemsSchema != null) { + if (itemsSchema != null) { visitSchema(openAPI, itemsSchema, mimeType, visitedSchemas, visitor); } - } else if(isMapSchema(schema)) { + } else if (isMapSchema(schema)) { Object additionalProperties = schema.getAdditionalProperties(); - if(additionalProperties instanceof Schema) { + if (additionalProperties instanceof Schema) { visitSchema(openAPI, (Schema) additionalProperties, mimeType, visitedSchemas, visitor); } } - if(schema.getNot() != null) { + if (schema.getNot() != null) { visitSchema(openAPI, schema.getNot(), mimeType, visitedSchemas, visitor); } Map properties = schema.getProperties(); - if(properties != null) { + if (properties != null) { for (Schema property : properties.values()) { visitSchema(openAPI, property, mimeType, visitedSchemas, visitor); } @@ -269,7 +272,7 @@ public class ModelUtils { ref = ref.substring(ref.lastIndexOf("/") + 1); } else if (ref.startsWith("#/definitions/")) { ref = ref.substring(ref.lastIndexOf("/") + 1); - } else { + } else { LOGGER.warn("Failed to get the schema name: {}", ref); return null; } @@ -478,15 +481,16 @@ public class ModelUtils { /** * If a Schema contains a reference to an other Schema with '$ref', returns the referenced Schema if it is found or the actual Schema in the other cases. + * * @param openAPI specification being checked - * @param schema potentially containing a '$ref' + * @param schema potentially containing a '$ref' * @return schema without '$ref' */ public static Schema getReferencedSchema(OpenAPI openAPI, Schema schema) { if (schema != null && StringUtils.isNotEmpty(schema.get$ref())) { String name = getSimpleRef(schema.get$ref()); Schema referencedSchema = getSchema(openAPI, name); - if(referencedSchema != null) { + if (referencedSchema != null) { return referencedSchema; } } @@ -510,7 +514,8 @@ public class ModelUtils { /** * If a RequestBody contains a reference to an other RequestBody with '$ref', returns the referenced RequestBody if it is found or the actual RequestBody in the other cases. - * @param openAPI specification being checked + * + * @param openAPI specification being checked * @param requestBody potentially containing a '$ref' * @return requestBody without '$ref' */ @@ -518,7 +523,7 @@ public class ModelUtils { if (requestBody != null && StringUtils.isNotEmpty(requestBody.get$ref())) { String name = getSimpleRef(requestBody.get$ref()); RequestBody referencedRequestBody = getRequestBody(openAPI, name); - if(referencedRequestBody != null) { + if (referencedRequestBody != null) { return referencedRequestBody; } } @@ -538,7 +543,8 @@ public class ModelUtils { /** * If a ApiResponse contains a reference to an other ApiResponse with '$ref', returns the referenced ApiResponse if it is found or the actual ApiResponse in the other cases. - * @param openAPI specification being checked + * + * @param openAPI specification being checked * @param apiResponse potentially containing a '$ref' * @return apiResponse without '$ref' */ @@ -546,7 +552,7 @@ public class ModelUtils { if (apiResponse != null && StringUtils.isNotEmpty(apiResponse.get$ref())) { String name = getSimpleRef(apiResponse.get$ref()); ApiResponse referencedApiResponse = getApiResponse(openAPI, name); - if(referencedApiResponse != null) { + if (referencedApiResponse != null) { return referencedApiResponse; } } @@ -566,7 +572,8 @@ public class ModelUtils { /** * If a Parameter contains a reference to an other Parameter with '$ref', returns the referenced Parameter if it is found or the actual Parameter in the other cases. - * @param openAPI specification being checked + * + * @param openAPI specification being checked * @param parameter potentially containing a '$ref' * @return parameter without '$ref' */ @@ -574,7 +581,7 @@ public class ModelUtils { if (parameter != null && StringUtils.isNotEmpty(parameter.get$ref())) { String name = getSimpleRef(parameter.get$ref()); Parameter referencedParameter = getParameter(openAPI, name); - if(referencedParameter != null) { + if (referencedParameter != null) { return referencedParameter; } } @@ -594,6 +601,7 @@ public class ModelUtils { /** * Return the first defined Schema for a RequestBody + * * @param requestBody request body of the operation * @return firstSchema */ @@ -603,6 +611,7 @@ public class ModelUtils { /** * Return the first defined Schema for a ApiResponse + * * @param response api response of the operation * @return firstSchema */ @@ -614,10 +623,38 @@ public class ModelUtils { if (content == null || content.isEmpty()) { return null; } - if(content.size() > 1) { + if (content.size() > 1) { LOGGER.warn("Multiple schemas found, returning only the first one"); } MediaType mediaType = content.values().iterator().next(); return mediaType.getSchema(); } + + /** + * Get the actual schema from aliases. If the provided schema is not an alias, the schema itself will be returned. + * + * @param allSchemas all schemas + * @param schema schema (alias or direct reference) + * @return actual schema + */ + public static Schema unaliasSchema(Map allSchemas, Schema schema) { + if (schema != null && StringUtils.isNotEmpty(schema.get$ref())) { + Schema ref = allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref())); + if (ref == null) { + LOGGER.warn("{} is not defined", schema.get$ref()); + return schema; + } else if (isObjectSchema(ref)) { // model + return schema; + } else if (isStringSchema(ref) && (ref.getEnum() != null && !ref.getEnum().isEmpty())) { + // top-level enum class + return schema; + } else if (isMapSchema(ref) || isArraySchema(ref)) { // map/array def should be created as models + return schema; + } else { + return unaliasSchema(allSchemas, allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); + } + } + return schema; + } + } diff --git a/modules/openapi-generator/src/test/resources/2_0/pathWithHtmlEntity.yaml b/modules/openapi-generator/src/test/resources/2_0/pathWithHtmlEntity.yaml index cf5fe1d5100..c9d0a9072a9 100644 --- a/modules/openapi-generator/src/test/resources/2_0/pathWithHtmlEntity.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/pathWithHtmlEntity.yaml @@ -16,3 +16,61 @@ paths: default: description: "Internal server error" summary: Test +definitions: + MapTest: + type: object + properties: + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: "#/definitions/StringBooleanMap" + ref_test: + $ref: "#/definitions/StringRef" + direct_test: + type: string + StringBooleanMap: + additionalProperties: + type: boolean + StringRef: + type: string + Pet: + title: a Pet + description: A pet for sale in the pet store + type: object + properties: + id: + type: integer + format: int64 + category: + $ref: '#/definitions/Category' + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/definitions/Tag' + Tag: + title: Pet Tag + description: A tag for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + Category: + title: Pet category + description: A category for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Category \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index cea31406fd0..c276aaa3fdc 100644 --- a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1355,6 +1355,12 @@ definitions: enum: - UPPER - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: "#/definitions/StringBooleanMap" ArrayTest: type: object properties: @@ -1452,3 +1458,6 @@ definitions: OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean diff --git a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION index 096bf47efe3..82602aa4190 100644 --- a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index dfb07bd7fdf..b23f5f4e161 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -97,6 +97,7 @@ Class | Method | HTTP request | Description - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Return](docs/Return.md) - [SpecialModelName](docs/SpecialModelName.md) + - [StringBooleanMap](docs/StringBooleanMap.md) - [Tag](docs/Tag.md) - [User](docs/User.md) diff --git a/samples/client/petstore/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index 443788211b9..9d5d91e96dd 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -1,31 +1,27 @@ openapi: 3.0.1 info: - title: OpenAPI Petstore description: 'This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: " \' license: name: Apache-2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore version: 1.0.0 servers: - url: http://petstore.swagger.io:80/v2 tags: -- name: pet - description: Everything about your Pets -- name: store - description: Access to Petstore orders -- name: user - description: Operations about user +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user paths: /pet: - put: - tags: - - pet - summary: Update an existing pet - operationId: updatePet + post: + operationId: addPet requestBody: - description: Pet object that needs to be added to the store content: application/json: schema: @@ -33,144 +29,171 @@ paths: application/xml: schema: $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + 405: + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + operationId: updatePet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store required: true responses: 400: + content: {} description: Invalid ID supplied - content: {} 404: + content: {} description: Pet not found - content: {} 405: - description: Validation exception content: {} + description: Validation exception security: - petstore_auth: - write:pets - read:pets - post: + summary: Update an existing pet tags: - pet - summary: Add a new pet to the store - operationId: addPet - 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 - responses: - 405: - description: Invalid input - content: {} - security: - - petstore_auth: - - write:pets - - read:pets /pet/findByStatus: get: - tags: - - pet - summary: Finds Pets by status description: Multiple status values can be provided with comma separated strings operationId: findPetsByStatus parameters: - - name: status - in: query - description: Status values that need to be considered for filter - required: true + - description: Status values that need to be considered for filter explode: false + in: query + name: status + required: true schema: - type: array items: - type: string default: available enum: - available - pending - sold + type: string + type: array + style: form responses: 200: - description: successful operation content: application/xml: schema: - type: array items: $ref: '#/components/schemas/Pet' + type: array application/json: schema: - type: array items: $ref: '#/components/schemas/Pet' + type: array + description: successful operation 400: - description: Invalid status value content: {} + description: Invalid status value security: - petstore_auth: - write:pets - read:pets - /pet/findByTags: - get: + summary: Finds Pets by status tags: - pet - summary: Finds Pets by tags + /pet/findByTags: + get: + deprecated: true description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - - name: tags - in: query - description: Tags to filter by - required: true + - description: Tags to filter by explode: false + in: query + name: tags + required: true schema: - type: array items: type: string + type: array + style: form responses: 200: - description: successful operation content: application/xml: schema: - type: array items: $ref: '#/components/schemas/Pet' + type: array application/json: schema: - type: array items: $ref: '#/components/schemas/Pet' + type: array + description: successful operation 400: - description: Invalid tag value content: {} - deprecated: true + description: Invalid tag value security: - petstore_auth: - write:pets - read:pets - /pet/{petId}: - get: + summary: Finds Pets by tags tags: - pet - summary: Find pet by ID + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + 400: + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + get: description: Returns a single pet operationId: getPetById parameters: - - name: petId + - description: ID of pet to return in: path - description: ID of pet to return + name: petId required: true schema: - type: integer format: int64 + type: integer responses: 200: - description: successful operation content: application/xml: schema: @@ -178,143 +201,118 @@ paths: application/json: schema: $ref: '#/components/schemas/Pet' + description: successful operation 400: + content: {} description: Invalid ID supplied - content: {} 404: - description: Pet not found content: {} + description: Pet not found security: - api_key: [] - post: + summary: Find pet by ID tags: - pet - summary: Updates a pet in the store with form data + post: operationId: updatePetWithForm parameters: - - name: petId + - description: ID of pet that needs to be updated in: path - description: ID of pet that needs to be updated + name: petId required: true schema: - type: integer format: int64 + type: integer requestBody: content: application/x-www-form-urlencoded: schema: properties: name: - type: string description: Updated name of the pet - status: type: string + status: description: Updated status of the pet + type: string responses: 405: - description: Invalid input content: {} + description: Invalid input security: - petstore_auth: - write:pets - read:pets - delete: + summary: Updates a pet in the store with form data tags: - pet - summary: Deletes a pet - operationId: deletePet - parameters: - - name: api_key - in: header - schema: - type: string - - name: petId - in: path - description: Pet id to delete - required: true - schema: - type: integer - format: int64 - responses: - 400: - description: Invalid pet value - content: {} - security: - - petstore_auth: - - write:pets - - read:pets /pet/{petId}/uploadImage: post: - tags: - - pet - summary: uploads an image operationId: uploadFile parameters: - - name: petId + - description: ID of pet to update in: path - description: ID of pet to update + name: petId required: true schema: - type: integer format: int64 + type: integer requestBody: content: multipart/form-data: schema: properties: additionalMetadata: - type: string description: Additional data to pass to server - file: type: string + file: description: file to upload format: binary + type: string responses: 200: - description: successful operation content: application/json: schema: $ref: '#/components/schemas/ApiResponse' + description: successful operation security: - petstore_auth: - write:pets - read:pets + summary: uploads an image + tags: + - pet /store/inventory: get: - tags: - - store - summary: Returns pet inventories by status description: Returns a map of status codes to quantities operationId: getInventory responses: 200: - description: successful operation content: application/json: schema: - type: object additionalProperties: - type: integer format: int32 + type: integer + type: object + description: successful operation security: - api_key: [] - /store/order: - post: + summary: Returns pet inventories by status tags: - store - summary: Place an order for a pet + /store/order: + post: operationId: placeOrder requestBody: - description: order placed for purchasing the pet content: '*/*': schema: $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet required: true responses: 200: - description: successful operation content: application/xml: schema: @@ -322,187 +320,207 @@ paths: application/json: schema: $ref: '#/components/schemas/Order' + description: successful operation 400: + content: {} description: Invalid Order - content: {} + summary: Place an order for a pet + tags: + - store /store/order/{order_id}: - get: - tags: - - store - summary: Find purchase order by ID - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - operationId: getOrderById - parameters: - - name: order_id - in: path - description: ID of pet that needs to be fetched - required: true - schema: - maximum: 5 - minimum: 1 - type: integer - format: int64 - responses: - 200: - description: successful operation - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - 400: - description: Invalid ID supplied - content: {} - 404: - description: Order not found - content: {} delete: - tags: - - store - summary: Delete purchase order by ID description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - - name: order_id + - description: ID of the order that needs to be deleted in: path - description: ID of the order that needs to be deleted + name: order_id required: true schema: type: string responses: 400: + content: {} description: Invalid ID supplied - content: {} 404: - description: Order not found content: {} + description: Order not found + summary: Delete purchase order by ID + tags: + - store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + 200: + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + 400: + content: {} + description: Invalid ID supplied + 404: + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store /user: post: - tags: - - user - summary: Create user description: This can only be done by the logged in user. operationId: createUser requestBody: - description: Created user object content: '*/*': schema: $ref: '#/components/schemas/User' + description: Created user object required: true responses: default: - description: successful operation content: {} + description: successful operation + summary: Create user + tags: + - user /user/createWithArray: post: - tags: - - user - summary: Creates list of users with given input array operationId: createUsersWithArrayInput requestBody: - description: List of user object content: '*/*': schema: - type: array items: $ref: '#/components/schemas/User' + type: array + description: List of user object required: true responses: default: - description: successful operation content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user /user/createWithList: post: - tags: - - user - summary: Creates list of users with given input array operationId: createUsersWithListInput requestBody: - description: List of user object content: '*/*': schema: - type: array items: $ref: '#/components/schemas/User' + type: array + description: List of user object required: true responses: default: - description: successful operation content: {} - /user/login: - get: + description: successful operation + summary: Creates list of users with given input array tags: - user - summary: Logs user into the system + /user/login: + get: operationId: loginUser parameters: - - name: username + - description: The user name for login in: query - description: The user name for login + name: username required: true schema: type: string - - name: password + - description: The password for login in clear text in: query - description: The password for login in clear text + name: password required: true schema: type: string responses: 200: + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string description: successful operation headers: X-Rate-Limit: description: calls per hour allowed by the user schema: - type: integer format: int32 + type: integer X-Expires-After: description: date in UTC when token expires schema: - type: string format: date-time - content: - application/xml: - schema: - type: string - application/json: - schema: type: string 400: - description: Invalid username/password supplied content: {} - /user/logout: - get: + description: Invalid username/password supplied + summary: Logs user into the system tags: - user - summary: Logs out current logged in user session + /user/logout: + get: operationId: logoutUser responses: default: - description: successful operation content: {} - /user/{username}: - get: + description: successful operation + summary: Logs out current logged in user session tags: - user - summary: Get user by user name + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + in: path + name: username + required: true + schema: + type: string + responses: + 400: + content: {} + description: Invalid username supplied + 404: + content: {} + description: User not found + summary: Delete user + tags: + - user + get: operationId: getUserByName parameters: - - name: username + - description: The name that needs to be fetched. Use user1 for testing. in: path - description: The name that needs to be fetched. Use user1 for testing. + name: username required: true schema: type: string responses: 200: - description: successful operation content: application/xml: schema: @@ -510,188 +528,188 @@ paths: application/json: schema: $ref: '#/components/schemas/User' + description: successful operation 400: + content: {} description: Invalid username supplied - content: {} 404: - description: User not found content: {} - put: + description: User not found + summary: Get user by user name tags: - user - summary: Updated user + put: description: This can only be done by the logged in user. operationId: updateUser parameters: - - name: username + - description: name that need to be deleted in: path - description: name that need to be deleted + name: username required: true schema: type: string requestBody: - description: Updated user object content: '*/*': schema: $ref: '#/components/schemas/User' + description: Updated user object required: true responses: 400: + content: {} description: Invalid user supplied - content: {} 404: - description: User not found content: {} - delete: + description: User not found + summary: Updated user tags: - user - summary: Delete user - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - name: username - in: path - description: The name that needs to be deleted - required: true - schema: - type: string - responses: - 400: - description: Invalid username supplied - content: {} - 404: - description: User not found - content: {} /fake_classname_test: patch: - tags: - - fake_classname_tags 123#$%^ - summary: To test class name in snake case description: To test class name in snake case operationId: testClassname requestBody: - description: client model content: application/json: schema: $ref: '#/components/schemas/Client' + description: client model required: true responses: 200: - description: successful operation content: application/json: schema: $ref: '#/components/schemas/Client' + description: successful operation security: - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ /fake: get: - tags: - - fake - summary: To test enum parameters description: To test enum parameters operationId: testEnumParameters parameters: - - name: enum_header_string_array - in: header - description: Header parameter enum test (string array) - schema: - type: array - items: - type: string - default: $ - enum: - - '>' - - $ - - name: enum_header_string - in: header - description: Header parameter enum test (string) - schema: - type: string - default: -efg - enum: - - _abc - - -efg - - (xyz) - - name: enum_query_string_array - in: query - description: Query parameter enum test (string array) + - description: Header parameter enum test (string array) explode: false + in: header + name: enum_header_string_array schema: - type: array items: - type: string default: $ enum: - '>' - $ - - name: enum_query_string - in: query - description: Query parameter enum test (string) + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string schema: - type: string default: -efg enum: - _abc - -efg - (xyz) - - name: enum_query_integer + type: string + - description: Query parameter enum test (string array) + explode: false in: query - description: Query parameter enum test (double) + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer schema: - type: integer - format: int32 enum: - 1 - -2 - - name: enum_query_double + format: int32 + type: integer + - description: Query parameter enum test (double) in: query - description: Query parameter enum test (double) + name: enum_query_double schema: - type: number - format: double enum: - 1.1 - -1.2 + format: double + type: number requestBody: content: application/x-www-form-urlencoded: schema: properties: enum_form_string_array: - type: array description: Form parameter enum test (string array) items: - type: string default: $ enum: - '>' - $ + type: string + type: array enum_form_string: - type: string - description: Form parameter enum test (string) default: -efg + description: Form parameter enum test (string) enum: - _abc - -efg - (xyz) + type: string responses: 400: + content: {} description: Invalid request - content: {} 404: - description: Not found content: {} - post: + description: Not found + summary: To test enum parameters tags: - fake - summary: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + post: description: | Fake endpoint for testing various parameters 假端點 @@ -702,238 +720,223 @@ paths: content: application/x-www-form-urlencoded: schema: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string required: - byte - double - number - pattern_without_delimiter - properties: - integer: - maximum: 100 - minimum: 10 - type: integer - description: None - int32: - maximum: 200 - minimum: 20 - type: integer - description: None - format: int32 - int64: - type: integer - description: None - format: int64 - number: - maximum: 543.2 - minimum: 32.1 - type: number - description: None - float: - maximum: 987.6 - type: number - description: None - format: float - double: - maximum: 123.4 - minimum: 67.8 - type: number - description: None - format: double - string: - pattern: /[a-z]/i - type: string - description: None - pattern_without_delimiter: - pattern: ^[A-Z].* - type: string - description: None - byte: - type: string - description: None - format: byte - binary: - type: string - description: None - format: binary - date: - type: string - description: None - format: date - dateTime: - type: string - description: None - format: date-time - password: - maxLength: 64 - minLength: 10 - type: string - description: None - format: password - callback: - type: string - description: None required: true responses: 400: + content: {} description: Invalid username supplied - content: {} 404: - description: User not found content: {} + description: User not found security: - http_basic_test: [] - patch: + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 tags: - fake - summary: To test "client" model - description: To test "client" model - operationId: testClientModel - requestBody: - description: client model - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - required: true - responses: - 200: - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Client' /fake/outer/number: post: - tags: - - fake description: Test serialization of outer number types operationId: fakeOuterNumberSerialize requestBody: - description: Input number as post body content: '*/*': schema: $ref: '#/components/schemas/OuterNumber' + description: Input number as post body required: false responses: 200: - description: Output number content: '*/*': schema: $ref: '#/components/schemas/OuterNumber' - /fake/outer/string: - post: + description: Output number tags: - fake + /fake/outer/string: + post: description: Test serialization of outer string types operationId: fakeOuterStringSerialize requestBody: - description: Input string as post body content: '*/*': schema: $ref: '#/components/schemas/OuterString' + description: Input string as post body required: false responses: 200: - description: Output string content: '*/*': schema: $ref: '#/components/schemas/OuterString' - /fake/outer/boolean: - post: + description: Output string tags: - fake + /fake/outer/boolean: + post: description: Test serialization of outer boolean types operationId: fakeOuterBooleanSerialize requestBody: - description: Input boolean as post body content: '*/*': schema: $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body required: false responses: 200: - description: Output boolean content: '*/*': schema: $ref: '#/components/schemas/OuterBoolean' - /fake/outer/composite: - post: + description: Output boolean tags: - fake + /fake/outer/composite: + post: description: Test serialization of object with outer number type operationId: fakeOuterCompositeSerialize requestBody: - description: Input composite as post body content: '*/*': schema: $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body required: false responses: 200: - description: Output composite content: '*/*': schema: $ref: '#/components/schemas/OuterComposite' - /fake/jsonFormData: - get: + description: Output composite tags: - fake - summary: test json serialization of form data + /fake/jsonFormData: + get: operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string required: - param - param2 - properties: - param: - type: string - description: field1 - param2: - type: string - description: field2 required: true responses: 200: - description: successful operation content: {} - /fake/inline-additionalProperties: - post: + description: successful operation + summary: test json serialization of form data tags: - fake - summary: test inline additionalProperties + /fake/inline-additionalProperties: + post: operationId: testInlineAdditionalProperties requestBody: - description: request body content: application/json: schema: - type: object additionalProperties: type: string + type: object + description: request body required: true responses: 200: - description: successful operation content: {} - /fake/body-with-query-params: - put: + description: successful operation + summary: test inline additionalProperties tags: - fake + /fake/body-with-query-params: + put: operationId: testBodyWithQueryParams parameters: - - name: query - in: query + - in: query + name: query required: true schema: type: string @@ -945,50 +948,60 @@ paths: required: true responses: 200: - description: Success content: {} + description: Success + tags: + - fake /another-fake/dummy: patch: - tags: - - $another-fake? - summary: To test special tags description: To test special tags operationId: test_special_tags requestBody: - description: client model content: application/json: schema: $ref: '#/components/schemas/Client' + description: client model required: true responses: 200: - description: successful operation content: application/json: schema: $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? components: schemas: Category: - type: object - properties: - id: - type: integer - format: int64 - name: - type: string example: name: name id: 6 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object xml: name: Category User: - type: object + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username properties: id: - type: integer format: int64 + type: integer x-is-unique: true username: type: string @@ -1003,31 +1016,22 @@ components: phone: type: string userStatus: - type: integer description: User Status format: int32 - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username + type: integer + type: object xml: name: User OuterNumber: type: number ArrayOfNumberOnly: - type: object properties: ArrayNumber: - type: array items: type: number - Capitalization: + type: array type: object + Capitalization: properties: smallCamel: type: string @@ -1040,154 +1044,131 @@ components: SCA_ETH_Flow_Points: type: string ATT_NAME: - type: string description: | Name of the pet - MixedPropertiesAndAdditionalPropertiesClass: + type: string type: object + MixedPropertiesAndAdditionalPropertiesClass: properties: uuid: - type: string format: uuid - dateTime: type: string + dateTime: format: date-time + type: string map: - type: object additionalProperties: $ref: '#/components/schemas/Animal' - ApiResponse: + type: object type: object - properties: - code: - type: integer - format: int32 - type: - type: string - message: - type: string + ApiResponse: example: code: 0 type: type message: message - Name: - required: - - name + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string type: object + Name: + description: Model for testing model name same as property name properties: name: - type: integer format: int32 - snake_case: type: integer + snake_case: format: int32 readOnly: true + type: integer property: type: string 123Number: - type: integer readOnly: true - description: Model for testing model name same as property name + type: integer + required: + - name + type: object xml: name: Name EnumClass: - type: string default: -efg enum: - _abc - -efg - (xyz) + type: string List: - type: object properties: 123-list: type: string - NumberOnly: type: object + NumberOnly: properties: JustNumber: type: number - 200_response: type: object + 200_response: + description: Model for testing model name starting with number properties: name: - type: integer format: int32 + type: integer class: type: string - description: Model for testing model name starting with number + type: object xml: name: Name Client: - type: object + example: + client: client properties: client: type: string - example: - client: client + type: object Dog: allOf: - $ref: '#/components/schemas/Animal' - - type: object - properties: + - properties: breed: type: string + type: object Enum_Test: - required: - - enum_string_required - type: object properties: enum_string: - type: string enum: - UPPER - lower - "" + type: string enum_string_required: - type: string enum: - UPPER - lower - "" + type: string enum_integer: - type: integer - format: int32 enum: - 1 - -1 + format: int32 + type: integer enum_number: - type: number - format: double enum: - 1.1 - -1.2 + format: double + type: number outerEnum: $ref: '#/components/schemas/OuterEnum' - Order: + required: + - enum_string_required type: object - properties: - id: - type: integer - format: int64 - petId: - type: integer - format: int64 - quantity: - type: integer - format: int32 - shipDate: - type: string - format: date-time - status: - type: string - description: Order Status - enum: - - placed - - approved - - delivered - complete: - type: boolean - default: false + Order: example: petId: 6 quantity: 1 @@ -1195,263 +1176,266 @@ components: shipDate: 2000-01-23T04:56:07.000+00:00 complete: false status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object xml: name: Order AdditionalPropertiesClass: - type: object properties: map_property: - type: object additionalProperties: type: string - map_of_map_property: type: object + map_of_map_property: additionalProperties: - type: object additionalProperties: type: string - $special[model.name]: + type: object + type: object type: object + $special[model.name]: properties: $special[property.name]: - type: integer format: int64 + type: integer + type: object xml: name: $special[model.name] Return: - type: object + description: Model for testing reserved words properties: return: - type: integer format: int32 - description: Model for testing reserved words + type: integer + type: object xml: name: Return ReadOnlyFirst: - type: object properties: bar: - type: string readOnly: true + type: string baz: type: string - ArrayOfArrayOfNumberOnly: type: object + ArrayOfArrayOfNumberOnly: properties: ArrayArrayNumber: - type: array items: - type: array items: type: number + type: array + type: array + type: object OuterEnum: - type: string enum: - placed - approved - delivered + type: string ArrayTest: - type: object properties: array_of_string: - type: array items: type: string + type: array array_array_of_integer: - type: array items: - type: array items: - type: integer format: int64 - array_array_of_model: - type: array - items: + type: integer type: array + type: array + array_array_of_model: + items: items: $ref: '#/components/schemas/ReadOnlyFirst' - OuterComposite: + type: array + type: array type: object + OuterComposite: + example: + my_string: my_string + my_number: 0.80082819046101150206595775671303272247314453125 + my_boolean: true properties: my_number: - $ref: '#/components/schemas/OuterNumber' + type: number my_string: - $ref: '#/components/schemas/OuterString' + type: string my_boolean: - $ref: '#/components/schemas/OuterBoolean' - example: {} - format_test: - required: - - byte - - date - - number - - password + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object + format_test: properties: integer: maximum: 1E+2 minimum: 1E+1 type: integer int32: + format: int32 maximum: 2E+2 minimum: 2E+1 type: integer - format: int32 int64: - type: integer format: int64 + type: integer number: maximum: 543.2 minimum: 32.1 type: number float: + format: float maximum: 987.6 minimum: 54.3 type: number - format: float double: + format: double maximum: 123.4 minimum: 67.8 type: number - format: double string: pattern: /[a-z]/i type: string byte: + format: byte pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ type: string - format: byte binary: - type: string format: binary + type: string date: - type: string format: date + type: string dateTime: - type: string format: date-time - uuid: type: string + uuid: format: uuid + type: string password: + format: password maxLength: 64 minLength: 10 type: string - format: password - EnumArrays: + required: + - byte + - date + - number + - password type: object + EnumArrays: properties: just_symbol: - type: string enum: - '>=' - $ + type: string array_enum: - type: array items: - type: string enum: - fish - crab + type: string + type: array + type: object OuterString: type: string ClassModel: - type: object + description: Model for testing model with "_class" property properties: _class: type: string - description: Model for testing model with "_class" property + type: object OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body Animal: - required: - - className - type: object + discriminator: + propertyName: className properties: className: type: string color: - type: string default: red - discriminator: - propertyName: className + type: string + required: + - className + type: object + StringBooleanMap: + additionalProperties: + type: boolean + type: object Cat: allOf: - $ref: '#/components/schemas/Animal' - - type: object - properties: + - properties: declawed: type: boolean + type: object MapTest: - type: object properties: map_map_of_string: - type: object additionalProperties: - type: object additionalProperties: type: string - map_of_enum_string: + type: object type: object + map_of_enum_string: additionalProperties: - type: string enum: - UPPER - lower - Tag: + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' type: object - properties: - id: - type: integer - format: int64 - name: - type: string + Tag: example: name: name id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object xml: name: Tag AnimalFarm: - type: array items: $ref: '#/components/schemas/Animal' + type: array Pet: - required: - - name - - photoUrls - type: object - properties: - id: - type: integer - format: int64 - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - type: string - example: doggie - photoUrls: - type: array - xml: - name: photoUrl - wrapped: true - items: - type: string - tags: - type: array - xml: - name: tag - wrapped: true - items: - $ref: '#/components/schemas/Tag' - status: - type: string - description: pet status in the store - enum: - - available - - pending - - sold example: photoUrls: - photoUrls @@ -1467,34 +1451,69 @@ components: - name: name id: 1 status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object xml: name: Pet hasOnlyReadOnly: - type: object properties: bar: - type: string readOnly: true + type: string foo: - type: string readOnly: true + type: string + type: object securitySchemes: petstore_auth: - type: oauth2 flows: implicit: authorizationUrl: http://petstore.swagger.io/api/oauth/dialog scopes: write:pets: modify pets in your account read:pets: read your pets + type: oauth2 http_basic_test: - type: http scheme: basic + type: http api_key: - type: apiKey - name: api_key in: header - api_key_query: + name: api_key type: apiKey - name: api_key_query + api_key_query: in: query + name: api_key_query + type: apiKey diff --git a/samples/client/petstore/go/go-petstore/configuration.go b/samples/client/petstore/go/go-petstore/configuration.go index 5a93320f70c..19ccc325fa9 100644 --- a/samples/client/petstore/go/go-petstore/configuration.go +++ b/samples/client/petstore/go/go-petstore/configuration.go @@ -24,7 +24,7 @@ func (c contextKey) String() string { } var ( - // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. + // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. diff --git a/samples/client/petstore/go/go-petstore/docs/MapTest.md b/samples/client/petstore/go/go-petstore/docs/MapTest.md index 3f546994fd4..4f2b9a39b09 100644 --- a/samples/client/petstore/go/go-petstore/docs/MapTest.md +++ b/samples/client/petstore/go/go-petstore/docs/MapTest.md @@ -5,6 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **MapMapOfString** | [**map[string]map[string]string**](map.md) | | [optional] **MapOfEnumString** | **map[string]string** | | [optional] +**DirectMap** | **map[string]bool** | | [optional] +**IndirectMap** | [***StringBooleanMap**](StringBooleanMap.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/StringBooleanMap.md b/samples/client/petstore/go/go-petstore/docs/StringBooleanMap.md new file mode 100644 index 00000000000..7abf11ec68b --- /dev/null +++ b/samples/client/petstore/go/go-petstore/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/go/go-petstore/model_map_test.go b/samples/client/petstore/go/go-petstore/model_map_test.go index 70c3d679b45..c5cd01d5a1d 100644 --- a/samples/client/petstore/go/go-petstore/model_map_test.go +++ b/samples/client/petstore/go/go-petstore/model_map_test.go @@ -12,4 +12,6 @@ package petstore type MapTest struct { MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty"` MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty"` + DirectMap map[string]bool `json:"direct_map,omitempty"` + IndirectMap *StringBooleanMap `json:"indirect_map,omitempty"` } diff --git a/samples/client/petstore/go/go-petstore/model_string_boolean_map.go b/samples/client/petstore/go/go-petstore/model_string_boolean_map.go new file mode 100644 index 00000000000..7cc08c7e895 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/model_string_boolean_map.go @@ -0,0 +1,13 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package petstore + +type StringBooleanMap struct { +} diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java index 9680f7e5440..4dedd32ad76 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -70,6 +71,12 @@ public class MapTest { @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -122,6 +129,50 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -133,12 +184,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -149,6 +202,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java index e1372035e86..0abe10bcfc2 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -82,7 +82,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..8b18b0c9b51 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/google-api-client/docs/MapTest.md b/samples/client/petstore/java/google-api-client/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/google-api-client/docs/MapTest.md +++ b/samples/client/petstore/java/google-api-client/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/google-api-client/docs/StringBooleanMap.md b/samples/client/petstore/java/google-api-client/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java index 9680f7e5440..4dedd32ad76 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -70,6 +71,12 @@ public class MapTest { @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -122,6 +129,50 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -133,12 +184,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -149,6 +202,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java index e1372035e86..0abe10bcfc2 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -82,7 +82,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..8b18b0c9b51 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey1/docs/MapTest.md b/samples/client/petstore/java/jersey1/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/jersey1/docs/MapTest.md +++ b/samples/client/petstore/java/jersey1/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/jersey1/docs/StringBooleanMap.md b/samples/client/petstore/java/jersey1/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java index 9680f7e5440..4dedd32ad76 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -70,6 +71,12 @@ public class MapTest { @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -122,6 +129,50 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -133,12 +184,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -149,6 +202,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java index e1372035e86..0abe10bcfc2 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -82,7 +82,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..8b18b0c9b51 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java6/docs/MapTest.md b/samples/client/petstore/java/jersey2-java6/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/MapTest.md +++ b/samples/client/petstore/java/jersey2-java6/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/jersey2-java6/docs/StringBooleanMap.md b/samples/client/petstore/java/jersey2-java6/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MapTest.java index c048ee5f380..a42b294efdf 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MapTest.java @@ -22,6 +22,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -69,6 +70,12 @@ public class MapTest { @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -121,6 +128,50 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -132,12 +183,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return ObjectUtils.equals(this.mapMapOfString, mapTest.mapMapOfString) && - ObjectUtils.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + ObjectUtils.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + ObjectUtils.equals(this.directMap, mapTest.directMap) && + ObjectUtils.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return ObjectUtils.hashCodeMulti(mapMapOfString, mapOfEnumString); + return ObjectUtils.hashCodeMulti(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -148,6 +201,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/OuterComposite.java index bb6ac11fad3..0307a6368dd 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -81,7 +81,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..5b20288f8f6 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.apache.commons.lang3.ObjectUtils; +import java.util.HashMap; +import java.util.Map; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return ObjectUtils.hashCodeMulti(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java8/docs/MapTest.md b/samples/client/petstore/java/jersey2-java8/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/MapTest.md +++ b/samples/client/petstore/java/jersey2-java8/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/jersey2-java8/docs/StringBooleanMap.md b/samples/client/petstore/java/jersey2-java8/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java index afe217d9d27..be064077883 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -70,6 +71,12 @@ public class MapTest { @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -122,6 +129,50 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -133,12 +184,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -149,6 +202,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java index e1372035e86..0abe10bcfc2 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -82,7 +82,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..8b18b0c9b51 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2/docs/MapTest.md b/samples/client/petstore/java/jersey2/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/jersey2/docs/MapTest.md +++ b/samples/client/petstore/java/jersey2/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/jersey2/docs/StringBooleanMap.md b/samples/client/petstore/java/jersey2/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MapTest.java index 9680f7e5440..4dedd32ad76 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -70,6 +71,12 @@ public class MapTest { @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -122,6 +129,50 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -133,12 +184,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -149,6 +202,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/OuterComposite.java index e1372035e86..0abe10bcfc2 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -82,7 +82,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..8b18b0c9b51 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MapTest.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MapTest.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StringBooleanMap.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java index a7028c27763..7d306580430 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; import android.os.Parcelable; import android.os.Parcel; @@ -89,6 +90,14 @@ public class MapTest implements Parcelable { @SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING) private Map mapOfEnumString = null; + public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map"; + @SerializedName(SERIALIZED_NAME_DIRECT_MAP) + private Map directMap = null; + + public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; + @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) + private StringBooleanMap indirectMap = null; + public MapTest() { } public MapTest mapMapOfString(Map> mapMapOfString) { @@ -143,6 +152,50 @@ public class MapTest implements Parcelable { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -154,12 +207,14 @@ public class MapTest implements Parcelable { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -170,6 +225,8 @@ public class MapTest implements Parcelable { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } @@ -189,11 +246,15 @@ public class MapTest implements Parcelable { public void writeToParcel(Parcel out, int flags) { out.writeValue(mapMapOfString); out.writeValue(mapOfEnumString); + out.writeValue(directMap); + out.writeValue(indirectMap); } MapTest(Parcel in) { mapMapOfString = (Map>)in.readValue(Map.class.getClassLoader()); mapOfEnumString = (Map)in.readValue(null); + directMap = (Map)in.readValue(null); + indirectMap = (StringBooleanMap)in.readValue(StringBooleanMap.class.getClassLoader()); } public int describeContents() { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java index eca5cc50214..815af56c993 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -92,7 +92,7 @@ public class OuterComposite implements Parcelable { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..fa40c1e911a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,91 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import android.os.Parcelable; +import android.os.Parcel; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap implements Parcelable { + public StringBooleanMap() { + super(); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public void writeToParcel(Parcel out, int flags) { + super.writeToParcel(out, flags); + } + + StringBooleanMap(Parcel in) { + super(in); + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public StringBooleanMap createFromParcel(Parcel in) { + return new StringBooleanMap(in); + } + public StringBooleanMap[] newArray(int size) { + return new StringBooleanMap[size]; + } + }; +} + diff --git a/samples/client/petstore/java/okhttp-gson/docs/MapTest.md b/samples/client/petstore/java/okhttp-gson/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/MapTest.md +++ b/samples/client/petstore/java/okhttp-gson/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson/docs/StringBooleanMap.md b/samples/client/petstore/java/okhttp-gson/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java index 66a646f8773..8de793aede1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -87,6 +88,14 @@ public class MapTest { @SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING) private Map mapOfEnumString = null; + public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map"; + @SerializedName(SERIALIZED_NAME_DIRECT_MAP) + private Map directMap = null; + + public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; + @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -139,6 +148,50 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -150,12 +203,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -166,6 +221,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java index 63b15607287..57c78759653 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -88,7 +88,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..8b18b0c9b51 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/rest-assured/docs/MapTest.md b/samples/client/petstore/java/rest-assured/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/rest-assured/docs/MapTest.md +++ b/samples/client/petstore/java/rest-assured/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/rest-assured/docs/StringBooleanMap.md b/samples/client/petstore/java/rest-assured/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java index 66a646f8773..8de793aede1 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -87,6 +88,14 @@ public class MapTest { @SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING) private Map mapOfEnumString = null; + public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map"; + @SerializedName(SERIALIZED_NAME_DIRECT_MAP) + private Map directMap = null; + + public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; + @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -139,6 +148,50 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -150,12 +203,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -166,6 +221,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java index 63b15607287..57c78759653 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -88,7 +88,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..8b18b0c9b51 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resteasy/docs/MapTest.md b/samples/client/petstore/java/resteasy/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/resteasy/docs/MapTest.md +++ b/samples/client/petstore/java/resteasy/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/resteasy/docs/StringBooleanMap.md b/samples/client/petstore/java/resteasy/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java index 9680f7e5440..4dedd32ad76 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -70,6 +71,12 @@ public class MapTest { @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -122,6 +129,50 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -133,12 +184,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -149,6 +202,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java index e1372035e86..0abe10bcfc2 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -82,7 +82,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..8b18b0c9b51 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/MapTest.md b/samples/client/petstore/java/resttemplate-withXml/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/MapTest.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/StringBooleanMap.md b/samples/client/petstore/java/resttemplate-withXml/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java index 1089c495617..d142e7ea62e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; import com.fasterxml.jackson.dataformat.xml.annotation.*; import javax.xml.bind.annotation.*; @@ -83,6 +84,18 @@ public class MapTest { @XmlElement(name = "inner") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + // Is a container wrapped=false + // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= + // items.example= items.type=Boolean + @XmlElement(name = "inner") + private Map directMap = null; + + @JsonProperty("indirect_map") + @JacksonXmlProperty(localName = "indirect_map") + @XmlElement(name = "indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -135,6 +148,50 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -146,12 +203,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -162,6 +221,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java index a595be8f33a..dab2f1bb6fb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -93,7 +93,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..83beddee920 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; + +/** + * StringBooleanMap + */ + +@XmlRootElement(name = "StringBooleanMap") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "StringBooleanMap") +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate/docs/MapTest.md b/samples/client/petstore/java/resttemplate/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/resttemplate/docs/MapTest.md +++ b/samples/client/petstore/java/resttemplate/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/resttemplate/docs/StringBooleanMap.md b/samples/client/petstore/java/resttemplate/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java index 9680f7e5440..4dedd32ad76 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -70,6 +71,12 @@ public class MapTest { @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -122,6 +129,50 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -133,12 +184,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -149,6 +202,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java index e1372035e86..0abe10bcfc2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -82,7 +82,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..8b18b0c9b51 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/MapTest.java index 66a646f8773..8de793aede1 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -87,6 +88,14 @@ public class MapTest { @SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING) private Map mapOfEnumString = null; + public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map"; + @SerializedName(SERIALIZED_NAME_DIRECT_MAP) + private Map directMap = null; + + public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; + @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -139,6 +148,50 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -150,12 +203,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -166,6 +221,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/OuterComposite.java index 63b15607287..57c78759653 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -88,7 +88,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..8b18b0c9b51 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/MapTest.md b/samples/client/petstore/java/retrofit2-play24/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/MapTest.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/retrofit2-play24/docs/StringBooleanMap.md b/samples/client/petstore/java/retrofit2-play24/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MapTest.java index 9ea95db5f97..a0facaa95d5 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; import javax.validation.constraints.*; import javax.validation.Valid; @@ -72,6 +73,12 @@ public class MapTest { @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -125,6 +132,51 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @Valid + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -136,12 +188,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -152,6 +206,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/OuterComposite.java index f0bf1fbaab2..c60256d9227 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -85,7 +85,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..c651556f7d0 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/MapTest.md b/samples/client/petstore/java/retrofit2-play25/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/MapTest.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/retrofit2-play25/docs/StringBooleanMap.md b/samples/client/petstore/java/retrofit2-play25/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MapTest.java index 9ea95db5f97..a0facaa95d5 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; import javax.validation.constraints.*; import javax.validation.Valid; @@ -72,6 +73,12 @@ public class MapTest { @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -125,6 +132,51 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @Valid + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -136,12 +188,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -152,6 +206,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/OuterComposite.java index f0bf1fbaab2..c60256d9227 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -85,7 +85,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..c651556f7d0 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2/docs/MapTest.md b/samples/client/petstore/java/retrofit2/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/retrofit2/docs/MapTest.md +++ b/samples/client/petstore/java/retrofit2/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/retrofit2/docs/StringBooleanMap.md b/samples/client/petstore/java/retrofit2/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java index 66a646f8773..8de793aede1 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -87,6 +88,14 @@ public class MapTest { @SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING) private Map mapOfEnumString = null; + public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map"; + @SerializedName(SERIALIZED_NAME_DIRECT_MAP) + private Map directMap = null; + + public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; + @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -139,6 +148,50 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -150,12 +203,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -166,6 +221,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java index 63b15607287..57c78759653 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -88,7 +88,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..8b18b0c9b51 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx/docs/MapTest.md b/samples/client/petstore/java/retrofit2rx/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/MapTest.md +++ b/samples/client/petstore/java/retrofit2rx/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/retrofit2rx/docs/StringBooleanMap.md b/samples/client/petstore/java/retrofit2rx/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/MapTest.java index 66a646f8773..8de793aede1 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -87,6 +88,14 @@ public class MapTest { @SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING) private Map mapOfEnumString = null; + public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map"; + @SerializedName(SERIALIZED_NAME_DIRECT_MAP) + private Map directMap = null; + + public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; + @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -139,6 +148,50 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -150,12 +203,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -166,6 +221,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/OuterComposite.java index 63b15607287..57c78759653 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -88,7 +88,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..8b18b0c9b51 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/MapTest.md b/samples/client/petstore/java/retrofit2rx2/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/MapTest.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/retrofit2rx2/docs/StringBooleanMap.md b/samples/client/petstore/java/retrofit2rx2/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java index 66a646f8773..8de793aede1 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -87,6 +88,14 @@ public class MapTest { @SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING) private Map mapOfEnumString = null; + public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map"; + @SerializedName(SERIALIZED_NAME_DIRECT_MAP) + private Map directMap = null; + + public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map"; + @SerializedName(SERIALIZED_NAME_INDIRECT_MAP) + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -139,6 +148,50 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -150,12 +203,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -166,6 +221,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java index 63b15607287..57c78759653 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -88,7 +88,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..8b18b0c9b51 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/vertx/docs/MapTest.md b/samples/client/petstore/java/vertx/docs/MapTest.md index 714a97a40d9..f3b592d43fe 100644 --- a/samples/client/petstore/java/vertx/docs/MapTest.md +++ b/samples/client/petstore/java/vertx/docs/MapTest.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] diff --git a/samples/client/petstore/java/vertx/docs/StringBooleanMap.md b/samples/client/petstore/java/vertx/docs/StringBooleanMap.md new file mode 100644 index 00000000000..cac7afc80e0 --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/StringBooleanMap.md @@ -0,0 +1,9 @@ + +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java index afe217d9d27..be064077883 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java @@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.client.model.StringBooleanMap; /** * MapTest @@ -70,6 +71,12 @@ public class MapTest { @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -122,6 +129,50 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -133,12 +184,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -149,6 +202,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java index e1372035e86..0abe10bcfc2 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -82,7 +82,7 @@ public class OuterComposite { * @return myBoolean **/ @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/StringBooleanMap.java new file mode 100644 index 00000000000..8b18b0c9b51 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/StringBooleanMap.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/php/OpenAPIClient-php/README.md b/samples/client/petstore/php/OpenAPIClient-php/README.md index 82d72fc9c38..2cfbee0e687 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php/OpenAPIClient-php/README.md @@ -146,6 +146,7 @@ Class | Method | HTTP request | Description - [Pet](docs/Model/Pet.md) - [ReadOnlyFirst](docs/Model/ReadOnlyFirst.md) - [SpecialModelName](docs/Model/SpecialModelName.md) + - [StringBooleanMap](docs/Model/StringBooleanMap.md) - [Tag](docs/Model/Tag.md) - [User](docs/Model/User.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/MapTest.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/MapTest.md index e2781ccc398..a6b378ac1fe 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/MapTest.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/MapTest.md @@ -5,6 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **map_map_of_string** | [**map[string,map[string,string]]**](map.md) | | [optional] **map_of_enum_string** | **map[string,string]** | | [optional] +**direct_map** | **map[string,bool]** | | [optional] +**indirect_map** | [**\OpenAPI\Client\Model\StringBooleanMap**](StringBooleanMap.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Model/StringBooleanMap.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/StringBooleanMap.md new file mode 100644 index 00000000000..7abf11ec68b --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Model/StringBooleanMap.md @@ -0,0 +1,9 @@ +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index 58763fc4770..558bd7472d8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -58,7 +58,9 @@ class MapTest implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'map_map_of_string' => 'map[string,map[string,string]]', - 'map_of_enum_string' => 'map[string,string]' + 'map_of_enum_string' => 'map[string,string]', + 'direct_map' => 'map[string,bool]', + 'indirect_map' => '\OpenAPI\Client\Model\StringBooleanMap' ]; /** @@ -68,7 +70,9 @@ class MapTest implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'map_map_of_string' => null, - 'map_of_enum_string' => null + 'map_of_enum_string' => null, + 'direct_map' => null, + 'indirect_map' => null ]; /** @@ -99,7 +103,9 @@ class MapTest implements ModelInterface, ArrayAccess */ protected static $attributeMap = [ 'map_map_of_string' => 'map_map_of_string', - 'map_of_enum_string' => 'map_of_enum_string' + 'map_of_enum_string' => 'map_of_enum_string', + 'direct_map' => 'direct_map', + 'indirect_map' => 'indirect_map' ]; /** @@ -109,7 +115,9 @@ class MapTest implements ModelInterface, ArrayAccess */ protected static $setters = [ 'map_map_of_string' => 'setMapMapOfString', - 'map_of_enum_string' => 'setMapOfEnumString' + 'map_of_enum_string' => 'setMapOfEnumString', + 'direct_map' => 'setDirectMap', + 'indirect_map' => 'setIndirectMap' ]; /** @@ -119,7 +127,9 @@ class MapTest implements ModelInterface, ArrayAccess */ protected static $getters = [ 'map_map_of_string' => 'getMapMapOfString', - 'map_of_enum_string' => 'getMapOfEnumString' + 'map_of_enum_string' => 'getMapOfEnumString', + 'direct_map' => 'getDirectMap', + 'indirect_map' => 'getIndirectMap' ]; /** @@ -199,6 +209,8 @@ class MapTest implements ModelInterface, ArrayAccess { $this->container['map_map_of_string'] = isset($data['map_map_of_string']) ? $data['map_map_of_string'] : null; $this->container['map_of_enum_string'] = isset($data['map_of_enum_string']) ? $data['map_of_enum_string'] : null; + $this->container['direct_map'] = isset($data['direct_map']) ? $data['direct_map'] : null; + $this->container['indirect_map'] = isset($data['indirect_map']) ? $data['indirect_map'] : null; } /** @@ -281,6 +293,54 @@ class MapTest implements ModelInterface, ArrayAccess return $this; } + + /** + * Gets direct_map + * + * @return map[string,bool]|null + */ + public function getDirectMap() + { + return $this->container['direct_map']; + } + + /** + * Sets direct_map + * + * @param map[string,bool]|null $direct_map direct_map + * + * @return $this + */ + public function setDirectMap($direct_map) + { + $this->container['direct_map'] = $direct_map; + + return $this; + } + + /** + * Gets indirect_map + * + * @return \OpenAPI\Client\Model\StringBooleanMap|null + */ + public function getIndirectMap() + { + return $this->container['indirect_map']; + } + + /** + * Sets indirect_map + * + * @param \OpenAPI\Client\Model\StringBooleanMap|null $indirect_map indirect_map + * + * @return $this + */ + public function setIndirectMap($indirect_map) + { + $this->container['indirect_map'] = $indirect_map; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/StringBooleanMap.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/StringBooleanMap.php new file mode 100644 index 00000000000..e3daddaf25c --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/StringBooleanMap.php @@ -0,0 +1,276 @@ +listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php index ecd4b1d36b0..a250c789a34 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php @@ -89,4 +89,18 @@ class MapTestTest extends \PHPUnit_Framework_TestCase public function testPropertyMapOfEnumString() { } + + /** + * Test attribute "direct_map" + */ + public function testPropertyDirectMap() + { + } + + /** + * Test attribute "indirect_map" + */ + public function testPropertyIndirectMap() + { + } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/StringBooleanMapTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/StringBooleanMapTest.php new file mode 100644 index 00000000000..aff312636b3 --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/StringBooleanMapTest.php @@ -0,0 +1,78 @@ + :'map_map_of_string', - :'map_of_enum_string' => :'map_of_enum_string' + :'map_of_enum_string' => :'map_of_enum_string', + :'direct_map' => :'direct_map', + :'indirect_map' => :'indirect_map' } end @@ -52,7 +58,9 @@ module Petstore def self.openapi_types { :'map_map_of_string' => :'Hash>', - :'map_of_enum_string' => :'Hash' + :'map_of_enum_string' => :'Hash', + :'direct_map' => :'Hash', + :'indirect_map' => :'StringBooleanMap' } end @@ -75,6 +83,16 @@ module Petstore self.map_of_enum_string = value end end + + if attributes.has_key?(:'direct_map') + if (value = attributes[:'direct_map']).is_a?(Hash) + self.direct_map = value + end + end + + if attributes.has_key?(:'indirect_map') + self.indirect_map = attributes[:'indirect_map'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -96,7 +114,9 @@ module Petstore return true if self.equal?(o) self.class == o.class && map_map_of_string == o.map_map_of_string && - map_of_enum_string == o.map_of_enum_string + map_of_enum_string == o.map_of_enum_string && + direct_map == o.direct_map && + indirect_map == o.indirect_map end # @see the `==` method @@ -108,7 +128,7 @@ module Petstore # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [map_map_of_string, map_of_enum_string].hash + [map_map_of_string, map_of_enum_string, direct_map, indirect_map].hash end # Builds the object from hash diff --git a/samples/client/petstore/ruby/lib/petstore/models/string_boolean_map.rb b/samples/client/petstore/ruby/lib/petstore/models/string_boolean_map.rb new file mode 100644 index 00000000000..c781c0e3549 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/string_boolean_map.rb @@ -0,0 +1,174 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.1.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class StringBooleanMap + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + } + end + + # Attribute type mapping. + def self.openapi_types + { + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby/spec/models/string_boolean_map_spec.rb b/samples/client/petstore/ruby/spec/models/string_boolean_map_spec.rb new file mode 100644 index 00000000000..3f54837a62a --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/string_boolean_map_spec.rb @@ -0,0 +1,35 @@ +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.0.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::StringBooleanMap +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'StringBooleanMap' do + before do + # run before each test + @instance = Petstore::StringBooleanMap.new + end + + after do + # run after each test + end + + describe 'test an instance of StringBooleanMap' do + it 'should create an instance of StringBooleanMap' do + expect(@instance).to be_instance_of(Petstore::StringBooleanMap) + end + end +end diff --git a/samples/server/petstore/go-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-api-server/.openapi-generator/VERSION index ad121e8340e..82602aa4190 100644 --- a/samples/server/petstore/go-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.1-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/MapTest.java index 5fc2cf9ae9d..50e018a5035 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/MapTest.java @@ -3,6 +3,7 @@ package org.openapitools.model; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import javax.validation.constraints.*; import javax.validation.Valid; @@ -56,6 +57,13 @@ public enum InnerEnum { @ApiModelProperty(value = "") private Map mapOfEnumString = null; + + @ApiModelProperty(value = "") + private Map directMap = null; + + @ApiModelProperty(value = "") + @Valid + private StringBooleanMap indirectMap = null; /** * Get mapMapOfString * @return mapMapOfString @@ -102,6 +110,47 @@ public enum InnerEnum { return this; } + /** + * Get directMap + * @return directMap + **/ + @JsonProperty("direct_map") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @JsonProperty("indirect_map") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + @Override public String toString() { @@ -110,6 +159,8 @@ public enum InnerEnum { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/OuterComposite.java index 3feb1375665..dd8626ae8c7 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/OuterComposite.java @@ -66,7 +66,7 @@ public class OuterComposite { * @return myBoolean **/ @JsonProperty("my_boolean") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..be2e2950ecb --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,40 @@ +package org.openapitools.model; + +import java.util.HashMap; +import java.util.Map; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class StringBooleanMap extends HashMap { + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java index 845f4021a8c..1863dcb233f 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java @@ -22,6 +22,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import java.io.Serializable; import javax.validation.constraints.*; @@ -67,6 +68,12 @@ public class MapTest implements Serializable { @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -121,6 +128,52 @@ public class MapTest implements Serializable { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @JsonProperty("direct_map") + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @JsonProperty("indirect_map") + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -132,12 +185,14 @@ public class MapTest implements Serializable { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -148,6 +203,8 @@ public class MapTest implements Serializable { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterComposite.java index 5da708d5e19..a768b55de38 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterComposite.java @@ -85,7 +85,7 @@ public class OuterComposite implements Serializable { **/ @JsonProperty("my_boolean") @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..3ea93308ddc --- /dev/null +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import java.util.HashMap; +import java.util.Map; +import java.io.Serializable; +import javax.validation.constraints.*; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap implements Serializable { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java index 7fa3bae1640..77bc760d805 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java @@ -3,6 +3,7 @@ package org.openapitools.model; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -50,6 +51,8 @@ public enum InnerEnum { } private @Valid Map mapOfEnumString = new HashMap(); + private @Valid Map directMap = new HashMap(); + private @Valid StringBooleanMap indirectMap = null; /** **/ @@ -85,6 +88,40 @@ public enum InnerEnum { this.mapOfEnumString = mapOfEnumString; } + /** + **/ + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("direct_map") + public Map getDirectMap() { + return directMap; + } + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + /** + **/ + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("indirect_map") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -96,12 +133,14 @@ public enum InnerEnum { } MapTest mapTest = (MapTest) o; return Objects.equals(mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(directMap, mapTest.directMap) && + Objects.equals(indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @Override @@ -111,6 +150,8 @@ public enum InnerEnum { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/OuterComposite.java index f16bef370a7..192b50388b0 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/OuterComposite.java @@ -61,7 +61,7 @@ public class OuterComposite implements Serializable { @ApiModelProperty(value = "") @JsonProperty("my_boolean") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } public void setMyBoolean(Boolean myBoolean) { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..99423ff436c --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,56 @@ +package org.openapitools.model; + +import java.util.HashMap; +import java.util.Map; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class StringBooleanMap extends HashMap implements Serializable { + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StringBooleanMap stringBooleanMap = (StringBooleanMap) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml index 43eafcddd2d..5a18f6c71c3 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml @@ -1342,14 +1342,18 @@ components: type: array type: object OuterComposite: - example: {} + example: + my_string: my_string + my_number: 0.80082819046101150206595775671303272247314453125 + my_boolean: true properties: my_number: - $ref: '#/components/schemas/OuterNumber' + type: number my_string: - $ref: '#/components/schemas/OuterString' + type: string my_boolean: - $ref: '#/components/schemas/OuterBoolean' + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object format_test: properties: @@ -1447,6 +1451,10 @@ components: required: - className type: object + StringBooleanMap: + additionalProperties: + type: boolean + type: object Cat: allOf: - $ref: '#/components/schemas/Animal' @@ -1469,6 +1477,12 @@ components: - lower type: string type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' type: object Tag: example: diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java index 7fa3bae1640..77bc760d805 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java @@ -3,6 +3,7 @@ package org.openapitools.model; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -50,6 +51,8 @@ public enum InnerEnum { } private @Valid Map mapOfEnumString = new HashMap(); + private @Valid Map directMap = new HashMap(); + private @Valid StringBooleanMap indirectMap = null; /** **/ @@ -85,6 +88,40 @@ public enum InnerEnum { this.mapOfEnumString = mapOfEnumString; } + /** + **/ + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("direct_map") + public Map getDirectMap() { + return directMap; + } + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + /** + **/ + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("indirect_map") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -96,12 +133,14 @@ public enum InnerEnum { } MapTest mapTest = (MapTest) o; return Objects.equals(mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(directMap, mapTest.directMap) && + Objects.equals(indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @Override @@ -111,6 +150,8 @@ public enum InnerEnum { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterComposite.java index f16bef370a7..192b50388b0 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterComposite.java @@ -61,7 +61,7 @@ public class OuterComposite implements Serializable { @ApiModelProperty(value = "") @JsonProperty("my_boolean") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } public void setMyBoolean(Boolean myBoolean) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..99423ff436c --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,56 @@ +package org.openapitools.model; + +import java.util.HashMap; +import java.util.Map; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class StringBooleanMap extends HashMap implements Serializable { + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StringBooleanMap stringBooleanMap = (StringBooleanMap) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index 43eafcddd2d..5a18f6c71c3 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -1342,14 +1342,18 @@ components: type: array type: object OuterComposite: - example: {} + example: + my_string: my_string + my_number: 0.80082819046101150206595775671303272247314453125 + my_boolean: true properties: my_number: - $ref: '#/components/schemas/OuterNumber' + type: number my_string: - $ref: '#/components/schemas/OuterString' + type: string my_boolean: - $ref: '#/components/schemas/OuterBoolean' + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object format_test: properties: @@ -1447,6 +1451,10 @@ components: required: - className type: object + StringBooleanMap: + additionalProperties: + type: boolean + type: object Cat: allOf: - $ref: '#/components/schemas/Animal' @@ -1469,6 +1477,12 @@ components: - lower type: string type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' type: object Tag: example: diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java index b93c1034e6c..b39cf01198a 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java @@ -22,6 +22,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import javax.validation.constraints.*; /** @@ -66,6 +67,12 @@ public class MapTest { @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -120,6 +127,52 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @JsonProperty("direct_map") + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @JsonProperty("indirect_map") + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -131,12 +184,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -147,6 +202,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterComposite.java index 7df1ce746e1..dd4a7e47be6 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterComposite.java @@ -84,7 +84,7 @@ public class OuterComposite { **/ @JsonProperty("my_boolean") @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..4b0bf53231b --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import java.util.HashMap; +import java.util.Map; +import javax.validation.constraints.*; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java index b93c1034e6c..b39cf01198a 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java @@ -22,6 +22,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import javax.validation.constraints.*; /** @@ -66,6 +67,12 @@ public class MapTest { @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -120,6 +127,52 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @JsonProperty("direct_map") + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @JsonProperty("indirect_map") + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -131,12 +184,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -147,6 +202,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterComposite.java index 7df1ce746e1..dd4a7e47be6 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterComposite.java @@ -84,7 +84,7 @@ public class OuterComposite { **/ @JsonProperty("my_boolean") @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..4b0bf53231b --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import java.util.HashMap; +import java.util.Map; +import javax.validation.constraints.*; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java index b93c1034e6c..b39cf01198a 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java @@ -22,6 +22,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import javax.validation.constraints.*; /** @@ -66,6 +67,12 @@ public class MapTest { @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -120,6 +127,52 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @JsonProperty("direct_map") + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @JsonProperty("indirect_map") + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -131,12 +184,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -147,6 +202,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterComposite.java index 7df1ce746e1..dd4a7e47be6 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterComposite.java @@ -84,7 +84,7 @@ public class OuterComposite { **/ @JsonProperty("my_boolean") @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..4b0bf53231b --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import java.util.HashMap; +import java.util.Map; +import javax.validation.constraints.*; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java index b93c1034e6c..b39cf01198a 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java @@ -22,6 +22,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import javax.validation.constraints.*; /** @@ -66,6 +67,12 @@ public class MapTest { @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; + @JsonProperty("direct_map") + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -120,6 +127,52 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @JsonProperty("direct_map") + @ApiModelProperty(value = "") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @JsonProperty("indirect_map") + @ApiModelProperty(value = "") + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -131,12 +184,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @@ -147,6 +202,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterComposite.java index 7df1ce746e1..dd4a7e47be6 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterComposite.java @@ -84,7 +84,7 @@ public class OuterComposite { **/ @JsonProperty("my_boolean") @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..4b0bf53231b --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.model; + +import java.util.Objects; +import java.util.HashMap; +import java.util.Map; +import javax.validation.constraints.*; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/php-ze-ph/src/App/DTO/MapTest.php b/samples/server/petstore/php-ze-ph/src/App/DTO/MapTest.php index 1a0c87a7082..0f933f96c12 100644 --- a/samples/server/petstore/php-ze-ph/src/App/DTO/MapTest.php +++ b/samples/server/petstore/php-ze-ph/src/App/DTO/MapTest.php @@ -27,4 +27,20 @@ class MapTest * @var map[string,string] */ public $map_of_enum_string; + /** + * @DTA\Data(field="direct_map", nullable=true) + * TODO check validator and strategy are correct and can handle container item type + * @DTA\Validator(name="Collection", options={"validators":{ + * {"name":"Type", "options":{"type":"bool"}} + * }}) + * @var map[string,bool] + */ + public $direct_map; + /** + * @DTA\Data(field="indirect_map", nullable=true) + * @DTA\Strategy(name="Object", options={"type":\App\DTO\StringBooleanMap::class}) + * @DTA\Validator(name="Dictionary", options={"type":\App\DTO\StringBooleanMap::class}) + * @var \App\DTO\StringBooleanMap + */ + public $indirect_map; } diff --git a/samples/server/petstore/php-ze-ph/src/App/DTO/StringBooleanMap.php b/samples/server/petstore/php-ze-ph/src/App/DTO/StringBooleanMap.php new file mode 100644 index 00000000000..49870daf222 --- /dev/null +++ b/samples/server/petstore/php-ze-ph/src/App/DTO/StringBooleanMap.php @@ -0,0 +1,11 @@ + { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ }"); + ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.80082819046101150206595775671303272247314453125, \"my_boolean\" : true}"); break; } } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java index 3d88b562ba4..818a51978c4 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -56,6 +57,13 @@ public class MapTest { @Valid private Map mapOfEnumString = null; + @JsonProperty("direct_map") + @Valid + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -113,6 +121,55 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + + + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + + @Valid + + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -124,12 +181,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @Override @@ -139,6 +198,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java index c343b0b39ed..d8de3954416 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java @@ -76,7 +76,7 @@ public class OuterComposite { @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..42b689e5e22 --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,51 @@ +package org.openapitools.model; + +import java.util.Objects; +import java.util.HashMap; +import java.util.Map; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index c881684f082..78c6d7f3e72 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -72,7 +72,7 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ }"); + ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.80082819046101150206595775671303272247314453125, \"my_boolean\" : true}"); break; } } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java index 3d88b562ba4..818a51978c4 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -56,6 +57,13 @@ public class MapTest { @Valid private Map mapOfEnumString = null; + @JsonProperty("direct_map") + @Valid + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -113,6 +121,55 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + + + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + + @Valid + + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -124,12 +181,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @Override @@ -139,6 +198,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java index c343b0b39ed..d8de3954416 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java @@ -76,7 +76,7 @@ public class OuterComposite { @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..42b689e5e22 --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,51 @@ +package org.openapitools.model; + +import java.util.Objects; +import java.util.HashMap; +import java.util.Map; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java index 624be6d6926..fef8e057699 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java @@ -52,7 +52,7 @@ public class FakeApiController implements FakeApi { public ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite outerComposite) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ }"); + ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.80082819046101150206595775671303272247314453125, \"my_boolean\" : true}"); break; } } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java index ef00ee6ef9c..8bd49e48408 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -56,6 +57,13 @@ public class MapTest { @Valid private Map mapOfEnumString = null; + @JsonProperty("direct_map") + @Valid + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -113,6 +121,55 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + + + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + + @Valid + + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -124,12 +181,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @Override @@ -139,6 +198,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java index c343b0b39ed..d8de3954416 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java @@ -76,7 +76,7 @@ public class OuterComposite { @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..42b689e5e22 --- /dev/null +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,51 @@ +package org.openapitools.model; + +import java.util.Objects; +import java.util.HashMap; +import java.util.Map; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java index 26af39e6eb1..000b811e058 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java @@ -52,7 +52,7 @@ public class FakeApiController implements FakeApi { public ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite outerComposite) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ }"); + ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.80082819046101150206595775671303272247314453125, \"my_boolean\" : true}"); break; } } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java index ef00ee6ef9c..8bd49e48408 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -56,6 +57,13 @@ public class MapTest { @Valid private Map mapOfEnumString = null; + @JsonProperty("direct_map") + @Valid + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -113,6 +121,55 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + + + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + + @Valid + + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -124,12 +181,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @Override @@ -139,6 +198,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java index c343b0b39ed..d8de3954416 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java @@ -76,7 +76,7 @@ public class OuterComposite { @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..42b689e5e22 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,51 @@ +package org.openapitools.model; + +import java.util.Objects; +import java.util.HashMap; +import java.util.Map; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index bbc6dcd9176..aea629f7eda 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -53,7 +53,7 @@ public interface FakeApiDelegate { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ }"); + ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.80082819046101150206595775671303272247314453125, \"my_boolean\" : true}"); break; } } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java index 3d88b562ba4..818a51978c4 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -56,6 +57,13 @@ public class MapTest { @Valid private Map mapOfEnumString = null; + @JsonProperty("direct_map") + @Valid + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -113,6 +121,55 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + + + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + + @Valid + + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -124,12 +181,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @Override @@ -139,6 +198,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java index c343b0b39ed..d8de3954416 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -76,7 +76,7 @@ public class OuterComposite { @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..42b689e5e22 --- /dev/null +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,51 @@ +package org.openapitools.model; + +import java.util.Objects; +import java.util.HashMap; +import java.util.Map; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java index ef00ee6ef9c..8bd49e48408 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -56,6 +57,13 @@ public class MapTest { @Valid private Map mapOfEnumString = null; + @JsonProperty("direct_map") + @Valid + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -113,6 +121,55 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + + + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + + @Valid + + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -124,12 +181,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @Override @@ -139,6 +198,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java index c343b0b39ed..d8de3954416 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java @@ -76,7 +76,7 @@ public class OuterComposite { @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..42b689e5e22 --- /dev/null +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,51 @@ +package org.openapitools.model; + +import java.util.Objects; +import java.util.HashMap; +import java.util.Map; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index dd0f9a478d4..555ae7e22b1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -76,7 +76,7 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ }"); + ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.80082819046101150206595775671303272247314453125, \"my_boolean\" : true}"); break; } } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java index 3d88b562ba4..818a51978c4 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -56,6 +57,13 @@ public class MapTest { @Valid private Map mapOfEnumString = null; + @JsonProperty("direct_map") + @Valid + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -113,6 +121,55 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + + + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + + @Valid + + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -124,12 +181,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @Override @@ -139,6 +198,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java index c343b0b39ed..d8de3954416 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java @@ -76,7 +76,7 @@ public class OuterComposite { @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..42b689e5e22 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,51 @@ +package org.openapitools.model; + +import java.util.Objects; +import java.util.HashMap; +import java.util.Map; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 8142a410113..65eeb503d6f 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -70,7 +70,7 @@ public interface FakeApi { Mono result = Mono.empty(); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - result = ApiUtil.getExampleResponse(exchange, "{ }") + result = ApiUtil.getExampleResponse(exchange, "{ \"my_string\" : \"my_string\", \"my_number\" : 0.80082819046101150206595775671303272247314453125, \"my_boolean\" : true}") .then(Mono.empty()); break; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java index 3d88b562ba4..818a51978c4 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -56,6 +57,13 @@ public class MapTest { @Valid private Map mapOfEnumString = null; + @JsonProperty("direct_map") + @Valid + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -113,6 +121,55 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + + + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + + @Valid + + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -124,12 +181,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @Override @@ -139,6 +198,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java index c343b0b39ed..d8de3954416 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java @@ -76,7 +76,7 @@ public class OuterComposite { @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..42b689e5e22 --- /dev/null +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,51 @@ +package org.openapitools.model; + +import java.util.Objects; +import java.util.HashMap; +import java.util.Map; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index 8bf8a08e0b6..b9ad008e6b3 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -1395,14 +1395,18 @@ components: type: array type: object OuterComposite: - example: {} + example: + my_string: my_string + my_number: 0.80082819046101150206595775671303272247314453125 + my_boolean: true properties: my_number: - $ref: '#/components/schemas/OuterNumber' + type: number my_string: - $ref: '#/components/schemas/OuterString' + type: string my_boolean: - $ref: '#/components/schemas/OuterBoolean' + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object format_test: properties: @@ -1500,6 +1504,10 @@ components: required: - className type: object + StringBooleanMap: + additionalProperties: + type: boolean + type: object Cat: allOf: - $ref: '#/components/schemas/Animal' @@ -1522,6 +1530,12 @@ components: - lower type: string type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' type: object Tag: example: diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 8b4b2d52c80..9c3a58b5fc6 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -72,7 +72,7 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ }"); + ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.80082819046101150206595775671303272247314453125, \"my_boolean\" : true}"); break; } } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java index 3d88b562ba4..818a51978c4 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -56,6 +57,13 @@ public class MapTest { @Valid private Map mapOfEnumString = null; + @JsonProperty("direct_map") + @Valid + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -113,6 +121,55 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + + + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + + @Valid + + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -124,12 +181,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @Override @@ -139,6 +198,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java index c343b0b39ed..d8de3954416 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java @@ -76,7 +76,7 @@ public class OuterComposite { @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..42b689e5e22 --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,51 @@ +package org.openapitools.model; + +import java.util.Objects; +import java.util.HashMap; +import java.util.Map; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index ace2c43c593..bf690fc6dc6 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -72,7 +72,7 @@ public interface FakeApi { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - ApiUtil.setExampleResponse(request, "*/*", "{ }"); + ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.80082819046101150206595775671303272247314453125, \"my_boolean\" : true}"); break; } } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java index 3d88b562ba4..818a51978c4 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import javax.validation.Valid; import javax.validation.constraints.*; @@ -56,6 +57,13 @@ public class MapTest { @Valid private Map mapOfEnumString = null; + @JsonProperty("direct_map") + @Valid + private Map directMap = null; + + @JsonProperty("indirect_map") + private StringBooleanMap indirectMap = null; + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; @@ -113,6 +121,55 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @ApiModelProperty(value = "") + + + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @ApiModelProperty(value = "") + + @Valid + + public StringBooleanMap getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(StringBooleanMap indirectMap) { + this.indirectMap = indirectMap; + } + @Override public boolean equals(java.lang.Object o) { @@ -124,12 +181,14 @@ public class MapTest { } MapTest mapTest = (MapTest) o; return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @Override @@ -139,6 +198,8 @@ public class MapTest { sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterComposite.java index c343b0b39ed..d8de3954416 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterComposite.java @@ -76,7 +76,7 @@ public class OuterComposite { @ApiModelProperty(value = "") - public Boolean getMyBoolean() { + public Boolean isMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/StringBooleanMap.java new file mode 100644 index 00000000000..42b689e5e22 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/StringBooleanMap.java @@ -0,0 +1,51 @@ +package org.openapitools.model; + +import java.util.Objects; +import java.util.HashMap; +import java.util.Map; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * StringBooleanMap + */ + +public class StringBooleanMap extends HashMap { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringBooleanMap {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + From 4cb51ac7c19557a1b3805c8fc088f309f9285c27 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 21 Jun 2018 23:36:39 +0800 Subject: [PATCH 25/35] add wording to clarify the relationship with OAI (#374) --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f5c7c52b393..945fa485d2b 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,9 @@ :warning: If the OpenAPI spec is obtained from an untrusted source, please make sure you've reviewed the spec before using OpenAPI Generator to generate the API client, server stub or documentation as [code injection](https://en.wikipedia.org/wiki/Code_injection) may occur :warning: +:bangbang: Both "OpenAPI Tools" (https://OpenAPITools.org - the parent organization of OpenAPI Generator) and "OpenAPI Generator" are not affiliated with OpenAPI Initiative (OAI) :bangbang: + + ## Overview From 825e4e99e3742636cc9e53d2f217d3ab3c80c094 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 22 Jun 2018 01:20:38 +0800 Subject: [PATCH 26/35] disable erlang server test due to dependency issue (#375) --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a3328919724..ad25e85ef04 100644 --- a/pom.xml +++ b/pom.xml @@ -974,7 +974,8 @@ samples/client/petstore/elixir samples/client/petstore/erlang-client - samples/server/petstore/erlang-server + samples/server/petstore/jaxrs/jersey2 samples/server/petstore/jaxrs/jersey2-useTags samples/server/petstore/spring-mvc From 23ab5177b34493f37c3568ee698ee4d1c4cd20a9 Mon Sep 17 00:00:00 2001 From: stkrwork Date: Fri, 22 Jun 2018 03:12:35 +0200 Subject: [PATCH 27/35] [C++][Pistache] Fix optional error and wrong function signatures (#264) * Added missing includes for optional * Removed shared pointer from pistache generator * Changed Net namespace to Pistache Namespace * Clean up code and removed unnecessary lines in mustache files * Removed remaining shared pointer syntax * Code review fixes + updated samples * Added const to all model setter functions, and reference to all params in setters that are not primitives * Refactored modelbase * Removed const * Updated samples --- .../.openapi-generator/VERSION | 2 +- .../languages/CppPistacheServerCodegen.java | 32 +++++-------------- .../cpp-pistache-server/api-header.mustache | 4 ++- .../api-impl-header.mustache | 2 ++ .../cpp-pistache-server/api-source.mustache | 10 +++--- .../cpp-pistache-server/model-header.mustache | 2 +- .../cpp-pistache-server/model-source.mustache | 6 ++-- .../modelbase-header.mustache | 14 ++++---- .../modelbase-source.mustache | 16 +++++----- .../cpp-pistache/.openapi-generator/VERSION | 2 +- .../petstore/cpp-pistache/api/PetApi.cpp | 10 +++--- .../server/petstore/cpp-pistache/api/PetApi.h | 10 +++--- .../petstore/cpp-pistache/api/StoreApi.cpp | 10 +++--- .../petstore/cpp-pistache/api/StoreApi.h | 4 ++- .../petstore/cpp-pistache/api/UserApi.cpp | 10 +++--- .../petstore/cpp-pistache/api/UserApi.h | 10 +++--- .../petstore/cpp-pistache/impl/PetApiImpl.cpp | 6 ++-- .../petstore/cpp-pistache/impl/PetApiImpl.h | 8 +++-- .../petstore/cpp-pistache/impl/StoreApiImpl.h | 2 ++ .../cpp-pistache/impl/UserApiImpl.cpp | 6 ++-- .../petstore/cpp-pistache/impl/UserApiImpl.h | 8 +++-- .../cpp-pistache/model/ApiResponse.cpp | 6 ++-- .../petstore/cpp-pistache/model/ApiResponse.h | 6 ++-- .../petstore/cpp-pistache/model/Category.cpp | 4 +-- .../petstore/cpp-pistache/model/Category.h | 4 +-- .../petstore/cpp-pistache/model/ModelBase.cpp | 16 +++++----- .../petstore/cpp-pistache/model/ModelBase.h | 14 ++++---- .../petstore/cpp-pistache/model/Order.cpp | 12 +++---- .../petstore/cpp-pistache/model/Order.h | 12 +++---- .../petstore/cpp-pistache/model/Pet.cpp | 22 ++++++------- .../server/petstore/cpp-pistache/model/Pet.h | 16 +++++----- .../petstore/cpp-pistache/model/Tag.cpp | 4 +-- .../server/petstore/cpp-pistache/model/Tag.h | 4 +-- .../petstore/cpp-pistache/model/User.cpp | 16 +++++----- .../server/petstore/cpp-pistache/model/User.h | 16 +++++----- 35 files changed, 163 insertions(+), 163 deletions(-) diff --git a/modules/openapi-generator-online/.openapi-generator/VERSION b/modules/openapi-generator-online/.openapi-generator/VERSION index 096bf47efe3..ad121e8340e 100644 --- a/modules/openapi-generator-online/.openapi-generator/VERSION +++ b/modules/openapi-generator-online/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.0.1-SNAPSHOT \ No newline at end of file diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java index 1bbfafbce37..6467b33edc9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java @@ -219,14 +219,14 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { //TODO: This changes the info about the real type but it is needed to parse the header params if (param.isHeaderParam) { - param.dataType = "Optional"; - param.baseType = "Optional"; + param.dataType = "Pistache::Optional"; + param.baseType = "Pistache::Optional"; } else if (param.isQueryParam) { if (param.isPrimitiveType) { - param.dataType = "Optional<" + param.dataType + ">"; + param.dataType = "Pistache::Optional<" + param.dataType + ">"; } else { - param.dataType = "Optional<" + param.baseType + ">"; - param.baseType = "Optional<" + param.baseType + ">"; + param.dataType = "Pistache::Optional<" + param.baseType + ">"; + param.baseType = "Pistache::Optional<" + param.baseType + ">"; } } } @@ -299,7 +299,7 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { return toModelName(openAPIType); } - return "std::shared_ptr<" + openAPIType + ">"; + return openAPIType; } @Override @@ -326,30 +326,14 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen { } else if (ModelUtils.isArraySchema(p)) { ArraySchema ap = (ArraySchema) p; String inner = getSchemaType(ap.getItems()); - if (!languageSpecificPrimitives.contains(inner)) { - inner = "std::shared_ptr<" + inner + ">"; - } return "std::vector<" + inner + ">()"; } else if (!StringUtils.isEmpty(p.get$ref())) { // model - return "new " + toModelName(ModelUtils.getSimpleRef(p.get$ref())) + "()"; + return toModelName(ModelUtils.getSimpleRef(p.get$ref())) + "()"; } else if (ModelUtils.isStringSchema(p)) { return "\"\""; } - return "nullptr"; - } - - @Override - public void postProcessParameter(CodegenParameter parameter) { - super.postProcessParameter(parameter); - - boolean isPrimitiveType = parameter.isPrimitiveType == Boolean.TRUE; - boolean isListContainer = parameter.isListContainer == Boolean.TRUE; - boolean isString = parameter.isString == Boolean.TRUE; - - if (!isPrimitiveType && !isListContainer && !isString && !parameter.dataType.startsWith("std::shared_ptr")) { - parameter.dataType = "std::shared_ptr<" + parameter.dataType + ">"; - } + return ""; } /** diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-header.mustache index 735fe5c1b7b..1ede8d1a982 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-header.mustache @@ -14,6 +14,8 @@ #include #include +#include + {{#imports}}{{{import}}} {{/imports}} @@ -41,7 +43,7 @@ private: {{/operation}} void {{classnameSnakeLowerCase}}_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - std::shared_ptr httpEndpoint; + Pistache::Http::Endpoint httpEndpoint; Pistache::Rest::Router router; {{#operation}} diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-impl-header.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-impl-header.mustache index b253948959b..3aa6d5bc421 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-impl-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-impl-header.mustache @@ -17,6 +17,8 @@ #include <{{classname}}.h> +#include + {{#imports}}{{{import}}} {{/imports}} diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache index 2545aca76aa..d815ce10ab7 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache @@ -10,24 +10,24 @@ namespace {{this}} { using namespace {{modelNamespace}}; {{classname}}::{{classname}}(Pistache::Address addr) - : httpEndpoint(std::make_shared(addr)) + : httpEndpoint(addr) { }; void {{classname}}::init(size_t thr = 2) { auto opts = Pistache::Http::Endpoint::options() .threads(thr) .flags(Pistache::Tcp::Options::InstallSignalHandler); - httpEndpoint->init(opts); + httpEndpoint.init(opts); setupRoutes(); } void {{classname}}::start() { - httpEndpoint->setHandler(router.handler()); - httpEndpoint->serve(); + httpEndpoint.setHandler(router.handler()); + httpEndpoint.serve(); } void {{classname}}::shutdown() { - httpEndpoint->shutdown(); + httpEndpoint.shutdown(); } void {{classname}}::setupRoutes() { diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-header.mustache index 7b095876a38..3efd24758f5 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-header.mustache @@ -45,7 +45,7 @@ public: /// {{^isNotContainer}}{{{dataType}}}& {{getter}}(); {{/isNotContainer}}{{#isNotContainer}}{{{dataType}}} {{getter}}() const; - void {{setter}}({{{dataType}}} value); + void {{setter}}({{{dataType}}} const{{^isPrimitiveType}}&{{/isPrimitiveType}} value); {{/isNotContainer}}{{^required}}bool {{nameInCamelCase}}IsSet() const; void unset{{name}}(); {{/required}} diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache index 49f3d1cea59..b2434df4670 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache @@ -84,7 +84,7 @@ void {{classname}}::fromJson(nlohmann::json& val) else { {{{items.datatype}}} newItem({{{items.defaultValue}}}); - newItem->fromJson(item); + newItem.fromJson(item); m_{{name}}.push_back( newItem ); } {{/items.isDateTime}}{{/items.isString}}{{/isPrimitiveType}} @@ -100,7 +100,7 @@ void {{classname}}::fromJson(nlohmann::json& val) {{/isDateTime}}{{^isDateTime}}if(!val["{{baseName}}"].is_null()) { {{{dataType}}} newItem({{{defaultValue}}}); - newItem->fromJson(val["{{baseName}}"]); + newItem.fromJson(val["{{baseName}}"]); {{setter}}( newItem ); } {{/isDateTime}}{{/isString}} @@ -119,7 +119,7 @@ void {{classname}}::fromJson(nlohmann::json& val) { return m_{{name}}; } -void {{classname}}::{{setter}}({{{dataType}}} value) +void {{classname}}::{{setter}}({{{dataType}}} const{{^isPrimitiveType}}&{{/isPrimitiveType}} value) { m_{{name}} = value; {{^required}}m_{{name}}IsSet = true;{{/required}} diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/modelbase-header.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/modelbase-header.mustache index 3c18cede5ec..2e43bb7b853 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/modelbase-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/modelbase-header.mustache @@ -28,13 +28,13 @@ public: virtual nlohmann::json toJson() const = 0; virtual void fromJson(nlohmann::json& json) = 0; - static std::string toJson( const std::string& value ); - static std::string toJson( const std::time_t& value ); - static int32_t toJson( int32_t value ); - static int64_t toJson( int64_t value ); - static double toJson( double value ); - static bool toJson( bool value ); - static nlohmann::json toJson( std::shared_ptr content ); + static std::string toJson( std::string const& value ); + static std::string toJson( std::time_t const& value ); + static int32_t toJson( int32_t const value ); + static int64_t toJson( int64_t const value ); + static double toJson( double const value ); + static bool toJson( bool const value ); + static nlohmann::json toJson(ModelBase const& content ); }; diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/modelbase-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/modelbase-source.mustache index f209bb68761..a5ec9406c42 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/modelbase-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/modelbase-source.mustache @@ -12,41 +12,41 @@ ModelBase::~ModelBase() { } -std::string ModelBase::toJson( const std::string& value ) +std::string ModelBase::toJson( std::string const& value ) { return value; } -std::string ModelBase::toJson( const std::time_t& value ) +std::string ModelBase::toJson( std::time_t const& value ) { char buf[sizeof "2011-10-08T07:07:09Z"]; strftime(buf, sizeof buf, "%FT%TZ", gmtime(&value)); return buf; } -int32_t ModelBase::toJson( int32_t value ) +int32_t ModelBase::toJson( int32_t const value ) { return value; } -int64_t ModelBase::toJson( int64_t value ) +int64_t ModelBase::toJson( int64_t const value ) { return value; } -double ModelBase::toJson( double value ) +double ModelBase::toJson( double const value ) { return value; } -bool ModelBase::toJson( bool value ) +bool ModelBase::toJson( bool const value ) { return value; } -nlohmann::json ModelBase::toJson( std::shared_ptr content ) +nlohmann::json ModelBase::toJson(ModelBase content ) { - return content.get() ? content->toJson() : nlohmann::json(); + return content.toJson(); } {{#modelNamespaceDeclarations}} diff --git a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION index 096bf47efe3..1c00c518154 100644 --- a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.0.2-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache/api/PetApi.cpp b/samples/server/petstore/cpp-pistache/api/PetApi.cpp index 90d1e18c168..c06c5fb1870 100644 --- a/samples/server/petstore/cpp-pistache/api/PetApi.cpp +++ b/samples/server/petstore/cpp-pistache/api/PetApi.cpp @@ -20,24 +20,24 @@ namespace api { using namespace org::openapitools::server::model; PetApi::PetApi(Pistache::Address addr) - : httpEndpoint(std::make_shared(addr)) + : httpEndpoint(addr) { }; void PetApi::init(size_t thr = 2) { auto opts = Pistache::Http::Endpoint::options() .threads(thr) .flags(Pistache::Tcp::Options::InstallSignalHandler); - httpEndpoint->init(opts); + httpEndpoint.init(opts); setupRoutes(); } void PetApi::start() { - httpEndpoint->setHandler(router.handler()); - httpEndpoint->serve(); + httpEndpoint.setHandler(router.handler()); + httpEndpoint.serve(); } void PetApi::shutdown() { - httpEndpoint->shutdown(); + httpEndpoint.shutdown(); } void PetApi::setupRoutes() { diff --git a/samples/server/petstore/cpp-pistache/api/PetApi.h b/samples/server/petstore/cpp-pistache/api/PetApi.h index c5950fa4fae..4300dec560c 100644 --- a/samples/server/petstore/cpp-pistache/api/PetApi.h +++ b/samples/server/petstore/cpp-pistache/api/PetApi.h @@ -24,6 +24,8 @@ #include #include +#include + #include "ApiResponse.h" #include "Pet.h" #include @@ -58,7 +60,7 @@ private: void upload_file_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void pet_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - std::shared_ptr httpEndpoint; + Pistache::Http::Endpoint httpEndpoint; Pistache::Rest::Router router; @@ -79,7 +81,7 @@ private: /// /// Pet id to delete /// (optional) - virtual void delete_pet(const int64_t &petId, const Optional &apiKey, Pistache::Http::ResponseWriter &response) = 0; + virtual void delete_pet(const int64_t &petId, const Pistache::Optional &apiKey, Pistache::Http::ResponseWriter &response) = 0; /// /// Finds Pets by status @@ -88,7 +90,7 @@ private: /// Multiple status values can be provided with comma separated strings /// /// Status values that need to be considered for filter - virtual void find_pets_by_status(const Optional &status, Pistache::Http::ResponseWriter &response) = 0; + virtual void find_pets_by_status(const Pistache::Optional &status, Pistache::Http::ResponseWriter &response) = 0; /// /// Finds Pets by tags @@ -97,7 +99,7 @@ private: /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Tags to filter by - virtual void find_pets_by_tags(const Optional &tags, Pistache::Http::ResponseWriter &response) = 0; + virtual void find_pets_by_tags(const Pistache::Optional &tags, Pistache::Http::ResponseWriter &response) = 0; /// /// Find pet by ID diff --git a/samples/server/petstore/cpp-pistache/api/StoreApi.cpp b/samples/server/petstore/cpp-pistache/api/StoreApi.cpp index ed8d2bb3568..eea7fe58ea9 100644 --- a/samples/server/petstore/cpp-pistache/api/StoreApi.cpp +++ b/samples/server/petstore/cpp-pistache/api/StoreApi.cpp @@ -20,24 +20,24 @@ namespace api { using namespace org::openapitools::server::model; StoreApi::StoreApi(Pistache::Address addr) - : httpEndpoint(std::make_shared(addr)) + : httpEndpoint(addr) { }; void StoreApi::init(size_t thr = 2) { auto opts = Pistache::Http::Endpoint::options() .threads(thr) .flags(Pistache::Tcp::Options::InstallSignalHandler); - httpEndpoint->init(opts); + httpEndpoint.init(opts); setupRoutes(); } void StoreApi::start() { - httpEndpoint->setHandler(router.handler()); - httpEndpoint->serve(); + httpEndpoint.setHandler(router.handler()); + httpEndpoint.serve(); } void StoreApi::shutdown() { - httpEndpoint->shutdown(); + httpEndpoint.shutdown(); } void StoreApi::setupRoutes() { diff --git a/samples/server/petstore/cpp-pistache/api/StoreApi.h b/samples/server/petstore/cpp-pistache/api/StoreApi.h index a243444e8fa..7068fcde620 100644 --- a/samples/server/petstore/cpp-pistache/api/StoreApi.h +++ b/samples/server/petstore/cpp-pistache/api/StoreApi.h @@ -24,6 +24,8 @@ #include #include +#include + #include "Order.h" #include #include @@ -54,7 +56,7 @@ private: void place_order_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void store_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - std::shared_ptr httpEndpoint; + Pistache::Http::Endpoint httpEndpoint; Pistache::Rest::Router router; diff --git a/samples/server/petstore/cpp-pistache/api/UserApi.cpp b/samples/server/petstore/cpp-pistache/api/UserApi.cpp index a2889d6a70a..eade7bdf8b7 100644 --- a/samples/server/petstore/cpp-pistache/api/UserApi.cpp +++ b/samples/server/petstore/cpp-pistache/api/UserApi.cpp @@ -20,24 +20,24 @@ namespace api { using namespace org::openapitools::server::model; UserApi::UserApi(Pistache::Address addr) - : httpEndpoint(std::make_shared(addr)) + : httpEndpoint(addr) { }; void UserApi::init(size_t thr = 2) { auto opts = Pistache::Http::Endpoint::options() .threads(thr) .flags(Pistache::Tcp::Options::InstallSignalHandler); - httpEndpoint->init(opts); + httpEndpoint.init(opts); setupRoutes(); } void UserApi::start() { - httpEndpoint->setHandler(router.handler()); - httpEndpoint->serve(); + httpEndpoint.setHandler(router.handler()); + httpEndpoint.serve(); } void UserApi::shutdown() { - httpEndpoint->shutdown(); + httpEndpoint.shutdown(); } void UserApi::setupRoutes() { diff --git a/samples/server/petstore/cpp-pistache/api/UserApi.h b/samples/server/petstore/cpp-pistache/api/UserApi.h index 623bf8b6508..08739d309ba 100644 --- a/samples/server/petstore/cpp-pistache/api/UserApi.h +++ b/samples/server/petstore/cpp-pistache/api/UserApi.h @@ -24,6 +24,8 @@ #include #include +#include + #include "User.h" #include #include @@ -58,7 +60,7 @@ private: void update_user_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void user_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - std::shared_ptr httpEndpoint; + Pistache::Http::Endpoint httpEndpoint; Pistache::Rest::Router router; @@ -78,7 +80,7 @@ private: /// /// /// List of user object - virtual void create_users_with_array_input(const std::vector> &user, Pistache::Http::ResponseWriter &response) = 0; + virtual void create_users_with_array_input(const std::vector &user, Pistache::Http::ResponseWriter &response) = 0; /// /// Creates list of users with given input array @@ -87,7 +89,7 @@ private: /// /// /// List of user object - virtual void create_users_with_list_input(const std::vector> &user, Pistache::Http::ResponseWriter &response) = 0; + virtual void create_users_with_list_input(const std::vector &user, Pistache::Http::ResponseWriter &response) = 0; /// /// Delete user @@ -115,7 +117,7 @@ private: /// /// The user name for login /// The password for login in clear text - virtual void login_user(const Optional &username, const Optional &password, Pistache::Http::ResponseWriter &response) = 0; + virtual void login_user(const Pistache::Optional &username, const Pistache::Optional &password, Pistache::Http::ResponseWriter &response) = 0; /// /// Logs out current logged in user session diff --git a/samples/server/petstore/cpp-pistache/impl/PetApiImpl.cpp b/samples/server/petstore/cpp-pistache/impl/PetApiImpl.cpp index 6e1a5d742f6..e987ecf2371 100644 --- a/samples/server/petstore/cpp-pistache/impl/PetApiImpl.cpp +++ b/samples/server/petstore/cpp-pistache/impl/PetApiImpl.cpp @@ -26,13 +26,13 @@ PetApiImpl::PetApiImpl(Pistache::Address addr) void PetApiImpl::add_pet(const std::shared_ptr &pet, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void PetApiImpl::delete_pet(const int64_t &petId, const Optional &apiKey, Pistache::Http::ResponseWriter &response) { +void PetApiImpl::delete_pet(const int64_t &petId, const Pistache::Optional &apiKey, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void PetApiImpl::find_pets_by_status(const Optional &status, Pistache::Http::ResponseWriter &response) { +void PetApiImpl::find_pets_by_status(const Pistache::Optional &status, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void PetApiImpl::find_pets_by_tags(const Optional &tags, Pistache::Http::ResponseWriter &response) { +void PetApiImpl::find_pets_by_tags(const Pistache::Optional &tags, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } void PetApiImpl::get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response) { diff --git a/samples/server/petstore/cpp-pistache/impl/PetApiImpl.h b/samples/server/petstore/cpp-pistache/impl/PetApiImpl.h index 020f8993a34..b83c14efb27 100644 --- a/samples/server/petstore/cpp-pistache/impl/PetApiImpl.h +++ b/samples/server/petstore/cpp-pistache/impl/PetApiImpl.h @@ -27,6 +27,8 @@ #include +#include + #include "ApiResponse.h" #include "Pet.h" #include @@ -44,9 +46,9 @@ public: ~PetApiImpl() { }; void add_pet(const std::shared_ptr &pet, Pistache::Http::ResponseWriter &response); - void delete_pet(const int64_t &petId, const Optional &apiKey, Pistache::Http::ResponseWriter &response); - void find_pets_by_status(const Optional &status, Pistache::Http::ResponseWriter &response); - void find_pets_by_tags(const Optional &tags, Pistache::Http::ResponseWriter &response); + void delete_pet(const int64_t &petId, const Pistache::Optional &apiKey, Pistache::Http::ResponseWriter &response); + void find_pets_by_status(const Pistache::Optional &status, Pistache::Http::ResponseWriter &response); + void find_pets_by_tags(const Pistache::Optional &tags, Pistache::Http::ResponseWriter &response); void get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response); void update_pet(const std::shared_ptr &pet, Pistache::Http::ResponseWriter &response); void update_pet_with_form(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response); diff --git a/samples/server/petstore/cpp-pistache/impl/StoreApiImpl.h b/samples/server/petstore/cpp-pistache/impl/StoreApiImpl.h index 3a7f42923ef..97574ec3ea0 100644 --- a/samples/server/petstore/cpp-pistache/impl/StoreApiImpl.h +++ b/samples/server/petstore/cpp-pistache/impl/StoreApiImpl.h @@ -27,6 +27,8 @@ #include +#include + #include "Order.h" #include #include diff --git a/samples/server/petstore/cpp-pistache/impl/UserApiImpl.cpp b/samples/server/petstore/cpp-pistache/impl/UserApiImpl.cpp index c764c5821da..6d5ce9c5aaf 100644 --- a/samples/server/petstore/cpp-pistache/impl/UserApiImpl.cpp +++ b/samples/server/petstore/cpp-pistache/impl/UserApiImpl.cpp @@ -26,10 +26,10 @@ UserApiImpl::UserApiImpl(Pistache::Address addr) void UserApiImpl::create_user(const std::shared_ptr &user, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void UserApiImpl::create_users_with_array_input(const std::vector> &user, Pistache::Http::ResponseWriter &response) { +void UserApiImpl::create_users_with_array_input(const std::vector &user, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void UserApiImpl::create_users_with_list_input(const std::vector> &user, Pistache::Http::ResponseWriter &response) { +void UserApiImpl::create_users_with_list_input(const std::vector &user, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } void UserApiImpl::delete_user(const std::string &username, Pistache::Http::ResponseWriter &response) { @@ -38,7 +38,7 @@ void UserApiImpl::delete_user(const std::string &username, Pistache::Http::Respo void UserApiImpl::get_user_by_name(const std::string &username, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } -void UserApiImpl::login_user(const Optional &username, const Optional &password, Pistache::Http::ResponseWriter &response) { +void UserApiImpl::login_user(const Pistache::Optional &username, const Pistache::Optional &password, Pistache::Http::ResponseWriter &response) { response.send(Pistache::Http::Code::Ok, "Do some magic\n"); } void UserApiImpl::logout_user(Pistache::Http::ResponseWriter &response) { diff --git a/samples/server/petstore/cpp-pistache/impl/UserApiImpl.h b/samples/server/petstore/cpp-pistache/impl/UserApiImpl.h index 1569be6b1d4..e719edba141 100644 --- a/samples/server/petstore/cpp-pistache/impl/UserApiImpl.h +++ b/samples/server/petstore/cpp-pistache/impl/UserApiImpl.h @@ -27,6 +27,8 @@ #include +#include + #include "User.h" #include #include @@ -44,11 +46,11 @@ public: ~UserApiImpl() { }; void create_user(const std::shared_ptr &user, Pistache::Http::ResponseWriter &response); - void create_users_with_array_input(const std::vector> &user, Pistache::Http::ResponseWriter &response); - void create_users_with_list_input(const std::vector> &user, Pistache::Http::ResponseWriter &response); + void create_users_with_array_input(const std::vector &user, Pistache::Http::ResponseWriter &response); + void create_users_with_list_input(const std::vector &user, Pistache::Http::ResponseWriter &response); void delete_user(const std::string &username, Pistache::Http::ResponseWriter &response); void get_user_by_name(const std::string &username, Pistache::Http::ResponseWriter &response); - void login_user(const Optional &username, const Optional &password, Pistache::Http::ResponseWriter &response); + void login_user(const Pistache::Optional &username, const Pistache::Optional &password, Pistache::Http::ResponseWriter &response); void logout_user(Pistache::Http::ResponseWriter &response); void update_user(const std::string &username, const std::shared_ptr &user, Pistache::Http::ResponseWriter &response); diff --git a/samples/server/petstore/cpp-pistache/model/ApiResponse.cpp b/samples/server/petstore/cpp-pistache/model/ApiResponse.cpp index 5cab25713d9..bb07343a1b4 100644 --- a/samples/server/petstore/cpp-pistache/model/ApiResponse.cpp +++ b/samples/server/petstore/cpp-pistache/model/ApiResponse.cpp @@ -83,7 +83,7 @@ int32_t ApiResponse::getCode() const { return m_Code; } -void ApiResponse::setCode(int32_t value) +void ApiResponse::setCode(int32_t const value) { m_Code = value; m_CodeIsSet = true; @@ -100,7 +100,7 @@ std::string ApiResponse::getType() const { return m_Type; } -void ApiResponse::setType(std::string value) +void ApiResponse::setType(std::string const& value) { m_Type = value; m_TypeIsSet = true; @@ -117,7 +117,7 @@ std::string ApiResponse::getMessage() const { return m_Message; } -void ApiResponse::setMessage(std::string value) +void ApiResponse::setMessage(std::string const& value) { m_Message = value; m_MessageIsSet = true; diff --git a/samples/server/petstore/cpp-pistache/model/ApiResponse.h b/samples/server/petstore/cpp-pistache/model/ApiResponse.h index dbdbf29b826..51c96e3838c 100644 --- a/samples/server/petstore/cpp-pistache/model/ApiResponse.h +++ b/samples/server/petstore/cpp-pistache/model/ApiResponse.h @@ -53,21 +53,21 @@ public: /// /// int32_t getCode() const; - void setCode(int32_t value); + void setCode(int32_t const value); bool codeIsSet() const; void unsetCode(); /// /// /// std::string getType() const; - void setType(std::string value); + void setType(std::string const& value); bool typeIsSet() const; void unsetType(); /// /// /// std::string getMessage() const; - void setMessage(std::string value); + void setMessage(std::string const& value); bool messageIsSet() const; void unsetMessage(); diff --git a/samples/server/petstore/cpp-pistache/model/Category.cpp b/samples/server/petstore/cpp-pistache/model/Category.cpp index d528f343d7e..a1d24fdab57 100644 --- a/samples/server/petstore/cpp-pistache/model/Category.cpp +++ b/samples/server/petstore/cpp-pistache/model/Category.cpp @@ -72,7 +72,7 @@ int64_t Category::getId() const { return m_Id; } -void Category::setId(int64_t value) +void Category::setId(int64_t const value) { m_Id = value; m_IdIsSet = true; @@ -89,7 +89,7 @@ std::string Category::getName() const { return m_Name; } -void Category::setName(std::string value) +void Category::setName(std::string const& value) { m_Name = value; m_NameIsSet = true; diff --git a/samples/server/petstore/cpp-pistache/model/Category.h b/samples/server/petstore/cpp-pistache/model/Category.h index 6e3885e2d73..19b951a44e7 100644 --- a/samples/server/petstore/cpp-pistache/model/Category.h +++ b/samples/server/petstore/cpp-pistache/model/Category.h @@ -53,14 +53,14 @@ public: /// /// int64_t getId() const; - void setId(int64_t value); + void setId(int64_t const value); bool idIsSet() const; void unsetId(); /// /// /// std::string getName() const; - void setName(std::string value); + void setName(std::string const& value); bool nameIsSet() const; void unsetName(); diff --git a/samples/server/petstore/cpp-pistache/model/ModelBase.cpp b/samples/server/petstore/cpp-pistache/model/ModelBase.cpp index dca7f7198ff..d8c2437c6ff 100644 --- a/samples/server/petstore/cpp-pistache/model/ModelBase.cpp +++ b/samples/server/petstore/cpp-pistache/model/ModelBase.cpp @@ -23,41 +23,41 @@ ModelBase::~ModelBase() { } -std::string ModelBase::toJson( const std::string& value ) +std::string ModelBase::toJson( std::string const& value ) { return value; } -std::string ModelBase::toJson( const std::time_t& value ) +std::string ModelBase::toJson( std::time_t const& value ) { char buf[sizeof "2011-10-08T07:07:09Z"]; strftime(buf, sizeof buf, "%FT%TZ", gmtime(&value)); return buf; } -int32_t ModelBase::toJson( int32_t value ) +int32_t ModelBase::toJson( int32_t const value ) { return value; } -int64_t ModelBase::toJson( int64_t value ) +int64_t ModelBase::toJson( int64_t const value ) { return value; } -double ModelBase::toJson( double value ) +double ModelBase::toJson( double const value ) { return value; } -bool ModelBase::toJson( bool value ) +bool ModelBase::toJson( bool const value ) { return value; } -nlohmann::json ModelBase::toJson( std::shared_ptr content ) +nlohmann::json ModelBase::toJson(ModelBase content ) { - return content.get() ? content->toJson() : nlohmann::json(); + return content.toJson(); } } diff --git a/samples/server/petstore/cpp-pistache/model/ModelBase.h b/samples/server/petstore/cpp-pistache/model/ModelBase.h index 30918431987..6b5589472f0 100644 --- a/samples/server/petstore/cpp-pistache/model/ModelBase.h +++ b/samples/server/petstore/cpp-pistache/model/ModelBase.h @@ -39,13 +39,13 @@ public: virtual nlohmann::json toJson() const = 0; virtual void fromJson(nlohmann::json& json) = 0; - static std::string toJson( const std::string& value ); - static std::string toJson( const std::time_t& value ); - static int32_t toJson( int32_t value ); - static int64_t toJson( int64_t value ); - static double toJson( double value ); - static bool toJson( bool value ); - static nlohmann::json toJson( std::shared_ptr content ); + static std::string toJson( std::string const& value ); + static std::string toJson( std::time_t const& value ); + static int32_t toJson( int32_t const value ); + static int64_t toJson( int64_t const value ); + static double toJson( double const value ); + static bool toJson( bool const value ); + static nlohmann::json toJson(ModelBase const& content ); }; diff --git a/samples/server/petstore/cpp-pistache/model/Order.cpp b/samples/server/petstore/cpp-pistache/model/Order.cpp index 712705e313e..fb3fde19d3a 100644 --- a/samples/server/petstore/cpp-pistache/model/Order.cpp +++ b/samples/server/petstore/cpp-pistache/model/Order.cpp @@ -113,7 +113,7 @@ int64_t Order::getId() const { return m_Id; } -void Order::setId(int64_t value) +void Order::setId(int64_t const value) { m_Id = value; m_IdIsSet = true; @@ -130,7 +130,7 @@ int64_t Order::getPetId() const { return m_PetId; } -void Order::setPetId(int64_t value) +void Order::setPetId(int64_t const value) { m_PetId = value; m_PetIdIsSet = true; @@ -147,7 +147,7 @@ int32_t Order::getQuantity() const { return m_Quantity; } -void Order::setQuantity(int32_t value) +void Order::setQuantity(int32_t const value) { m_Quantity = value; m_QuantityIsSet = true; @@ -164,7 +164,7 @@ std::string Order::getShipDate() const { return m_ShipDate; } -void Order::setShipDate(std::string value) +void Order::setShipDate(std::string const& value) { m_ShipDate = value; m_ShipDateIsSet = true; @@ -181,7 +181,7 @@ std::string Order::getStatus() const { return m_Status; } -void Order::setStatus(std::string value) +void Order::setStatus(std::string const& value) { m_Status = value; m_StatusIsSet = true; @@ -198,7 +198,7 @@ bool Order::isComplete() const { return m_Complete; } -void Order::setComplete(bool value) +void Order::setComplete(bool const value) { m_Complete = value; m_CompleteIsSet = true; diff --git a/samples/server/petstore/cpp-pistache/model/Order.h b/samples/server/petstore/cpp-pistache/model/Order.h index bc577671554..548f9de0614 100644 --- a/samples/server/petstore/cpp-pistache/model/Order.h +++ b/samples/server/petstore/cpp-pistache/model/Order.h @@ -53,42 +53,42 @@ public: /// /// int64_t getId() const; - void setId(int64_t value); + void setId(int64_t const value); bool idIsSet() const; void unsetId(); /// /// /// int64_t getPetId() const; - void setPetId(int64_t value); + void setPetId(int64_t const value); bool petIdIsSet() const; void unsetPetId(); /// /// /// int32_t getQuantity() const; - void setQuantity(int32_t value); + void setQuantity(int32_t const value); bool quantityIsSet() const; void unsetQuantity(); /// /// /// std::string getShipDate() const; - void setShipDate(std::string value); + void setShipDate(std::string const& value); bool shipDateIsSet() const; void unsetShipDate(); /// /// Order Status /// std::string getStatus() const; - void setStatus(std::string value); + void setStatus(std::string const& value); bool statusIsSet() const; void unsetStatus(); /// /// /// bool isComplete() const; - void setComplete(bool value); + void setComplete(bool const value); bool completeIsSet() const; void unsetComplete(); diff --git a/samples/server/petstore/cpp-pistache/model/Pet.cpp b/samples/server/petstore/cpp-pistache/model/Pet.cpp index 58447515d42..2c200a8db2c 100644 --- a/samples/server/petstore/cpp-pistache/model/Pet.cpp +++ b/samples/server/petstore/cpp-pistache/model/Pet.cpp @@ -91,8 +91,8 @@ void Pet::fromJson(nlohmann::json& val) { if(!val["category"].is_null()) { - std::shared_ptr newItem(new Category()); - newItem->fromJson(val["category"]); + Category newItem(Category()); + newItem.fromJson(val["category"]); setCategory( newItem ); } @@ -117,12 +117,12 @@ void Pet::fromJson(nlohmann::json& val) if(item.is_null()) { - m_Tags.push_back( std::shared_ptr(nullptr) ); + m_Tags.push_back( Tag(nullptr) ); } else { - std::shared_ptr newItem(new Tag()); - newItem->fromJson(item); + Tag newItem(Tag()); + newItem.fromJson(item); m_Tags.push_back( newItem ); } @@ -142,7 +142,7 @@ int64_t Pet::getId() const { return m_Id; } -void Pet::setId(int64_t value) +void Pet::setId(int64_t const value) { m_Id = value; m_IdIsSet = true; @@ -155,11 +155,11 @@ void Pet::unsetId() { m_IdIsSet = false; } -std::shared_ptr Pet::getCategory() const +Category Pet::getCategory() const { return m_Category; } -void Pet::setCategory(std::shared_ptr value) +void Pet::setCategory(Category const& value) { m_Category = value; m_CategoryIsSet = true; @@ -176,7 +176,7 @@ std::string Pet::getName() const { return m_Name; } -void Pet::setName(std::string value) +void Pet::setName(std::string const& value) { m_Name = value; @@ -185,7 +185,7 @@ std::vector& Pet::getPhotoUrls() { return m_PhotoUrls; } -std::vector>& Pet::getTags() +std::vector& Pet::getTags() { return m_Tags; } @@ -201,7 +201,7 @@ std::string Pet::getStatus() const { return m_Status; } -void Pet::setStatus(std::string value) +void Pet::setStatus(std::string const& value) { m_Status = value; m_StatusIsSet = true; diff --git a/samples/server/petstore/cpp-pistache/model/Pet.h b/samples/server/petstore/cpp-pistache/model/Pet.h index d0d84c4aeac..4117dcf468d 100644 --- a/samples/server/petstore/cpp-pistache/model/Pet.h +++ b/samples/server/petstore/cpp-pistache/model/Pet.h @@ -56,21 +56,21 @@ public: /// /// int64_t getId() const; - void setId(int64_t value); + void setId(int64_t const value); bool idIsSet() const; void unsetId(); /// /// /// - std::shared_ptr getCategory() const; - void setCategory(std::shared_ptr value); + Category getCategory() const; + void setCategory(Category const& value); bool categoryIsSet() const; void unsetCategory(); /// /// /// std::string getName() const; - void setName(std::string value); + void setName(std::string const& value); /// /// /// @@ -78,27 +78,27 @@ public: /// /// /// - std::vector>& getTags(); + std::vector& getTags(); bool tagsIsSet() const; void unsetTags(); /// /// pet status in the store /// std::string getStatus() const; - void setStatus(std::string value); + void setStatus(std::string const& value); bool statusIsSet() const; void unsetStatus(); protected: int64_t m_Id; bool m_IdIsSet; - std::shared_ptr m_Category; + Category m_Category; bool m_CategoryIsSet; std::string m_Name; std::vector m_PhotoUrls; - std::vector> m_Tags; + std::vector m_Tags; bool m_TagsIsSet; std::string m_Status; bool m_StatusIsSet; diff --git a/samples/server/petstore/cpp-pistache/model/Tag.cpp b/samples/server/petstore/cpp-pistache/model/Tag.cpp index 9091c15cfd9..1cbc344ba52 100644 --- a/samples/server/petstore/cpp-pistache/model/Tag.cpp +++ b/samples/server/petstore/cpp-pistache/model/Tag.cpp @@ -72,7 +72,7 @@ int64_t Tag::getId() const { return m_Id; } -void Tag::setId(int64_t value) +void Tag::setId(int64_t const value) { m_Id = value; m_IdIsSet = true; @@ -89,7 +89,7 @@ std::string Tag::getName() const { return m_Name; } -void Tag::setName(std::string value) +void Tag::setName(std::string const& value) { m_Name = value; m_NameIsSet = true; diff --git a/samples/server/petstore/cpp-pistache/model/Tag.h b/samples/server/petstore/cpp-pistache/model/Tag.h index 08a4fec456d..1b5d79e31c9 100644 --- a/samples/server/petstore/cpp-pistache/model/Tag.h +++ b/samples/server/petstore/cpp-pistache/model/Tag.h @@ -53,14 +53,14 @@ public: /// /// int64_t getId() const; - void setId(int64_t value); + void setId(int64_t const value); bool idIsSet() const; void unsetId(); /// /// /// std::string getName() const; - void setName(std::string value); + void setName(std::string const& value); bool nameIsSet() const; void unsetName(); diff --git a/samples/server/petstore/cpp-pistache/model/User.cpp b/samples/server/petstore/cpp-pistache/model/User.cpp index 88e159c196f..e0f4defae3e 100644 --- a/samples/server/petstore/cpp-pistache/model/User.cpp +++ b/samples/server/petstore/cpp-pistache/model/User.cpp @@ -137,7 +137,7 @@ int64_t User::getId() const { return m_Id; } -void User::setId(int64_t value) +void User::setId(int64_t const value) { m_Id = value; m_IdIsSet = true; @@ -154,7 +154,7 @@ std::string User::getUsername() const { return m_Username; } -void User::setUsername(std::string value) +void User::setUsername(std::string const& value) { m_Username = value; m_UsernameIsSet = true; @@ -171,7 +171,7 @@ std::string User::getFirstName() const { return m_FirstName; } -void User::setFirstName(std::string value) +void User::setFirstName(std::string const& value) { m_FirstName = value; m_FirstNameIsSet = true; @@ -188,7 +188,7 @@ std::string User::getLastName() const { return m_LastName; } -void User::setLastName(std::string value) +void User::setLastName(std::string const& value) { m_LastName = value; m_LastNameIsSet = true; @@ -205,7 +205,7 @@ std::string User::getEmail() const { return m_Email; } -void User::setEmail(std::string value) +void User::setEmail(std::string const& value) { m_Email = value; m_EmailIsSet = true; @@ -222,7 +222,7 @@ std::string User::getPassword() const { return m_Password; } -void User::setPassword(std::string value) +void User::setPassword(std::string const& value) { m_Password = value; m_PasswordIsSet = true; @@ -239,7 +239,7 @@ std::string User::getPhone() const { return m_Phone; } -void User::setPhone(std::string value) +void User::setPhone(std::string const& value) { m_Phone = value; m_PhoneIsSet = true; @@ -256,7 +256,7 @@ int32_t User::getUserStatus() const { return m_UserStatus; } -void User::setUserStatus(int32_t value) +void User::setUserStatus(int32_t const value) { m_UserStatus = value; m_UserStatusIsSet = true; diff --git a/samples/server/petstore/cpp-pistache/model/User.h b/samples/server/petstore/cpp-pistache/model/User.h index e8dab49531d..b9a53345866 100644 --- a/samples/server/petstore/cpp-pistache/model/User.h +++ b/samples/server/petstore/cpp-pistache/model/User.h @@ -53,56 +53,56 @@ public: /// /// int64_t getId() const; - void setId(int64_t value); + void setId(int64_t const value); bool idIsSet() const; void unsetId(); /// /// /// std::string getUsername() const; - void setUsername(std::string value); + void setUsername(std::string const& value); bool usernameIsSet() const; void unsetUsername(); /// /// /// std::string getFirstName() const; - void setFirstName(std::string value); + void setFirstName(std::string const& value); bool firstNameIsSet() const; void unsetFirstName(); /// /// /// std::string getLastName() const; - void setLastName(std::string value); + void setLastName(std::string const& value); bool lastNameIsSet() const; void unsetLastName(); /// /// /// std::string getEmail() const; - void setEmail(std::string value); + void setEmail(std::string const& value); bool emailIsSet() const; void unsetEmail(); /// /// /// std::string getPassword() const; - void setPassword(std::string value); + void setPassword(std::string const& value); bool passwordIsSet() const; void unsetPassword(); /// /// /// std::string getPhone() const; - void setPhone(std::string value); + void setPhone(std::string const& value); bool phoneIsSet() const; void unsetPhone(); /// /// User Status /// int32_t getUserStatus() const; - void setUserStatus(int32_t value); + void setUserStatus(int32_t const value); bool userStatusIsSet() const; void unsetUserStatus(); From 8f4df45fb4d3432e4b44f28ba7f944253e73a02c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bresson?= Date: Fri, 22 Jun 2018 10:44:14 +0200 Subject: [PATCH 28/35] Consider ComposedSchema in DefaultCodegen#fromRequestBody(..) (#358) --- .../openapitools/codegen/DefaultCodegen.java | 2 +- .../codegen/java/JavaClientCodegenTest.java | 16 ++++++ .../test/resources/2_0/composed-allof.yaml | 53 +++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 modules/openapi-generator/src/test/resources/2_0/composed-allof.yaml 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 7c37731bc63..2a5a3b7f43e 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 @@ -4226,7 +4226,7 @@ public class DefaultCodegen implements CodegenConfig { codegenProperty = codegenProperty.items; } - } else if (ModelUtils.isObjectSchema(schema)) { + } else if (ModelUtils.isObjectSchema(schema) || ModelUtils.isComposedSchema(schema)) { CodegenModel codegenModel = null; if (StringUtils.isNotBlank(name)) { schema.setName(name); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index 3b36db9a7b7..35c63515137 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -19,6 +19,9 @@ package org.openapitools.codegen.java; import com.google.common.collect.ImmutableMap; +import io.swagger.parser.OpenAPIParser; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Content; @@ -28,6 +31,7 @@ import io.swagger.v3.oas.models.media.ObjectSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; import io.swagger.v3.oas.models.parameters.RequestBody; +import io.swagger.v3.parser.core.models.ParseOptions; import io.swagger.v3.parser.util.SchemaTypeUtil; import org.openapitools.codegen.CodegenConstants; @@ -37,6 +41,7 @@ import org.openapitools.codegen.CodegenModelType; import org.openapitools.codegen.CodegenOperation; import org.openapitools.codegen.CodegenParameter; import org.openapitools.codegen.languages.JavaClientCodegen; +import org.openapitools.codegen.utils.ModelUtils; import org.testng.Assert; import org.testng.annotations.Test; @@ -305,6 +310,17 @@ public class JavaClientCodegenTest { Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.zzzzzzz.mmmmm"); } + @Test + public void testGetSchemaTypeWithComposedSchemaWithAllOf() { + final OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/2_0/composed-allof.yaml", null, new ParseOptions()).getOpenAPI(); + final JavaClientCodegen codegen = new JavaClientCodegen(); + + Operation operation = openAPI.getPaths().get("/ping").getPost(); + CodegenOperation co = codegen.fromOperation("/ping", "POST", operation, ModelUtils.getSchemas(openAPI), openAPI); + Assert.assertEquals(co.allParams.size(), 1); + Assert.assertEquals(co.allParams.get(0).baseType, "MessageEventCoreWithTimeListEntries"); + } + private CodegenParameter createPathParam(String name) { CodegenParameter codegenParameter = createStringParam(name); codegenParameter.isPathParam = true; diff --git a/modules/openapi-generator/src/test/resources/2_0/composed-allof.yaml b/modules/openapi-generator/src/test/resources/2_0/composed-allof.yaml new file mode 100644 index 00000000000..579c2f796b4 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/2_0/composed-allof.yaml @@ -0,0 +1,53 @@ +swagger: "2.0" +info: + version: "2" + title: "Test API" +basePath: "/xx2" +consumes: +- "application/json" +produces: +- "application/json" +paths: + /ping: + post: + tags: + - Messaging + summary: Add a message event to the given message calendar + operationId: addMessageEventToMessageCalendar + parameters: + - in: body + name: new-message-event + required: true + schema: + $ref: "#/definitions/MessageEventCoreWithTimeListEntries" + responses: + 200: + description: OK +definitions: + MessageEventCoreWithTimeListEntries: + type: object + description: "Base of a message event with Time List entries" + allOf: + - $ref: "#/definitions/MessageEventCore" + - type: object + required: + - timeListEntries + properties: + timeListEntries: + type: array + items: + $ref: "#/definitions/TimeListEntry" + MessageEventCore: + type: object + properties: + id: + type: integer + message: + type: string + TimeListEntry: + type: object + properties: + p1: + type: string + p2: + type: string \ No newline at end of file From 845df89e9511e8b972042a4376230d3d9f974659 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 23 Jun 2018 10:32:30 +0800 Subject: [PATCH 29/35] disable rust server test due to lint error (#379) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ad25e85ef04..2ed6942495b 100644 --- a/pom.xml +++ b/pom.xml @@ -958,7 +958,7 @@ samples/client/petstore/typescript-angular-v4.3/npm samples/client/petstore/ruby - samples/server/petstore/rust-server + From 36f4452351099efcae3fa3bcba883b1c6276ca52 Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Fri, 22 Jun 2018 23:10:38 -0400 Subject: [PATCH 30/35] [Slim] Upgrade API server integration tests to use Fake Petstore spec (#354) * [Slim] Shell script points to petstore-with-fake-endpoints-models-for-testing.yaml. Slim init and new models has been generated. * [Slim] Bugfix. Special value */* in opperation produces escaped to avoid PHP syntax errors. * [Slim] Add own private static final LOGGER * [Slim] Bugfix. toModelName method copied from PHPClient codegen which handles Fake Petstore spec much better. * [Slim] Sort operations in supporting files data to avoid shadowing static routes. * [Slim] Mustache index.php update. Params parsing enhanced. * [Slim] Tiny cleanup. Unnecessary empty space removed. * [Slim] Security fix. toOperationId method copied from PhpClientCodegen. * [Slim] Bugfix. formData params parsing restored. * [Slim] Proper .gitignore added to PhpSlimServerCodegen. Vendor folder with all dependencies removed to keep repo more clean. * [Slim] Slim dependency update to 3.10.0. Few test fake endpoints fixed by this upgrade. --- bin/php-slim-petstore-server.sh | 2 +- bin/windows/php-slim-petstore-server.bat | 2 +- .../languages/PhpSlimServerCodegen.java | 95 +- .../src/main/resources/slim/.gitignore | 6 + .../src/main/resources/slim/index.mustache | 45 +- .../petstore-security-test/slim/.gitignore | 6 + .../slim/.openapi-generator/VERSION | 2 +- .../petstore-security-test/slim/composer.lock | 125 +- .../petstore-security-test/slim/index.php | 14 +- .../Models/{Return.php => ModelReturn.php} | 6 +- .../slim/vendor/autoload.php | 7 - .../slim/vendor/composer/ClassLoader.php | 413 ------ .../slim/vendor/composer/LICENSE | 21 - .../vendor/composer/autoload_classmap.php | 9 - .../slim/vendor/composer/autoload_files.php | 10 - .../vendor/composer/autoload_namespaces.php | 10 - .../slim/vendor/composer/autoload_psr4.php | 13 - .../slim/vendor/composer/autoload_real.php | 59 - .../slim/vendor/composer/installed.json | 247 ---- .../container-interop/.gitignore | 3 - .../container-interop/LICENSE | 20 - .../container-interop/README.md | 85 -- .../container-interop/composer.json | 11 - .../docs/ContainerInterface-meta.md | 114 -- .../docs/ContainerInterface.md | 153 --- .../docs/Delegate-lookup-meta.md | 259 ---- .../container-interop/docs/Delegate-lookup.md | 60 - .../docs/images/interoperating_containers.png | Bin 36121 -> 0 bytes .../docs/images/priority.png | Bin 23031 -> 0 bytes .../docs/images/side_by_side_containers.png | Bin 22624 -> 0 bytes .../Interop/Container/ContainerInterface.php | 37 - .../Exception/ContainerException.php | 13 - .../Container/Exception/NotFoundException.php | 13 - .../slim/vendor/nikic/fast-route/.hhconfig | 1 - .../slim/vendor/nikic/fast-route/.travis.yml | 12 - .../vendor/nikic/fast-route/FastRoute.hhi | 126 -- .../slim/vendor/nikic/fast-route/LICENSE | 31 - .../slim/vendor/nikic/fast-route/README.md | 273 ---- .../vendor/nikic/fast-route/composer.json | 21 - .../slim/vendor/nikic/fast-route/phpunit.xml | 24 - .../fast-route/src/BadRouteException.php | 6 - .../nikic/fast-route/src/DataGenerator.php | 25 - .../src/DataGenerator/CharCountBased.php | 28 - .../src/DataGenerator/GroupCountBased.php | 28 - .../src/DataGenerator/GroupPosBased.php | 25 - .../src/DataGenerator/MarkBased.php | 25 - .../src/DataGenerator/RegexBasedAbstract.php | 144 -- .../nikic/fast-route/src/Dispatcher.php | 25 - .../src/Dispatcher/CharCountBased.php | 28 - .../src/Dispatcher/GroupCountBased.php | 28 - .../src/Dispatcher/GroupPosBased.php | 30 - .../fast-route/src/Dispatcher/MarkBased.php | 28 - .../src/Dispatcher/RegexBasedAbstract.php | 80 -- .../vendor/nikic/fast-route/src/Route.php | 38 - .../nikic/fast-route/src/RouteCollector.php | 46 - .../nikic/fast-route/src/RouteParser.php | 36 - .../nikic/fast-route/src/RouteParser/Std.php | 81 -- .../vendor/nikic/fast-route/src/bootstrap.php | 12 - .../vendor/nikic/fast-route/src/functions.php | 70 - .../test/Dispatcher/CharCountBasedTest.php | 13 - .../test/Dispatcher/DispatcherTest.php | 561 -------- .../test/Dispatcher/GroupCountBasedTest.php | 13 - .../test/Dispatcher/GroupPosBasedTest.php | 13 - .../test/Dispatcher/MarkBasedTest.php | 20 - .../HackTypechecker/HackTypecheckerTest.php | 39 - .../HackTypechecker/fixtures/all_options.php | 29 - .../fixtures/empty_options.php | 11 - .../HackTypechecker/fixtures/no_options.php | 11 - .../fast-route/test/RouteParser/StdTest.php | 147 --- .../nikic/fast-route/test/bootstrap.php | 11 - .../slim/vendor/pimple/pimple/.gitignore | 3 - .../slim/vendor/pimple/pimple/.travis.yml | 32 - .../slim/vendor/pimple/pimple/CHANGELOG | 35 - .../slim/vendor/pimple/pimple/LICENSE | 19 - .../slim/vendor/pimple/pimple/README.rst | 201 --- .../slim/vendor/pimple/pimple/composer.json | 25 - .../pimple/pimple/ext/pimple/.gitignore | 30 - .../vendor/pimple/pimple/ext/pimple/README.md | 12 - .../vendor/pimple/pimple/ext/pimple/config.m4 | 63 - .../pimple/pimple/ext/pimple/config.w32 | 13 - .../pimple/pimple/ext/pimple/php_pimple.h | 121 -- .../vendor/pimple/pimple/ext/pimple/pimple.c | 922 ------------- .../pimple/pimple/ext/pimple/pimple_compat.h | 81 -- .../pimple/pimple/ext/pimple/tests/001.phpt | 45 - .../pimple/pimple/ext/pimple/tests/002.phpt | 15 - .../pimple/pimple/ext/pimple/tests/003.phpt | 16 - .../pimple/pimple/ext/pimple/tests/004.phpt | 30 - .../pimple/pimple/ext/pimple/tests/005.phpt | 27 - .../pimple/pimple/ext/pimple/tests/006.phpt | 51 - .../pimple/pimple/ext/pimple/tests/007.phpt | 22 - .../pimple/pimple/ext/pimple/tests/008.phpt | 29 - .../pimple/pimple/ext/pimple/tests/009.phpt | 13 - .../pimple/pimple/ext/pimple/tests/010.phpt | 45 - .../pimple/pimple/ext/pimple/tests/011.phpt | 19 - .../pimple/pimple/ext/pimple/tests/012.phpt | 28 - .../pimple/pimple/ext/pimple/tests/013.phpt | 33 - .../pimple/pimple/ext/pimple/tests/014.phpt | 30 - .../pimple/pimple/ext/pimple/tests/015.phpt | 17 - .../pimple/pimple/ext/pimple/tests/016.phpt | 24 - .../pimple/pimple/ext/pimple/tests/017.phpt | 17 - .../pimple/pimple/ext/pimple/tests/017_1.phpt | 17 - .../pimple/pimple/ext/pimple/tests/018.phpt | 23 - .../pimple/pimple/ext/pimple/tests/019.phpt | 18 - .../pimple/pimple/ext/pimple/tests/bench.phpb | 51 - .../pimple/ext/pimple/tests/bench_shared.phpb | 25 - .../vendor/pimple/pimple/phpunit.xml.dist | 14 - .../pimple/pimple/src/Pimple/Container.php | 282 ---- .../src/Pimple/ServiceProviderInterface.php | 46 - .../src/Pimple/Tests/Fixtures/Invokable.php | 38 - .../Pimple/Tests/Fixtures/NonInvokable.php | 34 - .../Tests/Fixtures/PimpleServiceProvider.php | 54 - .../src/Pimple/Tests/Fixtures/Service.php | 35 - .../PimpleServiceProviderInterfaceTest.php | 76 -- .../pimple/src/Pimple/Tests/PimpleTest.php | 440 ------- .../slim/vendor/psr/http-message/LICENSE | 19 - .../slim/vendor/psr/http-message/README.md | 13 - .../vendor/psr/http-message/composer.json | 25 - .../psr/http-message/src/MessageInterface.php | 187 --- .../psr/http-message/src/RequestInterface.php | 129 -- .../http-message/src/ResponseInterface.php | 68 - .../src/ServerRequestInterface.php | 261 ---- .../psr/http-message/src/StreamInterface.php | 158 --- .../src/UploadedFileInterface.php | 123 -- .../psr/http-message/src/UriInterface.php | 323 ----- .../slim/vendor/slim/slim/CONTRIBUTING.md | 20 - .../slim/vendor/slim/slim/LICENSE.md | 19 - .../slim/vendor/slim/slim/README.md | 84 -- .../slim/vendor/slim/slim/Slim/App.php | 644 --------- .../slim/slim/Slim/CallableResolver.php | 87 -- .../slim/Slim/CallableResolverAwareTrait.php | 47 - .../slim/vendor/slim/slim/Slim/Collection.php | 204 --- .../slim/vendor/slim/slim/Slim/Container.php | 181 --- .../slim/Slim/DefaultServicesProvider.php | 204 --- .../slim/slim/Slim/DeferredCallable.php | 39 - .../Slim/Exception/ContainerException.php | 20 - .../ContainerValueNotFoundException.php | 20 - .../Exception/MethodNotAllowedException.php | 45 - .../slim/Slim/Exception/NotFoundException.php | 14 - .../slim/Slim/Exception/SlimException.php | 69 - .../slim/slim/Slim/Handlers/AbstractError.php | 99 -- .../slim/Slim/Handlers/AbstractHandler.php | 59 - .../vendor/slim/slim/Slim/Handlers/Error.php | 206 --- .../slim/slim/Slim/Handlers/NotAllowed.php | 147 --- .../slim/slim/Slim/Handlers/NotFound.php | 126 -- .../slim/slim/Slim/Handlers/PhpError.php | 205 --- .../Handlers/Strategies/RequestResponse.php | 43 - .../Strategies/RequestResponseArgs.php | 42 - .../slim/vendor/slim/slim/Slim/Http/Body.php | 22 - .../vendor/slim/slim/Slim/Http/Cookies.php | 195 --- .../slim/slim/Slim/Http/Environment.php | 52 - .../vendor/slim/slim/Slim/Http/Headers.php | 222 ---- .../vendor/slim/slim/Slim/Http/Message.php | 295 ----- .../vendor/slim/slim/Slim/Http/Request.php | 1156 ----------------- .../slim/slim/Slim/Http/RequestBody.php | 27 - .../vendor/slim/slim/Slim/Http/Response.php | 470 ------- .../vendor/slim/slim/Slim/Http/Stream.php | 409 ------ .../slim/slim/Slim/Http/UploadedFile.php | 327 ----- .../slim/vendor/slim/slim/Slim/Http/Uri.php | 821 ------------ .../Interfaces/CallableResolverInterface.php | 27 - .../Slim/Interfaces/CollectionInterface.php | 32 - .../Slim/Interfaces/Http/CookiesInterface.php | 23 - .../Interfaces/Http/EnvironmentInterface.php | 20 - .../Slim/Interfaces/Http/HeadersInterface.php | 24 - .../InvocationStrategyInterface.php | 35 - .../Slim/Interfaces/RouteGroupInterface.php | 46 - .../slim/Slim/Interfaces/RouteInterface.php | 129 -- .../slim/Slim/Interfaces/RouterInterface.php | 107 -- .../slim/slim/Slim/MiddlewareAwareTrait.php | 120 -- .../slim/vendor/slim/slim/Slim/Routable.php | 106 -- .../slim/vendor/slim/slim/Slim/Route.php | 357 ----- .../slim/vendor/slim/slim/Slim/RouteGroup.php | 47 - .../slim/vendor/slim/slim/Slim/Router.php | 421 ------ .../slim/vendor/slim/slim/composer.json | 57 - .../slim/vendor/slim/slim/example/.htaccess | 12 - .../slim/vendor/slim/slim/example/README.md | 19 - .../slim/vendor/slim/slim/example/index.php | 45 - samples/server/petstore/php-slim/.gitignore | 6 + .../server/petstore/php-slim/composer.lock | 125 +- samples/server/petstore/php-slim/index.php | 519 +++++--- .../lib/Models/$Special[modelName].php | 13 + .../php-slim/lib/Models/200Response.php | 15 + .../lib/Models/AdditionalPropertiesClass.php | 15 + .../petstore/php-slim/lib/Models/Animal.php | 15 + .../php-slim/lib/Models/AnimalFarm.php | 11 + .../lib/Models/ArrayOfArrayOfNumberOnly.php | 13 + .../php-slim/lib/Models/ArrayOfNumberOnly.php | 13 + .../php-slim/lib/Models/ArrayTest.php | 17 + .../php-slim/lib/Models/Capitalization.php | 23 + .../petstore/php-slim/lib/Models/Cat.php | 17 + .../php-slim/lib/Models/ClassModel.php | 13 + .../petstore/php-slim/lib/Models/Client.php | 13 + .../petstore/php-slim/lib/Models/Dog.php | 17 + .../php-slim/lib/Models/EnumArrays.php | 15 + .../php-slim/lib/Models/EnumClass.php | 11 + .../petstore/php-slim/lib/Models/EnumTest.php | 21 + .../php-slim/lib/Models/FormatTest.php | 37 + .../php-slim/lib/Models/HasOnlyReadOnly.php | 15 + .../petstore/php-slim/lib/Models/List.php | 13 + .../petstore/php-slim/lib/Models/MapTest.php | 15 + ...PropertiesAndAdditionalPropertiesClass.php | 17 + .../php-slim/lib/Models/Model200Response.php | 15 + .../php-slim/lib/Models/ModelList.php | 13 + .../php-slim/lib/Models/ModelReturn.php | 13 + .../petstore/php-slim/lib/Models/Name.php | 19 + .../php-slim/lib/Models/NumberOnly.php | 13 + .../php-slim/lib/Models/OuterComposite.php | 17 + .../php-slim/lib/Models/OuterEnum.php | 11 + .../php-slim/lib/Models/ReadOnlyFirst.php | 15 + .../petstore/php-slim/lib/Models/Return.php | 13 + .../php-slim/lib/Models/SpecialModelName.php | 13 + .../petstore/php-slim/vendor/autoload.php | 7 - .../php-slim/vendor/composer/ClassLoader.php | 413 ------ .../vendor/composer/autoload_classmap.php | 9 - .../vendor/composer/autoload_files.php | 10 - .../vendor/composer/autoload_namespaces.php | 10 - .../vendor/composer/autoload_psr4.php | 13 - .../vendor/composer/autoload_real.php | 59 - .../php-slim/vendor/composer/installed.json | 247 ---- .../container-interop/.gitignore | 3 - .../container-interop/README.md | 85 -- .../container-interop/composer.json | 11 - .../docs/ContainerInterface-meta.md | 114 -- .../docs/ContainerInterface.md | 153 --- .../docs/Delegate-lookup-meta.md | 259 ---- .../container-interop/docs/Delegate-lookup.md | 60 - .../docs/images/interoperating_containers.png | Bin 36121 -> 0 bytes .../docs/images/priority.png | Bin 23031 -> 0 bytes .../docs/images/side_by_side_containers.png | Bin 22624 -> 0 bytes .../Interop/Container/ContainerInterface.php | 37 - .../Exception/ContainerException.php | 13 - .../Container/Exception/NotFoundException.php | 13 - .../vendor/nikic/fast-route/.hhconfig | 1 - .../vendor/nikic/fast-route/.travis.yml | 12 - .../vendor/nikic/fast-route/FastRoute.hhi | 126 -- .../vendor/nikic/fast-route/README.md | 273 ---- .../vendor/nikic/fast-route/composer.json | 21 - .../vendor/nikic/fast-route/phpunit.xml | 24 - .../fast-route/src/BadRouteException.php | 6 - .../nikic/fast-route/src/DataGenerator.php | 25 - .../src/DataGenerator/CharCountBased.php | 28 - .../src/DataGenerator/GroupCountBased.php | 28 - .../src/DataGenerator/GroupPosBased.php | 25 - .../src/DataGenerator/MarkBased.php | 25 - .../src/DataGenerator/RegexBasedAbstract.php | 144 -- .../nikic/fast-route/src/Dispatcher.php | 25 - .../src/Dispatcher/CharCountBased.php | 28 - .../src/Dispatcher/GroupCountBased.php | 28 - .../src/Dispatcher/GroupPosBased.php | 30 - .../fast-route/src/Dispatcher/MarkBased.php | 28 - .../src/Dispatcher/RegexBasedAbstract.php | 80 -- .../vendor/nikic/fast-route/src/Route.php | 38 - .../nikic/fast-route/src/RouteCollector.php | 46 - .../nikic/fast-route/src/RouteParser.php | 36 - .../nikic/fast-route/src/RouteParser/Std.php | 81 -- .../vendor/nikic/fast-route/src/bootstrap.php | 12 - .../vendor/nikic/fast-route/src/functions.php | 70 - .../test/Dispatcher/CharCountBasedTest.php | 13 - .../test/Dispatcher/DispatcherTest.php | 561 -------- .../test/Dispatcher/GroupCountBasedTest.php | 13 - .../test/Dispatcher/GroupPosBasedTest.php | 13 - .../test/Dispatcher/MarkBasedTest.php | 20 - .../HackTypechecker/HackTypecheckerTest.php | 39 - .../HackTypechecker/fixtures/all_options.php | 29 - .../fixtures/empty_options.php | 11 - .../HackTypechecker/fixtures/no_options.php | 11 - .../fast-route/test/RouteParser/StdTest.php | 147 --- .../nikic/fast-route/test/bootstrap.php | 11 - .../php-slim/vendor/pimple/pimple/.gitignore | 3 - .../php-slim/vendor/pimple/pimple/.travis.yml | 32 - .../php-slim/vendor/pimple/pimple/CHANGELOG | 35 - .../php-slim/vendor/pimple/pimple/README.rst | 201 --- .../vendor/pimple/pimple/composer.json | 25 - .../pimple/pimple/ext/pimple/.gitignore | 30 - .../vendor/pimple/pimple/ext/pimple/README.md | 12 - .../vendor/pimple/pimple/ext/pimple/config.m4 | 63 - .../pimple/pimple/ext/pimple/config.w32 | 13 - .../pimple/pimple/ext/pimple/php_pimple.h | 121 -- .../vendor/pimple/pimple/ext/pimple/pimple.c | 922 ------------- .../pimple/pimple/ext/pimple/pimple_compat.h | 81 -- .../pimple/pimple/ext/pimple/tests/001.phpt | 45 - .../pimple/pimple/ext/pimple/tests/002.phpt | 15 - .../pimple/pimple/ext/pimple/tests/003.phpt | 16 - .../pimple/pimple/ext/pimple/tests/004.phpt | 30 - .../pimple/pimple/ext/pimple/tests/005.phpt | 27 - .../pimple/pimple/ext/pimple/tests/006.phpt | 51 - .../pimple/pimple/ext/pimple/tests/007.phpt | 22 - .../pimple/pimple/ext/pimple/tests/008.phpt | 29 - .../pimple/pimple/ext/pimple/tests/009.phpt | 13 - .../pimple/pimple/ext/pimple/tests/010.phpt | 45 - .../pimple/pimple/ext/pimple/tests/011.phpt | 19 - .../pimple/pimple/ext/pimple/tests/012.phpt | 28 - .../pimple/pimple/ext/pimple/tests/013.phpt | 33 - .../pimple/pimple/ext/pimple/tests/014.phpt | 30 - .../pimple/pimple/ext/pimple/tests/015.phpt | 17 - .../pimple/pimple/ext/pimple/tests/016.phpt | 24 - .../pimple/pimple/ext/pimple/tests/017.phpt | 17 - .../pimple/pimple/ext/pimple/tests/017_1.phpt | 17 - .../pimple/pimple/ext/pimple/tests/018.phpt | 23 - .../pimple/pimple/ext/pimple/tests/019.phpt | 18 - .../pimple/pimple/ext/pimple/tests/bench.phpb | 51 - .../pimple/ext/pimple/tests/bench_shared.phpb | 25 - .../vendor/pimple/pimple/phpunit.xml.dist | 14 - .../pimple/pimple/src/Pimple/Container.php | 282 ---- .../src/Pimple/ServiceProviderInterface.php | 46 - .../src/Pimple/Tests/Fixtures/Invokable.php | 38 - .../Pimple/Tests/Fixtures/NonInvokable.php | 34 - .../Tests/Fixtures/PimpleServiceProvider.php | 54 - .../src/Pimple/Tests/Fixtures/Service.php | 35 - .../PimpleServiceProviderInterfaceTest.php | 76 -- .../pimple/src/Pimple/Tests/PimpleTest.php | 440 ------- .../vendor/psr/http-message/README.md | 13 - .../vendor/psr/http-message/composer.json | 25 - .../psr/http-message/src/MessageInterface.php | 187 --- .../psr/http-message/src/RequestInterface.php | 129 -- .../http-message/src/ResponseInterface.php | 68 - .../src/ServerRequestInterface.php | 261 ---- .../psr/http-message/src/StreamInterface.php | 158 --- .../src/UploadedFileInterface.php | 123 -- .../psr/http-message/src/UriInterface.php | 323 ----- .../php-slim/vendor/slim/slim/CONTRIBUTING.md | 20 - .../php-slim/vendor/slim/slim/LICENSE.md | 19 - .../php-slim/vendor/slim/slim/README.md | 84 -- .../php-slim/vendor/slim/slim/Slim/App.php | 644 --------- .../slim/slim/Slim/CallableResolver.php | 87 -- .../slim/Slim/CallableResolverAwareTrait.php | 47 - .../vendor/slim/slim/Slim/Collection.php | 204 --- .../vendor/slim/slim/Slim/Container.php | 181 --- .../slim/Slim/DefaultServicesProvider.php | 204 --- .../slim/slim/Slim/DeferredCallable.php | 39 - .../Slim/Exception/ContainerException.php | 20 - .../ContainerValueNotFoundException.php | 20 - .../Exception/MethodNotAllowedException.php | 45 - .../slim/Slim/Exception/NotFoundException.php | 14 - .../slim/Slim/Exception/SlimException.php | 69 - .../slim/slim/Slim/Handlers/AbstractError.php | 99 -- .../slim/Slim/Handlers/AbstractHandler.php | 59 - .../vendor/slim/slim/Slim/Handlers/Error.php | 206 --- .../slim/slim/Slim/Handlers/NotAllowed.php | 147 --- .../slim/slim/Slim/Handlers/NotFound.php | 126 -- .../slim/slim/Slim/Handlers/PhpError.php | 205 --- .../Handlers/Strategies/RequestResponse.php | 43 - .../Strategies/RequestResponseArgs.php | 42 - .../vendor/slim/slim/Slim/Http/Body.php | 22 - .../vendor/slim/slim/Slim/Http/Cookies.php | 195 --- .../slim/slim/Slim/Http/Environment.php | 52 - .../vendor/slim/slim/Slim/Http/Headers.php | 222 ---- .../vendor/slim/slim/Slim/Http/Message.php | 295 ----- .../vendor/slim/slim/Slim/Http/Request.php | 1156 ----------------- .../slim/slim/Slim/Http/RequestBody.php | 27 - .../vendor/slim/slim/Slim/Http/Response.php | 470 ------- .../vendor/slim/slim/Slim/Http/Stream.php | 409 ------ .../slim/slim/Slim/Http/UploadedFile.php | 327 ----- .../vendor/slim/slim/Slim/Http/Uri.php | 821 ------------ .../Interfaces/CallableResolverInterface.php | 27 - .../Slim/Interfaces/CollectionInterface.php | 32 - .../Slim/Interfaces/Http/CookiesInterface.php | 23 - .../Interfaces/Http/EnvironmentInterface.php | 20 - .../Slim/Interfaces/Http/HeadersInterface.php | 24 - .../InvocationStrategyInterface.php | 35 - .../Slim/Interfaces/RouteGroupInterface.php | 46 - .../slim/Slim/Interfaces/RouteInterface.php | 129 -- .../slim/Slim/Interfaces/RouterInterface.php | 107 -- .../slim/slim/Slim/MiddlewareAwareTrait.php | 120 -- .../vendor/slim/slim/Slim/Routable.php | 106 -- .../php-slim/vendor/slim/slim/Slim/Route.php | 357 ----- .../vendor/slim/slim/Slim/RouteGroup.php | 47 - .../php-slim/vendor/slim/slim/Slim/Router.php | 421 ------ .../php-slim/vendor/slim/slim/composer.json | 57 - .../vendor/slim/slim/example/.htaccess | 12 - .../vendor/slim/slim/example/README.md | 19 - .../vendor/slim/slim/example/index.php | 45 - 371 files changed, 1141 insertions(+), 33023 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/slim/.gitignore create mode 100644 samples/server/petstore-security-test/slim/.gitignore rename samples/server/petstore-security-test/slim/lib/Models/{Return.php => ModelReturn.php} (75%) delete mode 100644 samples/server/petstore-security-test/slim/vendor/autoload.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/composer/ClassLoader.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/composer/LICENSE delete mode 100644 samples/server/petstore-security-test/slim/vendor/composer/autoload_classmap.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/composer/autoload_files.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/composer/autoload_namespaces.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/composer/autoload_psr4.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/composer/autoload_real.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/composer/installed.json delete mode 100644 samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/.gitignore delete mode 100644 samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/LICENSE delete mode 100644 samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/README.md delete mode 100644 samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/composer.json delete mode 100644 samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/ContainerInterface-meta.md delete mode 100644 samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/ContainerInterface.md delete mode 100644 samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/Delegate-lookup-meta.md delete mode 100644 samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/Delegate-lookup.md delete mode 100644 samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/images/interoperating_containers.png delete mode 100644 samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/images/priority.png delete mode 100644 samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/images/side_by_side_containers.png delete mode 100644 samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/src/Interop/Container/ContainerInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/.hhconfig delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/.travis.yml delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/FastRoute.hhi delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/LICENSE delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/README.md delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/composer.json delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/phpunit.xml delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/BadRouteException.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/CharCountBased.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/GroupCountBased.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/GroupPosBased.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/MarkBased.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/CharCountBased.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/GroupCountBased.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/GroupPosBased.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/MarkBased.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/RegexBasedAbstract.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Route.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/RouteCollector.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/RouteParser.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/RouteParser/Std.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/bootstrap.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/functions.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/Dispatcher/CharCountBasedTest.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/Dispatcher/DispatcherTest.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/Dispatcher/GroupCountBasedTest.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/Dispatcher/GroupPosBasedTest.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/Dispatcher/MarkBasedTest.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/HackTypechecker/HackTypecheckerTest.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/all_options.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/empty_options.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/no_options.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/RouteParser/StdTest.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/bootstrap.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/.gitignore delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/.travis.yml delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/CHANGELOG delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/LICENSE delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/README.rst delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/composer.json delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/.gitignore delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/README.md delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/config.m4 delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/config.w32 delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/php_pimple.h delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/pimple.c delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/pimple_compat.h delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/001.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/002.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/003.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/004.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/005.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/006.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/007.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/008.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/009.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/010.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/011.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/012.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/013.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/014.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/015.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/016.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/017.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/017_1.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/018.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/019.phpt delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/bench.phpb delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/bench_shared.phpb delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/phpunit.xml.dist delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Container.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/ServiceProviderInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Invokable.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/PimpleServiceProvider.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/psr/http-message/LICENSE delete mode 100644 samples/server/petstore-security-test/slim/vendor/psr/http-message/README.md delete mode 100644 samples/server/petstore-security-test/slim/vendor/psr/http-message/composer.json delete mode 100644 samples/server/petstore-security-test/slim/vendor/psr/http-message/src/MessageInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/psr/http-message/src/RequestInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/psr/http-message/src/ResponseInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/psr/http-message/src/ServerRequestInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/psr/http-message/src/StreamInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/psr/http-message/src/UploadedFileInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/psr/http-message/src/UriInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/CONTRIBUTING.md delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/LICENSE.md delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/README.md delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/App.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/CallableResolver.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/CallableResolverAwareTrait.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Collection.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Container.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/DefaultServicesProvider.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/DeferredCallable.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Exception/ContainerException.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Exception/ContainerValueNotFoundException.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Exception/MethodNotAllowedException.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Exception/NotFoundException.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Exception/SlimException.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/AbstractError.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/AbstractHandler.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/Error.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/NotAllowed.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/NotFound.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/PhpError.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Body.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Cookies.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Environment.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Headers.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Message.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Request.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/RequestBody.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Response.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Stream.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/UploadedFile.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Uri.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Interfaces/CallableResolverInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Interfaces/CollectionInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Interfaces/Http/CookiesInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Interfaces/Http/EnvironmentInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Interfaces/Http/HeadersInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Interfaces/InvocationStrategyInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Interfaces/RouteGroupInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Interfaces/RouteInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Interfaces/RouterInterface.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/MiddlewareAwareTrait.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Routable.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Route.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/RouteGroup.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Router.php delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/composer.json delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/example/.htaccess delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/example/README.md delete mode 100644 samples/server/petstore-security-test/slim/vendor/slim/slim/example/index.php create mode 100644 samples/server/petstore/php-slim/.gitignore create mode 100644 samples/server/petstore/php-slim/lib/Models/$Special[modelName].php create mode 100644 samples/server/petstore/php-slim/lib/Models/200Response.php create mode 100644 samples/server/petstore/php-slim/lib/Models/AdditionalPropertiesClass.php create mode 100644 samples/server/petstore/php-slim/lib/Models/Animal.php create mode 100644 samples/server/petstore/php-slim/lib/Models/AnimalFarm.php create mode 100644 samples/server/petstore/php-slim/lib/Models/ArrayOfArrayOfNumberOnly.php create mode 100644 samples/server/petstore/php-slim/lib/Models/ArrayOfNumberOnly.php create mode 100644 samples/server/petstore/php-slim/lib/Models/ArrayTest.php create mode 100644 samples/server/petstore/php-slim/lib/Models/Capitalization.php create mode 100644 samples/server/petstore/php-slim/lib/Models/Cat.php create mode 100644 samples/server/petstore/php-slim/lib/Models/ClassModel.php create mode 100644 samples/server/petstore/php-slim/lib/Models/Client.php create mode 100644 samples/server/petstore/php-slim/lib/Models/Dog.php create mode 100644 samples/server/petstore/php-slim/lib/Models/EnumArrays.php create mode 100644 samples/server/petstore/php-slim/lib/Models/EnumClass.php create mode 100644 samples/server/petstore/php-slim/lib/Models/EnumTest.php create mode 100644 samples/server/petstore/php-slim/lib/Models/FormatTest.php create mode 100644 samples/server/petstore/php-slim/lib/Models/HasOnlyReadOnly.php create mode 100644 samples/server/petstore/php-slim/lib/Models/List.php create mode 100644 samples/server/petstore/php-slim/lib/Models/MapTest.php create mode 100644 samples/server/petstore/php-slim/lib/Models/MixedPropertiesAndAdditionalPropertiesClass.php create mode 100644 samples/server/petstore/php-slim/lib/Models/Model200Response.php create mode 100644 samples/server/petstore/php-slim/lib/Models/ModelList.php create mode 100644 samples/server/petstore/php-slim/lib/Models/ModelReturn.php create mode 100644 samples/server/petstore/php-slim/lib/Models/Name.php create mode 100644 samples/server/petstore/php-slim/lib/Models/NumberOnly.php create mode 100644 samples/server/petstore/php-slim/lib/Models/OuterComposite.php create mode 100644 samples/server/petstore/php-slim/lib/Models/OuterEnum.php create mode 100644 samples/server/petstore/php-slim/lib/Models/ReadOnlyFirst.php create mode 100644 samples/server/petstore/php-slim/lib/Models/Return.php create mode 100644 samples/server/petstore/php-slim/lib/Models/SpecialModelName.php delete mode 100644 samples/server/petstore/php-slim/vendor/autoload.php delete mode 100644 samples/server/petstore/php-slim/vendor/composer/ClassLoader.php delete mode 100644 samples/server/petstore/php-slim/vendor/composer/autoload_classmap.php delete mode 100644 samples/server/petstore/php-slim/vendor/composer/autoload_files.php delete mode 100644 samples/server/petstore/php-slim/vendor/composer/autoload_namespaces.php delete mode 100644 samples/server/petstore/php-slim/vendor/composer/autoload_psr4.php delete mode 100644 samples/server/petstore/php-slim/vendor/composer/autoload_real.php delete mode 100644 samples/server/petstore/php-slim/vendor/composer/installed.json delete mode 100644 samples/server/petstore/php-slim/vendor/container-interop/container-interop/.gitignore delete mode 100644 samples/server/petstore/php-slim/vendor/container-interop/container-interop/README.md delete mode 100644 samples/server/petstore/php-slim/vendor/container-interop/container-interop/composer.json delete mode 100644 samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/ContainerInterface-meta.md delete mode 100644 samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/ContainerInterface.md delete mode 100644 samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/Delegate-lookup-meta.md delete mode 100644 samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/Delegate-lookup.md delete mode 100644 samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/images/interoperating_containers.png delete mode 100644 samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/images/priority.png delete mode 100644 samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/images/side_by_side_containers.png delete mode 100644 samples/server/petstore/php-slim/vendor/container-interop/container-interop/src/Interop/Container/ContainerInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php delete mode 100644 samples/server/petstore/php-slim/vendor/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/.hhconfig delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/.travis.yml delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/FastRoute.hhi delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/README.md delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/composer.json delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/phpunit.xml delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/BadRouteException.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/CharCountBased.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/GroupCountBased.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/GroupPosBased.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/MarkBased.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/CharCountBased.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/GroupCountBased.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/GroupPosBased.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/MarkBased.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/RegexBasedAbstract.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Route.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/RouteCollector.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/RouteParser.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/RouteParser/Std.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/bootstrap.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/src/functions.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/test/Dispatcher/CharCountBasedTest.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/test/Dispatcher/DispatcherTest.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/test/Dispatcher/GroupCountBasedTest.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/test/Dispatcher/GroupPosBasedTest.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/test/Dispatcher/MarkBasedTest.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/test/HackTypechecker/HackTypecheckerTest.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/all_options.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/empty_options.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/no_options.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/test/RouteParser/StdTest.php delete mode 100644 samples/server/petstore/php-slim/vendor/nikic/fast-route/test/bootstrap.php delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/.gitignore delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/.travis.yml delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/CHANGELOG delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/README.rst delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/composer.json delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/.gitignore delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/README.md delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/config.m4 delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/config.w32 delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/php_pimple.h delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/pimple.c delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/pimple_compat.h delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/001.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/002.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/003.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/004.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/005.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/006.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/007.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/008.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/009.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/010.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/011.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/012.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/013.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/014.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/015.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/016.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/017.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/017_1.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/018.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/019.phpt delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/bench.phpb delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/bench_shared.phpb delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/phpunit.xml.dist delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Container.php delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/ServiceProviderInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Invokable.php delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/PimpleServiceProvider.php delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php delete mode 100644 samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php delete mode 100644 samples/server/petstore/php-slim/vendor/psr/http-message/README.md delete mode 100644 samples/server/petstore/php-slim/vendor/psr/http-message/composer.json delete mode 100644 samples/server/petstore/php-slim/vendor/psr/http-message/src/MessageInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/psr/http-message/src/RequestInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/psr/http-message/src/ResponseInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/psr/http-message/src/ServerRequestInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/psr/http-message/src/StreamInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/psr/http-message/src/UploadedFileInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/psr/http-message/src/UriInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/CONTRIBUTING.md delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/LICENSE.md delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/README.md delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/App.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/CallableResolver.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/CallableResolverAwareTrait.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Collection.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Container.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/DefaultServicesProvider.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/DeferredCallable.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Exception/ContainerException.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Exception/ContainerValueNotFoundException.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Exception/MethodNotAllowedException.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Exception/NotFoundException.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Exception/SlimException.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/AbstractError.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/AbstractHandler.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/Error.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/NotAllowed.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/NotFound.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/PhpError.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Body.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Cookies.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Environment.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Headers.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Message.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Request.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/RequestBody.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Response.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Stream.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/UploadedFile.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Uri.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Interfaces/CallableResolverInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Interfaces/CollectionInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Interfaces/Http/CookiesInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Interfaces/Http/EnvironmentInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Interfaces/Http/HeadersInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Interfaces/InvocationStrategyInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Interfaces/RouteGroupInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Interfaces/RouteInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Interfaces/RouterInterface.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/MiddlewareAwareTrait.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Routable.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Route.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/RouteGroup.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/Slim/Router.php delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/composer.json delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/example/.htaccess delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/example/README.md delete mode 100644 samples/server/petstore/php-slim/vendor/slim/slim/example/index.php diff --git a/bin/php-slim-petstore-server.sh b/bin/php-slim-petstore-server.sh index f3939b45fe2..54624118c3b 100755 --- a/bin/php-slim-petstore-server.sh +++ b/bin/php-slim-petstore-server.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/slim -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php-slim -o samples/server/petstore/php-slim $@" +ags="generate -t modules/openapi-generator/src/main/resources/slim -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php-slim -o samples/server/petstore/php-slim $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/php-slim-petstore-server.bat b/bin/windows/php-slim-petstore-server.bat index aadb01fe836..395804560b3 100644 --- a/bin/windows/php-slim-petstore-server.bat +++ b/bin/windows/php-slim-petstore-server.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g php-slim -o samples\server\petstore\php-slim +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g php-slim -o samples\server\petstore\php-slim java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlimServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlimServerCodegen.java index a94d7b9dca3..465dcd1bc8c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlimServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlimServerCodegen.java @@ -18,22 +18,31 @@ package org.openapitools.codegen.languages; import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.CodegenOperation; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.DefaultCodegen; import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import io.swagger.v3.oas.models.media.*; import java.io.File; import java.util.Arrays; +import java.util.Map; +import java.util.List; import java.util.HashMap; import java.util.HashSet; import java.util.regex.Matcher; +import java.util.Comparator; +import java.util.Collections; public class PhpSlimServerCodegen extends DefaultCodegen implements CodegenConfig { + private static final Logger LOGGER = LoggerFactory.getLogger(PhpSlimServerCodegen.class); + protected String invokerPackage; protected String srcBasePath = "lib"; protected String groupId = "org.openapitools"; @@ -112,6 +121,7 @@ public class PhpSlimServerCodegen extends DefaultCodegen implements CodegenConfi supportingFiles.add(new SupportingFile("composer.json", packagePath.replace('/', File.separatorChar), "composer.json")); supportingFiles.add(new SupportingFile("index.mustache", packagePath.replace('/', File.separatorChar), "index.php")); supportingFiles.add(new SupportingFile(".htaccess", packagePath.replace('/', File.separatorChar), ".htaccess")); + supportingFiles.add(new SupportingFile(".gitignore", packagePath.replace('/', File.separatorChar), ".gitignore")); } @Override @@ -232,9 +242,36 @@ public class PhpSlimServerCodegen extends DefaultCodegen implements CodegenConfi @Override public String toModelName(String name) { + // remove [ + name = name.replaceAll("\\]", ""); + + // Note: backslash ("\\") is allowed for e.g. "\\DateTime" + name = name.replaceAll("[^\\w\\\\]+", "_"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + + // remove dollar sign + name = name.replaceAll("$", ""); + // model name cannot use reserved keyword if (isReservedWord(name)) { - escapeReservedWord(name); // e.g. return => _return + LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + camelize("model_" + name)); + name = "model_" + name; // e.g. return => ModelReturn (after camelize) + } + + // model name starts with number + if (name.matches("^\\d.*")) { + LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + camelize("model_" + name)); + name = "model_" + name; // e.g. 200Response => Model200Response (after camelize) + } + + // add prefix and/or suffic only if name does not start wth \ (e.g. \DateTime) + if (!name.matches("^\\\\.*")) { + if (!StringUtils.isEmpty(modelNamePrefix)) { + name = modelNamePrefix + "_" + name; + } + + if (!StringUtils.isEmpty(modelNameSuffix)) { + name = name + "_" + modelNameSuffix; + } } // camelize the model name @@ -248,6 +285,22 @@ public class PhpSlimServerCodegen extends DefaultCodegen implements CodegenConfi return toModelName(name); } + @Override + public String toOperationId(String operationId) { + // throw exception if method name is empty + if (StringUtils.isEmpty(operationId)) { + throw new RuntimeException("Empty method name (operationId) not allowed"); + } + + // method name cannot use reserved keyword, e.g. return + if (isReservedWord(operationId)) { + LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + camelize(sanitizeName("call_" + operationId), true)); + operationId = "call_" + operationId; + } + + return camelize(sanitizeName(operationId), true); + } + public String toPackagePath(String packageName, String basePath) { packageName = packageName.replace(invokerPackage, ""); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. if (basePath != null && basePath.length() > 0) { @@ -292,4 +345,44 @@ public class PhpSlimServerCodegen extends DefaultCodegen implements CodegenConfi return input.replace("*/", ""); } + @Override + public Map postProcessOperations(Map objs) { + Map operations = (Map) objs.get("operations"); + List operationList = (List) operations.get("operation"); + for (CodegenOperation op : operationList) { + if (op.hasProduces) { + // need to escape */* values because they breakes current mustaches + List> c = op.produces; + for (Map mediaType : c) { + if ("*/*".equals(mediaType.get("mediaType"))) { + mediaType.put("mediaType", "*_/_*"); + } + } + } + } + return objs; + } + + @Override + public Map postProcessSupportingFileData(Map objs) { + Map apiInfo = (Map) objs.get("apiInfo"); + List> apiList = (List>) apiInfo.get("apis"); + for (HashMap api : apiList) { + HashMap operations = (HashMap) api.get("operations"); + List operationList = (List) operations.get("operation"); + + // Sort operations to avoid static routes shadowing + // ref: https://github.com/nikic/FastRoute/blob/master/src/DataGenerator/RegexBasedAbstract.php#L92-L101 + Collections.sort(operationList, new Comparator() { + @Override + public int compare(CodegenOperation one, CodegenOperation another) { + if (one.getHasPathParams() && !another.getHasPathParams()) return 1; + if (!one.getHasPathParams() && another.getHasPathParams()) return -1; + return 0; + } + }); + } + return objs; + } + } diff --git a/modules/openapi-generator/src/main/resources/slim/.gitignore b/modules/openapi-generator/src/main/resources/slim/.gitignore new file mode 100644 index 00000000000..9ff0a17ae5c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/slim/.gitignore @@ -0,0 +1,6 @@ +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +composer.lock \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/slim/index.mustache b/modules/openapi-generator/src/main/resources/slim/index.mustache index d6c40200b0d..74784585848 100644 --- a/modules/openapi-generator/src/main/resources/slim/index.mustache +++ b/modules/openapi-generator/src/main/resources/slim/index.mustache @@ -13,17 +13,44 @@ $app = new Slim\App(); * {{httpMethod}} {{nickname}} * Summary: {{summary}} * Notes: {{notes}} -{{#hasProduces}} * Output-Formats: [{{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}]{{/hasProduces}} + {{#hasProduces}} + * Output-Formats: [{{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}] + {{/hasProduces}} */ $app->{{httpMethod}}('{{{basePathWithoutHost}}}{{{path}}}', function($request, $response, $args) { - {{#hasHeaderParams}}$headers = $request->getHeaders();{{/hasHeaderParams}} - {{#hasQueryParams}}$queryParams = $request->getQueryParams(); - {{#queryParams}}${{paramName}} = $queryParams['{{paramName}}'];{{newline}} {{/queryParams}}{{/hasQueryParams}} - {{#hasFormParams}}{{#formParams}}${{paramName}} = $args['{{paramName}}'];{{newline}} {{/formParams}}{{/hasFormParams}} - {{#hasBodyParam}}$body = $request->getParsedBody();{{/hasBodyParam}} - $response->write('How about implementing {{nickname}} as a {{httpMethod}} method ?'); - return $response; - }); + {{#hasHeaderParams}} + $headers = $request->getHeaders(); + {{#headerParams}} + ${{paramName}} = $request->hasHeader('{{baseName}}') ? $headers['{{baseName}}'] : null; + {{/headerParams}} + {{/hasHeaderParams}} + {{#hasPathParams}} + {{#pathParams}} + ${{paramName}} = $args['{{baseName}}']; + {{/pathParams}} + {{/hasPathParams}} + {{#hasQueryParams}} + $queryParams = $request->getQueryParams(); + {{#queryParams}} + ${{paramName}} = $request->getQueryParam('{{baseName}}'); + {{/queryParams}} + {{/hasQueryParams}} + {{#hasFormParams}} + {{#formParams}} + {{^isFile}} + ${{paramName}} = $request->getParsedBodyParam('{{baseName}}'); + {{/isFile}} + {{#isFile}} + ${{paramName}} = (key_exists('{{baseName}}', $request->getUploadedFiles())) ? $request->getUploadedFiles()['{{baseName}}'] : null; + {{/isFile}} + {{/formParams}} + {{/hasFormParams}} + {{#hasBodyParam}} + $body = $request->getParsedBody(); + {{/hasBodyParam}} + $response->write('How about implementing {{nickname}} as a {{httpMethod}} method ?'); + return $response; +}); {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} diff --git a/samples/server/petstore-security-test/slim/.gitignore b/samples/server/petstore-security-test/slim/.gitignore new file mode 100644 index 00000000000..9ff0a17ae5c --- /dev/null +++ b/samples/server/petstore-security-test/slim/.gitignore @@ -0,0 +1,6 @@ +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +composer.lock \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/.openapi-generator/VERSION b/samples/server/petstore-security-test/slim/.openapi-generator/VERSION index 096bf47efe3..82602aa4190 100644 --- a/samples/server/petstore-security-test/slim/.openapi-generator/VERSION +++ b/samples/server/petstore-security-test/slim/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/composer.lock b/samples/server/petstore-security-test/slim/composer.lock index 3007790bbeb..c31fb841c9b 100644 --- a/samples/server/petstore-security-test/slim/composer.lock +++ b/samples/server/petstore-security-test/slim/composer.lock @@ -4,23 +4,25 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "834a8ce57aaea28f119aedff36481779", "content-hash": "913417690829da41975a473b88f30f64", "packages": [ { "name": "container-interop/container-interop", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/container-interop/container-interop.git", - "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e" + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/container-interop/container-interop/zipball/fc08354828f8fd3245f77a66b9e23a6bca48297e", - "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", "shasum": "" }, + "require": { + "psr/container": "^1.0" + }, "type": "library", "autoload": { "psr-4": { @@ -32,25 +34,29 @@ "MIT" ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", - "time": "2014-12-30 15:22:37" + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" }, { "name": "nikic/fast-route", - "version": "v1.0.1", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/nikic/FastRoute.git", - "reference": "8ea928195fa9b907f0d6e48312d323c1a13cc2af" + "reference": "181d480e08d9476e61381e04a71b34dc0432e812" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/FastRoute/zipball/8ea928195fa9b907f0d6e48312d323c1a13cc2af", - "reference": "8ea928195fa9b907f0d6e48312d323c1a13cc2af", + "url": "https://api.github.com/repos/nikic/FastRoute/zipball/181d480e08d9476e61381e04a71b34dc0432e812", + "reference": "181d480e08d9476e61381e04a71b34dc0432e812", "shasum": "" }, "require": { "php": ">=5.4.0" }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|~5.7" + }, "type": "library", "autoload": { "psr-4": { @@ -75,29 +81,33 @@ "router", "routing" ], - "time": "2016-06-12 19:08:51" + "time": "2018-02-13T20:26:39+00:00" }, { "name": "pimple/pimple", - "version": "v3.0.2", + "version": "v3.2.3", "source": { "type": "git", "url": "https://github.com/silexphp/Pimple.git", - "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a" + "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/a30f7d6e57565a2e1a316e1baf2a483f788b258a", - "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32", + "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.3.0", + "psr/container": "^1.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "3.2.x-dev" } }, "autoload": { @@ -121,20 +131,69 @@ "container", "dependency injection" ], - "time": "2015-09-11 15:10:35" + "time": "2018-01-21T07:42:36+00:00" }, { - "name": "psr/http-message", - "version": "1.0", + "name": "psr/container", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", "shasum": "" }, "require": { @@ -162,6 +221,7 @@ } ], "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", "keywords": [ "http", "http-message", @@ -170,27 +230,28 @@ "request", "response" ], - "time": "2015-05-04 20:22:00" + "time": "2016-08-06T14:39:51+00:00" }, { "name": "slim/slim", - "version": "3.4.2", + "version": "3.10.0", "source": { "type": "git", "url": "https://github.com/slimphp/Slim.git", - "reference": "a132385f736063d00632b52b3f8a389fe66fe4fa" + "reference": "d8aabeacc3688b25e2f2dd2db91df91ec6fdd748" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim/zipball/a132385f736063d00632b52b3f8a389fe66fe4fa", - "reference": "a132385f736063d00632b52b3f8a389fe66fe4fa", + "url": "https://api.github.com/repos/slimphp/Slim/zipball/d8aabeacc3688b25e2f2dd2db91df91ec6fdd748", + "reference": "d8aabeacc3688b25e2f2dd2db91df91ec6fdd748", "shasum": "" }, "require": { - "container-interop/container-interop": "^1.1", + "container-interop/container-interop": "^1.2", "nikic/fast-route": "^1.0", "php": ">=5.5.0", "pimple/pimple": "^3.0", + "psr/container": "^1.0", "psr/http-message": "^1.0" }, "provide": { @@ -233,14 +294,14 @@ } ], "description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs", - "homepage": "http://slimframework.com", + "homepage": "https://slimframework.com", "keywords": [ "api", "framework", "micro", "router" ], - "time": "2016-05-25 11:23:38" + "time": "2018-04-19T19:29:08+00:00" } ], "packages-dev": [], diff --git a/samples/server/petstore-security-test/slim/index.php b/samples/server/petstore-security-test/slim/index.php index 88915437d5b..9fc3246ad89 100644 --- a/samples/server/petstore-security-test/slim/index.php +++ b/samples/server/petstore-security-test/slim/index.php @@ -10,19 +10,15 @@ $app = new Slim\App(); /** - * PUT testCodeInject */ ' " =end \r\n \n \r + * PUT testCodeInjectEndRnNR * Summary: To test code injection ' \" =end -- \\r\\n \\n \\r * Notes: - */ $app->PUT('/fake', function($request, $response, $args) { - - - - $body = $request->getParsedBody(); - $response->write('How about implementing testCodeInject */ ' " =end \r\n \n \r as a PUT method ?'); - return $response; - }); + $body = $request->getParsedBody(); + $response->write('How about implementing testCodeInjectEndRnNR as a PUT method ?'); + return $response; +}); diff --git a/samples/server/petstore-security-test/slim/lib/Models/Return.php b/samples/server/petstore-security-test/slim/lib/Models/ModelReturn.php similarity index 75% rename from samples/server/petstore-security-test/slim/lib/Models/Return.php rename to samples/server/petstore-security-test/slim/lib/Models/ModelReturn.php index 4ec708b34ba..9d3ed859a8d 100644 --- a/samples/server/petstore-security-test/slim/lib/Models/Return.php +++ b/samples/server/petstore-security-test/slim/lib/Models/ModelReturn.php @@ -1,13 +1,13 @@ - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - // PSR-4 - private $prefixLengthsPsr4 = array(); - private $prefixDirsPsr4 = array(); - private $fallbackDirsPsr4 = array(); - - // PSR-0 - private $prefixesPsr0 = array(); - private $fallbackDirsPsr0 = array(); - - private $useIncludePath = false; - private $classMap = array(); - - private $classMapAuthoritative = false; - - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); - } - - return array(); - } - - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731 - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative) { - return false; - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if ($file === null && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if ($file === null) { - // Remember that this class does not exist. - return $this->classMap[$class] = false; - } - - return $file; - } - - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { - if (0 === strpos($class, $prefix)) { - foreach ($this->prefixDirsPsr4[$prefix] as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; -} diff --git a/samples/server/petstore-security-test/slim/vendor/composer/LICENSE b/samples/server/petstore-security-test/slim/vendor/composer/LICENSE deleted file mode 100644 index 1a28124886d..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) 2016 Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/samples/server/petstore-security-test/slim/vendor/composer/autoload_classmap.php b/samples/server/petstore-security-test/slim/vendor/composer/autoload_classmap.php deleted file mode 100644 index 7a91153b0d8..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,9 +0,0 @@ - $vendorDir . '/nikic/fast-route/src/functions.php', -); diff --git a/samples/server/petstore-security-test/slim/vendor/composer/autoload_namespaces.php b/samples/server/petstore-security-test/slim/vendor/composer/autoload_namespaces.php deleted file mode 100644 index c3cd02297de..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,10 +0,0 @@ - array($vendorDir . '/pimple/pimple/src'), -); diff --git a/samples/server/petstore-security-test/slim/vendor/composer/autoload_psr4.php b/samples/server/petstore-security-test/slim/vendor/composer/autoload_psr4.php deleted file mode 100644 index 7e403d2e2d0..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/composer/autoload_psr4.php +++ /dev/null @@ -1,13 +0,0 @@ - array($vendorDir . '/slim/slim/Slim'), - 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), - 'Interop\\Container\\' => array($vendorDir . '/container-interop/container-interop/src/Interop/Container'), - 'FastRoute\\' => array($vendorDir . '/nikic/fast-route/src'), -); diff --git a/samples/server/petstore-security-test/slim/vendor/composer/autoload_real.php b/samples/server/petstore-security-test/slim/vendor/composer/autoload_real.php deleted file mode 100644 index cb6d95c7fcf..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/composer/autoload_real.php +++ /dev/null @@ -1,59 +0,0 @@ - $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - - $loader->register(true); - - $includeFiles = require __DIR__ . '/autoload_files.php'; - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequirea7ca9e6d69dc1fe934d8e0e81434a295($fileIdentifier, $file); - } - - return $loader; - } -} - -function composerRequirea7ca9e6d69dc1fe934d8e0e81434a295($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/composer/installed.json b/samples/server/petstore-security-test/slim/vendor/composer/installed.json deleted file mode 100644 index 9e041100fe2..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/composer/installed.json +++ /dev/null @@ -1,247 +0,0 @@ -[ - { - "name": "container-interop/container-interop", - "version": "1.1.0", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/container-interop/container-interop.git", - "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/container-interop/container-interop/zipball/fc08354828f8fd3245f77a66b9e23a6bca48297e", - "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e", - "shasum": "" - }, - "time": "2014-12-30 15:22:37", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Interop\\Container\\": "src/Interop/Container/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Promoting the interoperability of container objects (DIC, SL, etc.)" - }, - { - "name": "nikic/fast-route", - "version": "v1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/nikic/FastRoute.git", - "reference": "8ea928195fa9b907f0d6e48312d323c1a13cc2af" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/FastRoute/zipball/8ea928195fa9b907f0d6e48312d323c1a13cc2af", - "reference": "8ea928195fa9b907f0d6e48312d323c1a13cc2af", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "time": "2016-06-12 19:08:51", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "FastRoute\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov", - "email": "nikic@php.net" - } - ], - "description": "Fast request router for PHP", - "keywords": [ - "router", - "routing" - ] - }, - { - "name": "psr/http-message", - "version": "1.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2015-05-04 20:22:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ] - }, - { - "name": "pimple/pimple", - "version": "v3.0.2", - "version_normalized": "3.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/silexphp/Pimple.git", - "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/a30f7d6e57565a2e1a316e1baf2a483f788b258a", - "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2015-09-11 15:10:35", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Pimple": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Pimple, a simple Dependency Injection Container", - "homepage": "http://pimple.sensiolabs.org", - "keywords": [ - "container", - "dependency injection" - ] - }, - { - "name": "slim/slim", - "version": "3.4.2", - "version_normalized": "3.4.2.0", - "source": { - "type": "git", - "url": "https://github.com/slimphp/Slim.git", - "reference": "a132385f736063d00632b52b3f8a389fe66fe4fa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim/zipball/a132385f736063d00632b52b3f8a389fe66fe4fa", - "reference": "a132385f736063d00632b52b3f8a389fe66fe4fa", - "shasum": "" - }, - "require": { - "container-interop/container-interop": "^1.1", - "nikic/fast-route": "^1.0", - "php": ">=5.5.0", - "pimple/pimple": "^3.0", - "psr/http-message": "^1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0", - "squizlabs/php_codesniffer": "^2.5" - }, - "time": "2016-05-25 11:23:38", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Slim\\": "Slim" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Rob Allen", - "email": "rob@akrabat.com", - "homepage": "http://akrabat.com" - }, - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "https://joshlockhart.com" - }, - { - "name": "Gabriel Manricks", - "email": "gmanricks@me.com", - "homepage": "http://gabrielmanricks.com" - }, - { - "name": "Andrew Smith", - "email": "a.smith@silentworks.co.uk", - "homepage": "http://silentworks.co.uk" - } - ], - "description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs", - "homepage": "http://slimframework.com", - "keywords": [ - "api", - "framework", - "micro", - "router" - ] - } -] diff --git a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/.gitignore b/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/.gitignore deleted file mode 100644 index b2395aa0554..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -composer.lock -composer.phar -/vendor/ diff --git a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/LICENSE b/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/LICENSE deleted file mode 100644 index 7671d9020f6..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 container-interop - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/README.md b/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/README.md deleted file mode 100644 index ec434d0f268..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# Container Interoperability - -[![Latest Stable Version](https://poser.pugx.org/container-interop/container-interop/v/stable.png)](https://packagist.org/packages/container-interop/container-interop) - -*container-interop* tries to identify and standardize features in *container* objects (service locators, -dependency injection containers, etc.) to achieve interopererability. - -Through discussions and trials, we try to create a standard, made of common interfaces but also recommendations. - -If PHP projects that provide container implementations begin to adopt these common standards, then PHP -applications and projects that use containers can depend on the common interfaces instead of specific -implementations. This facilitates a high-level of interoperability and flexibility that allows users to consume -*any* container implementation that can be adapted to these interfaces. - -The work done in this project is not officially endorsed by the [PHP-FIG](http://www.php-fig.org/), but it is being -worked on by members of PHP-FIG and other good developers. We adhere to the spirit and ideals of PHP-FIG, and hope -this project will pave the way for one or more future PSRs. - - -## Installation - -You can install this package through Composer: - -```json -{ - "require": { - "container-interop/container-interop": "~1.0" - } -} -``` - -The packages adheres to the [SemVer](http://semver.org/) specification, and there will be full backward compatibility -between minor versions. - -## Standards - -### Available - -- [`ContainerInterface`](src/Interop/Container/ContainerInterface.php). -[Description](docs/ContainerInterface.md) [Meta Document](docs/ContainerInterface-meta.md). -Describes the interface of a container that exposes methods to read its entries. -- [*Delegate lookup feature*](docs/Delegate-lookup.md). -[Meta Document](docs/Delegate-lookup-meta.md). -Describes the ability for a container to delegate the lookup of its dependencies to a third-party container. This -feature lets several containers work together in a single application. - -### Proposed - -View open [request for comments](https://github.com/container-interop/container-interop/labels/RFC) - -## Compatible projects - -### Projects implementing `ContainerInterface` - -- [Acclimate](https://github.com/jeremeamia/acclimate-container) -- [dcp-di](https://github.com/estelsmith/dcp-di) -- [Mouf](http://mouf-php.com) -- [Njasm Container](https://github.com/njasm/container) -- [PHP-DI](http://php-di.org) -- [PimpleInterop](https://github.com/moufmouf/pimple-interop) -- [XStatic](https://github.com/jeremeamia/xstatic) - -### Projects implementing the *delegate lookup* feature - -- [Mouf](http://mouf-php.com) -- [PHP-DI](http://php-di.org) -- [PimpleInterop](https://github.com/moufmouf/pimple-interop) - -## Workflow - -Everyone is welcome to join and contribute. - -The general workflow looks like this: - -1. Someone opens a discussion (GitHub issue) to suggest an interface -1. Feedback is gathered -1. The interface is added to a development branch -1. We release alpha versions so that the interface can be experimented with -1. Discussions and edits ensue until the interface is deemed stable by a general consensus -1. A new minor version of the package is released - -We try to not break BC by creating new interfaces instead of editing existing ones. - -While we currently work on interfaces, we are open to anything that might help towards interoperability, may that -be code, best practices, etc. diff --git a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/composer.json b/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/composer.json deleted file mode 100644 index 84f38752822..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/composer.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "container-interop/container-interop", - "type": "library", - "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", - "license": "MIT", - "autoload": { - "psr-4": { - "Interop\\Container\\": "src/Interop/Container/" - } - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/ContainerInterface-meta.md b/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/ContainerInterface-meta.md deleted file mode 100644 index 90711c9051d..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/ContainerInterface-meta.md +++ /dev/null @@ -1,114 +0,0 @@ -# ContainerInterface Meta Document - -## Introduction - -This document describes the process and discussions that lead to the `ContainerInterface`. -Its goal is to explain the reasons behind each decision. - -## Goal - -The goal set by `ContainerInterface` is to standardize how frameworks and libraries make use of a -container to obtain objects and parameters. - -By standardizing such a behavior, frameworks and libraries using the `ContainerInterface` -could work with any compatible container. -That would allow end users to choose their own container based on their own preferences. - -It is important to distinguish the two usages of a container: - -- configuring entries -- fetching entries - -Most of the time, those two sides are not used by the same party. -While it is often end users who tend to configure entries, it is generally the framework that fetch -entries to build the application. - -This is why this interface focuses only on how entries can be fetched from a container. - -## Interface name - -The interface name has been thoroughly discussed and was decided by a vote. - -The list of options considered with their respective votes are: - -- `ContainerInterface`: +8 -- `ProviderInterface`: +2 -- `LocatorInterface`: 0 -- `ReadableContainerInterface`: -5 -- `ServiceLocatorInterface`: -6 -- `ObjectFactory`: -6 -- `ObjectStore`: -8 -- `ConsumerInterface`: -9 - -[Full results of the vote](https://github.com/container-interop/container-interop/wiki/%231-interface-name:-Vote) - -The complete discussion can be read in [the issue #1](https://github.com/container-interop/container-interop/issues/1). - -## Interface methods - -The choice of which methods the interface would contain was made after a statistical analysis of existing containers. -The results of this analysis are available [in this document](https://gist.github.com/mnapoli/6159681). - -The summary of the analysis showed that: - -- all containers offer a method to get an entry by its id -- a large majority name such method `get()` -- for all containers, the `get()` method has 1 mandatory parameter of type string -- some containers have an optional additional argument for `get()`, but it doesn't same the same purpose between containers -- a large majority of the containers offer a method to test if it can return an entry by its id -- a majority name such method `has()` -- for all containers offering `has()`, the method has exactly 1 parameter of type string -- a large majority of the containers throw an exception rather than returning null when an entry is not found in `get()` -- a large majority of the containers don't implement `ArrayAccess` - -The question of whether to include methods to define entries has been discussed in -[issue #1](https://github.com/container-interop/container-interop/issues/1). -It has been judged that such methods do not belong in the interface described here because it is out of its scope -(see the "Goal" section). - -As a result, the `ContainerInterface` contains two methods: - -- `get()`, returning anything, with one mandatory string parameter. Should throw an exception if the entry is not found. -- `has()`, returning a boolean, with one mandatory string parameter. - -### Number of parameters in `get()` method - -While `ContainerInterface` only defines one mandatory parameter in `get()`, it is not incompatible with -existing containers that have additional optional parameters. PHP allows an implementation to offer more parameters -as long as they are optional, because the implementation *does* satisfy the interface. - -This issue has been discussed in [issue #6](https://github.com/container-interop/container-interop/issues/6). - -### Type of the `$id` parameter - -The type of the `$id` parameter in `get()` and `has()` has been discussed in -[issue #6](https://github.com/container-interop/container-interop/issues/6). -While `string` is used in all the containers that were analyzed, it was suggested that allowing -anything (such as objects) could allow containers to offer a more advanced query API. - -An example given was to use the container as an object builder. The `$id` parameter would then be an -object that would describe how to create an instance. - -The conclusion of the discussion was that this was beyond the scope of getting entries from a container without -knowing how the container provided them, and it was more fit for a factory. - -## Contributors - -Are listed here all people that contributed in the discussions or votes, by alphabetical order: - -- [Amy Stephen](https://github.com/AmyStephen) -- [David Négrier](https://github.com/moufmouf) -- [Don Gilbert](https://github.com/dongilbert) -- [Jason Judge](https://github.com/judgej) -- [Jeremy Lindblom](https://github.com/jeremeamia) -- [Marco Pivetta](https://github.com/Ocramius) -- [Matthieu Napoli](https://github.com/mnapoli) -- [Paul M. Jones](https://github.com/pmjones) -- [Stephan Hochdörfer](https://github.com/shochdoerfer) -- [Taylor Otwell](https://github.com/taylorotwell) - -## Relevant links - -- [`ContainerInterface.php`](https://github.com/container-interop/container-interop/blob/master/src/Interop/Container/ContainerInterface.php) -- [List of all issues](https://github.com/container-interop/container-interop/issues?labels=ContainerInterface&milestone=&page=1&state=closed) -- [Vote for the interface name](https://github.com/container-interop/container-interop/wiki/%231-interface-name:-Vote) diff --git a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/ContainerInterface.md b/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/ContainerInterface.md deleted file mode 100644 index b670aa133b4..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/ContainerInterface.md +++ /dev/null @@ -1,153 +0,0 @@ -Container interface -=================== - -This document describes a common interface for dependency injection containers. - -The goal set by `ContainerInterface` is to standardize how frameworks and libraries make use of a -container to obtain objects and parameters (called *entries* in the rest of this document). - -The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", -"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be -interpreted as described in [RFC 2119][]. - -The word `implementor` in this document is to be interpreted as someone -implementing the `ContainerInterface` in a depency injection-related library or framework. -Users of dependency injections containers (DIC) are referred to as `user`. - -[RFC 2119]: http://tools.ietf.org/html/rfc2119 - -1. Specification ------------------ - -### 1.1 Basics - -- The `Interop\Container\ContainerInterface` exposes two methods : `get` and `has`. - -- `get` takes one mandatory parameter: an entry identifier. It MUST be a string. - A call to `get` can return anything (a *mixed* value), or throws an exception if the identifier - is not known to the container. Two successive calls to `get` with the same - identifier SHOULD return the same value. However, depending on the `implementor` - design and/or `user` configuration, different values might be returned, so - `user` SHOULD NOT rely on getting the same value on 2 successive calls. - While `ContainerInterface` only defines one mandatory parameter in `get()`, implementations - MAY accept additional optional parameters. - -- `has` takes one unique parameter: an entry identifier. It MUST return `true` - if an entry identifier is known to the container and `false` if it is not. - -### 1.2 Exceptions - -Exceptions directly thrown by the container MUST implement the -[`Interop\Container\Exception\ContainerException`](../src/Interop/Container/Exception/ContainerException.php). - -A call to the `get` method with a non-existing id should throw a -[`Interop\Container\Exception\NotFoundException`](../src/Interop/Container/Exception/NotFoundException.php). - -### 1.3 Additional features - -This section describes additional features that MAY be added to a container. Containers are not -required to implement these features to respect the ContainerInterface. - -#### 1.3.1 Delegate lookup feature - -The goal of the *delegate lookup* feature is to allow several containers to share entries. -Containers implementing this feature can perform dependency lookups in other containers. - -Containers implementing this feature will offer a greater lever of interoperability -with other containers. Implementation of this feature is therefore RECOMMENDED. - -A container implementing this feature: - -- MUST implement the `ContainerInterface` -- MUST provide a way to register a delegate container (using a constructor parameter, or a setter, - or any possible way). The delegate container MUST implement the `ContainerInterface`. - -When a container is configured to use a delegate container for dependencies: - -- Calls to the `get` method should only return an entry if the entry is part of the container. - If the entry is not part of the container, an exception should be thrown - (as requested by the `ContainerInterface`). -- Calls to the `has` method should only return `true` if the entry is part of the container. - If the entry is not part of the container, `false` should be returned. -- If the fetched entry has dependencies, **instead** of performing - the dependency lookup in the container, the lookup is performed on the *delegate container*. - -Important! By default, the lookup SHOULD be performed on the delegate container **only**, not on the container itself. - -It is however allowed for containers to provide exception cases for special entries, and a way to lookup -into the same container (or another container) instead of the delegate container. - -2. Package ----------- - -The interfaces and classes described as well as relevant exception are provided as part of the -[container-interop/container-interop](https://packagist.org/packages/container-interop/container-interop) package. - -3. `Interop\Container\ContainerInterface` ------------------------------------------ - -```php -setParentContainer($this); - } - } - ... - } -} - -``` - -**Cons:** - -Cons have been extensively discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-51721777). -Basically, forcing a setter into an interface is a bad idea. Setters are similar to constructor arguments, -and it's a bad idea to standardize a constructor: how the delegate container is configured into a container is an implementation detail. This outweights the benefits of the interface. - -### 4.4 Alternative: no exception case for delegate lookups - -Originally, the proposed wording for delegate lookup calls was: - -> Important! The lookup MUST be performed on the delegate container **only**, not on the container itself. - -This was later replaced by: - -> Important! By default, the lookup SHOULD be performed on the delegate container **only**, not on the container itself. -> -> It is however allowed for containers to provide exception cases for special entries, and a way to lookup -> into the same container (or another container) instead of the delegate container. - -Exception cases have been allowed to avoid breaking dependencies with some services that must be provided -by the container (on @njasm proposal). This was proposed here: https://github.com/container-interop/container-interop/pull/20#issuecomment-56597235 - -### 4.5 Alternative: having one of the containers act as the composite container - -In real-life scenarios, we usually have a big framework (Symfony 2, Zend Framework 2, etc...) and we want to -add another DI container to this container. Most of the time, the "big" framework will be responsible for -creating the controller's instances, using it's own DI container. Until *container-interop* is fully adopted, -the "big" framework will not be aware of the existence of a composite container that it should use instead -of its own container. - -For this real-life use cases, @mnapoli and @moufmouf proposed to extend the "big" framework's DI container -to make it act as a composite container. - -This has been discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-40367194) -and [here](http://mouf-php.com/container-interop-whats-next#solution4). - -This was implemented in Symfony 2 using: - -- [interop.symfony.di](https://github.com/thecodingmachine/interop.symfony.di/tree/v0.1.0) -- [framework interop](https://github.com/mnapoli/framework-interop/) - -This was implemented in Silex using: - -- [interop.silex.di](https://github.com/thecodingmachine/interop.silex.di) - -Having a container act as the composite container is not part of the delegate lookup standard because it is -simply a temporary design pattern used to make existing frameworks that do not support yet ContainerInterop -play nice with other DI containers. - - -5. Implementations ------------------- - -The following projects already implement the delegate lookup feature: - -- [Mouf](http://mouf-php.com), through the [`setDelegateLookupContainer` method](https://github.com/thecodingmachine/mouf/blob/2.0/src/Mouf/MoufManager.php#L2120) -- [PHP-DI](http://php-di.org/), through the [`$wrapperContainer` parameter of the constructor](https://github.com/mnapoli/PHP-DI/blob/master/src/DI/Container.php#L72) -- [pimple-interop](https://github.com/moufmouf/pimple-interop), through the [`$container` parameter of the constructor](https://github.com/moufmouf/pimple-interop/blob/master/src/Interop/Container/Pimple/PimpleInterop.php#L62) - -6. People ---------- - -Are listed here all people that contributed in the discussions, by alphabetical order: - -- [Alexandru Pătrănescu](https://github.com/drealecs) -- [Ben Peachey](https://github.com/potherca) -- [David Négrier](https://github.com/moufmouf) -- [Jeremy Lindblom](https://github.com/jeremeamia) -- [Marco Pivetta](https://github.com/Ocramius) -- [Matthieu Napoli](https://github.com/mnapoli) -- [Nelson J Morais](https://github.com/njasm) -- [Phil Sturgeon](https://github.com/philsturgeon) -- [Stephan Hochdörfer](https://github.com/shochdoerfer) - -7. Relevant Links ------------------ - -_**Note:** Order descending chronologically._ - -- [Pull request on the delegate lookup feature](https://github.com/container-interop/container-interop/pull/20) -- [Pull request on the interface idea](https://github.com/container-interop/container-interop/pull/8) -- [Original article exposing the delegate lookup idea along many others](http://mouf-php.com/container-interop-whats-next) - diff --git a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/Delegate-lookup.md b/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/Delegate-lookup.md deleted file mode 100644 index 63cc3fb0f40..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/Delegate-lookup.md +++ /dev/null @@ -1,60 +0,0 @@ -Delegate lookup feature -======================= - -This document describes a standard for dependency injection containers. - -The goal set by the *delegate lookup* feature is to allow several containers to share entries. -Containers implementing this feature can perform dependency lookups in other containers. - -Containers implementing this feature will offer a greater lever of interoperability -with other containers. Implementation of this feature is therefore RECOMMENDED. - -The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", -"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be -interpreted as described in [RFC 2119][]. - -The word `implementor` in this document is to be interpreted as someone -implementing the delegate lookup feature in a dependency injection-related library or framework. -Users of dependency injections containers (DIC) are referred to as `user`. - -[RFC 2119]: http://tools.ietf.org/html/rfc2119 - -1. Vocabulary -------------- - -In a dependency injection container, the container is used to fetch entries. -Entries can have dependencies on other entries. Usually, these other entries are fetched by the container. - -The *delegate lookup* feature is the ability for a container to fetch dependencies in -another container. In the rest of the document, the word "container" will reference the container -implemented by the implementor. The word "delegate container" will reference the container we are -fetching the dependencies from. - -2. Specification ----------------- - -A container implementing the *delegate lookup* feature: - -- MUST implement the [`ContainerInterface`](ContainerInterface.md) -- MUST provide a way to register a delegate container (using a constructor parameter, or a setter, - or any possible way). The delegate container MUST implement the [`ContainerInterface`](ContainerInterface.md). - -When a container is configured to use a delegate container for dependencies: - -- Calls to the `get` method should only return an entry if the entry is part of the container. - If the entry is not part of the container, an exception should be thrown - (as requested by the [`ContainerInterface`](ContainerInterface.md)). -- Calls to the `has` method should only return `true` if the entry is part of the container. - If the entry is not part of the container, `false` should be returned. -- If the fetched entry has dependencies, **instead** of performing - the dependency lookup in the container, the lookup is performed on the *delegate container*. - -Important: By default, the dependency lookups SHOULD be performed on the delegate container **only**, not on the container itself. - -It is however allowed for containers to provide exception cases for special entries, and a way to lookup -into the same container (or another container) instead of the delegate container. - -3. Package / Interface ----------------------- - -This feature is not tied to any code, interface or package. diff --git a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/images/interoperating_containers.png b/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/images/interoperating_containers.png deleted file mode 100644 index eddc8a52906d53746438e09c9bdf2bc503902b6e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36121 zcmbSybyQVf)GeU27r3-^T)L$%rF2P2cY~B5-Q67uN(m^9l!SDLfQU3mOLv#R+xPdq zZ@mAXV=#n!_t|Ifwbz0=l|>LB-w4GsHmTEQmnpgq}Jjq7&eVW@_u2+=oy0{sK*YUzx5eHDylh@eFa|?mwU6pXn@&g;K}bl)@;qkI593#?4G8 zn?1F|8pg!v&iu5LMF`oe)#lFkWhW-Zz4ezj1}9Z3@?>zrXsMdyjBLm&!#}7DpQS%P z0mhkNjO-2h7f-HMe`u4oKOgzy&mZ0?rMfQ{mdHJNDX~+^)zw@4=CFL9%ZNpX2o^@- z5)wWdZlBhJ z50QT8N{9t*{sBXD!u?Hjv0U+wp>8I@C9g$(O(f@`Irm@Tk)Gz7ot6JOkS9n;@-})f z)2L@~mDG7kRsZJJMmqkD7c@KLXsEw^j6?^)qSyn*6X> zdX*@#`ge+>YI=Gtf~!s1%iO$~dTmoxT-HJc71-&8xrad4>S`0W`Hu3CQ!|lqB6?_m zH^VcV;h-s74LB^HDt3@q9iv)Xi=RPfzJ7V;<~+dt`75e`$BzQN8AfffU5L60M?&|O zU{!$Q8a?3tFF|`M`2?I2&BU81l{4R|?;}S(&EG0rXWR8@p+-O9(nMzK`N z*jc6krOP8U=c_98>a_Q(%Q0L@4LI&1wKIHAi}Wo7rk(jrowO40K$>AZL_ zN7D6~r(hoNs3rG0mB?={YrkxMTYgS#4zqdk`)M}Yb__KiMk?{0Abw5lEVklAbOu=U z2YUNy)BUwXT6S9G(8`aoFLeIlGcxKkur@7F$(}K0e}f47YjBcIdl?XI?i{z=!<^oeb;*Z6(^?zMX$q`yXzp+*^{ z^m3oDu|tK0^|sZbP^coI(M>^!8b9XG>M6+8sNrKQ!vE<*@(x5{9a>CY&!nsMj*KI8}(9*un2W?{9_ir1hJrAmMb2 zy{>s^PSU66ZqnKGo|6q%DUe%$S-GqVF;EBn1}7b7aHTaA2Pjm>^S;S7`xr;3VM$grLw|Jr_O{O8@r|w z;qy4&IPs~fXn4<_gFMI2uOlFwaQyFxL^;z##-ON(oGIm$~wO4O&eD`qw65%Y1L3*`!8_VW*#8BX6 zyrlpDVww-7jm&6q0?rxg?{}@fNP$rET08tsGS=#QyOF8XW=s0JKOvRDR9XyD6hLDq zW#z=#_HWH7V3+)-&(3Rv|K}A)g-Fc?Kf1bU^X0xO{Z4w`yd-7M%}j}(oDa59_qI^l zz9VahXMe2UlDCIIeZE{vi(6XGwbPvrSU06aI5}~>;jWWwjO=)xocrQJq;ZXgE+1!& z20q3Ds7U$0!`nOj3ib9|G1;ZJYy^Nk!MXnU;vqZhvg>+3&;fvAng1ybxE3ejCC$W| zFgvl|b$_#(`(Clb?Jv~nXJdejVfUFy?~IA6FiqXB^Q2LWGSBDm`{Ho60?VDyOG`^{ zhWg^~jMcZ_K(JIC=3w*h0|ptcdLQBbcd<%mE9SXwq)tG*7!w=tQ;F6FQ~OJq1)A=VTPjDGJTK) z5x!Fm!SX!l*omYLX>Fsj%f``Zzj#REwoUqN1`Tgn6%(Ghn=%0TQ6&G_Gw#Eshu|qo z4LEx~CrB_p-){2h%6+a>N#TLWXvW7%U%F`_Sl)F^*hjO6P7&Sa$BxZ=m4Q-Aug5=a z+(Z+CBT!FdYB7GELgVt3D&MJk<5^Gr>?)=j_B(1uS6tvkaWTcGJhS;py=a-tN063(5UgT-m_e`a zTQ%=1?iS<95Ot_KC!+yjO?~?Xt9a|REaCo*0`T;$Cjf4eUADi}@Df}GobcE;Fn{I- z^Ju!#QQwN+60Ud`Td?R=!O`cp&zz$rZnVl^SeOOk}an8=2zEdU?&T(8gsYjXC$j}zqPOA#tcjMML z5*$8I&t{2B6AHl;x;lh)1|V4Lt~!+=<91rWUO$1oB!9k7HMchjKmh=e>YS%GvY9RK~pN;#i`Xh$uLn%K+XNDViO8 z(LY5=$q#FZ#iD+?Q)T=&o()wx-~b7GTk*oNLOxFGc~2r?=N0syFgGJ)A9*k(Ndd z9wbI>1s?FoGxkFvV!OU4mZjl7%4kJ`-c~7_PNHcn>?i_ zrsl`-p(`qrherr(2M$Sr2owmGu74m8Dr?1*r&!=Pqt}8H*uahu0`>{3QX(OtJkNd$ zDpc2%#z;jIx*-BUz2o=RxqP#wXe2&MF`{P759-U4{_iNGqL@FqFeisl{?E*|6pEis z5k(v#{o}J_06+ayjNvbUTcW5C&}up=AT%5auMrptqLib^tB` z{|E@;I%pz@)DEaX7!EQ=rpW&1dni~6A%KftRcUFT;15DUh3r)x|DKJ`Cvslp1{j60*E=H&1tqYiv( zx+8Jde&tCG3=Rh4q4-`N$T&K3H1Rx!V40`G9pq2E{P@X5+)KVrZ1(us>UiK9tVY zFGuYkCKZXpQ=NaBk9IU%4Er%boT67%Hr^n>Xb>MjXYgfBWI45p9- z!_>k-ry80qbJLZc82NZx*{GBEl@JOIzCPVtOO~U0AuEffS&CiOv~%{cV%pdj;(v42 z>3_Kpxz?Y^JC?7)b2Y)TG}5Z?eNG$>LV*E;do2H}j)_U)v`HW(FjoKFkdjs^rN7p`oa_va%nWt0icxKyEFZ z#5kz;Z2@ZOIC?p7?-9kZG3 zFgZ14{xeJ1YbBf{!&W_=jDm$)(y|rcKa16Ty<-NC1zNqsEQ+TH)1=s;mNa4;sg_xTzz3TnJIU#=II0{+d% zZjrz-lY9?6$>lHU#*$iE@0OP4&a*8m!C9f^TR$({4>p- zl}naIo67Z5l_sOc{{fr496PZWNW*u-%JuTXk{IPi&BPE0q-GzC(yq|&{lBA7A@R;$ zqHTAYPj>6&&Bz5Df+p?WIf~fSoUcSud+0p}tcxVSqN(B=Hvt&H16)Pw#fxBvdA;^T z@Vosq-x(O8_}Zx99h4Z2C=y?RRuaQurs_rge)*ubiV997UNnHkY+Kv3Nyl@m1!5L< zCMG$LyYfL|>^1PsuWZ}N+Q}iy5QPeDZn~XqR-i^q^V>8ZM-wnL@sZ~9e#m?ugVsRa zPfn)hRNK9Z(}F7G2B(a`rA|0IbDMDx*jsAP?LM$cPEHQabZWwk#G&k}u^L)-gEy~x zyMuuc@(9GheGdvDXQb=vYuYjUTmVbtZ(5+<-rl-xe!_bm&A(|`x(?3s2dt&qkDQBD zI1F>mpXJy83}1doV9CZbb$ApsAasWN*M6C2xncHPz0 zRb@Ly_s4Zq47h%Zzsl{!ezz2^SlDEl&h1Dff%3*kX5_$t%k9fAEtlN`j@K{TlO8R(`S=_~5UcDF899BtanV z!9sK1_%^rqiKTJ|H}YZ2DNbM9)A0gNKgZc`uL%U+EXHMvcy^grU)ArP`;_ZeqZG&` z_U+BqR{P&xU>~^0Bqa2S9JYiGaW+3esxt3|VC~J-Ve3~Ar!v0mx;kDv?jwJ*{9B1j z#@KifRZK^2>)eOkq>aL&KcSaM$1u3Uput#8qs?lF*kSG)rtihx3nL>VCRsAS7)R|{ zHFN!|k{-6lKHMxqdFlIXRo}-3pv!_Se@a-VOk(cO9qYJ&Aot_G(fup|w3f?1hoUC)toTQ{6^#WO1M#hbD9>LwEb_oy?XbLG+ zo`=SN*VnJ9Oe(bL+1RkPw6vJHxX_U@Myx*<6?NP4Nq*6w<=}vP`0&A5h=Q4&{fvB7 zNlB@@SiQjX*@vX`^vJ9%iuN9ltzUV%Ri?;*JsWv0tSf!f4^WwJc+(#*xaie4`uguc za#VCQ!h1aq{%l{i2?VO#-CoMMxbW=k?BG#RB^;=oiBPNb$X%PjU+h5uC^;#HYVKoDT*cYK_W=G4NLT+1lI8>s=19(31e@4W}_lN zI-ape#B5&R6mXcK$A zBN!FGEpNO%XqI{TG9I{H*V-{g*(56>Lqds(8SnpXN?^zKuHG70S$)Y6^Q~7a(X8n& zt*9VMl(=tf+^?UPe*L=S@PaB)j@_VM8OF$1|Mc|t7p3qK>(killA;{^l@(A1$;rq> zv2XXHT6>7=(fbebz+r% zML^~Cc2O?KPSBcp)m(8SO>OO%z<+Dhs|g|pN4{@NyjD<`{9y|CmF@RUV7O!3l(6dt zM!YP&&-o6+qW`7Q*vt&GFMGp0hq2$WO#9&i$mB9IGU2-4-+lq!lk8}pQ1T30io6Egf`o4H_Cf~%Omzj(pu6t4#lmJwS(%RYEhtKa5 z1K7`hv(y%IC(Fdx6Z={rnr_H}7_OkvGP3-|#zfz|rdO%MD2JL~^1Z`T)qUr8Ew+4Q z)z%|qD{sH|EZtuS0@$2$Zyy+tKkmkrz(^lrc>DHk52fcH+OJJJtj7)QcP}RF@6^+p$ACmzzgHeHh+r4qabg?^=HwO~j@h6^>03gDde*O^5==tXj9{aw(7tWFD{G ziiV!9aO_^d7um8@iUvkTh)POIz@b-Gk^mzhu6Ey@ibh-=N#!G-_U;`fxRJ5{xt3lR z2{=fADNNwHnOd8~#?zl7y;?d(48&Zd`m;+xyK|wMF z2Bo6noGRC&2Y0;so2uFaPO7)jWvvG!FeWl`a)A9gTTAWjhpsm_yOrVHD|o8n*Pj7V z-@nNMWu)I|waqA%%jJS+Y}wZ)#ee6OfkXgzKoCT2=J={yh#Ps#TIDx2&0Pvt7&UAE z@!rf{owdm&B94`5G~{#v{tCgW&}Ku50b-XIB}5 zxQ>0YyeyWN?`QgPZTq)pc#VL9imbX#*Z^mu@{W zczAfs4;NdzR-6ZX8a}3S05<~66;m&90ugTjkBUo5ptG~HZIs*l4NIKhID0Sl=VdC5 zTP=B1GX)Sn9yK?o&*Lz|4GfI9$9Un({Q7$BC)DDGQ;+ECwv235>f7!v4D?201}*W) z1)T^1;WP(c6>zveBDlm3l3H(3ZUAe3L4p4~KUuuj^?EvhE&>n>?Z39&x*P;z_vagK z@v|=&dqLJDJU>52q-Q!Yu?3O_n1cDvL`i;4jmE^(R7^6x+|B(|mIHr#!-$wy3hdfv z`aOri#-;vrr3n{1acl&IR_2&CRM^1WJ#l#!AO)vb5K^r+)e zTWH9J0KBtrq#OGT z>KIH?oC0vHcHLCb8>UJ`*DfQHEr6ynslIPbz^=HRu;t4Td_%=Y23hpk<(Sorb7~+r z3B2P6WesQRnFc7302Z1gw@%tQPM_M>=^J{lzXP>A;^frz^>>u#}CCUxYwIYdxjl_xyv$!9mZgNioqi?%DHpnYy~ebq2IrMe;TuO?x*xLU2O5Lna)m0K`9uE%E&;N&P$ZaWO)DO z+hJ>7jaRRLc}A~3UV>h`wq=<0gv-X?$Nibj-T;8l(grbP(*ZY@(tRAh&=>(`|JAFL$+H3V{o%tE<6h zHT^@QqjK)<{Hg5uu0S9}{&M~eH@wKlJxt^pK)7Ww#lS@0crm>rohH-@>zJ>g-8c zjJXPxKZI0ORk<$q?|a;Oq}l91V&mgcku#ODAB)G`l`3lhay$@>`cFD$^Rc7M{K z)vmlW^7L*+=8ao{2-T5%TQcKRa(xWP(Rw-mr^W)6;U<4QRXkNTzkmy86m@non9 zDM#a~64{=Is=m@PGS?7f8Ch96;F6LU6kQr6v%`iD#kEO zf}huaI3$W_r6R5-rL%YWb1SD5bb;Byxu7KWhqnJ)=K`Du_m7ij`m`i};Kssy|Qjg43289C6xll=^10RLJY`{O{jFJV3=z0LqBuy-$k_4>%vNDiN~(99j{y7+8R`D+Fwg=} zubMDW!>%9#32ciSV1#0K_uhys^qSlAfEf9s@_qPlHOv6B>`Mg5g0wgX_H^_N=f3LjQ z1o^(FZrV5&N-t{)c*50IL86+TUNnzI-_?6P@1st1E1NraRNBW*-`9!bs3j2o$`2sV z1#CsCa(WFE6ta4HA1XIjD;gHNLQt`}?IxIku7pe-_>TvOL@wa8)=q{%!76(8ORDX| z-m6!ys?EC5{%&lT149;5Kn+;i6~Cf4c}r~|ICUuaQco4gp^ALZ$OA8 zeSF}uaiqZrSOYT&IWHptwE^f3p`c9H)YR-)aqieXUj^{i`S1Fa$LGuz01j2I-wEcA zp&=fy8N-0Iv3ai$=`R^I6tcaBOt#DN@N5C|H8)9v@+ zIwt-^Dn$f9dKLqc$F3)_rOgd6EJEm2{>X<31XD`!tK~-&A|6jbHAX7vM1fd0s2x^M zMUdoO}=H})I{cIg*&P21y;2-QK4S1x;L8BB9h}x$!va;C!V;*t)pbiC! zl9E8J2om5DyqF11T zMO0M`>4vM#Zww8yt~MnewgsENgAxRYCj>xrxXfH*fy4FLjay~}Lw$xuw}C`~7m5Z+ z8L@enmIiyzX~dfOViDX9VDPQA*PH9BS4Ap_@?^EFvMpsq5A`{q3D48szefxh+R(8N z$lBp^KM zqGDrT{SzF-<_h+Dt$=SMth_s3gbO+zqh~hxDnv!o^n<3)50AKQVVKwP+JD{5)tznZ zs7@4=m8A_0DcFgzfw;bW>@~M{4crds1Y6+h2|IoW7B=>%z5^u`irl<#(7>1tQvm5S ztk?XQ+(WZ$k~?#xt@aqnbYu7fqT;LaKDB1otwO?yd<1M7IlbEpPUa_^U&?j3)%P+& zwg4o66xfT(=>nhxfEoedBXH*MCCAaTrjOM0Ku`j$3}$BLBZE-&6c~UYglZ3J`r^`3 z$rmq>4LPTu`ep(R32+iy2M1|&_2f$8(u(=W@bEk^AxIZM`jNDzD)`ikTh1UABs7>mkw}1S{)UNla(xEC%(2Q0+0&VF@;P`~gmlL;GvgLH4uk zqYA}vuTbPZj~uAd1QBQ=o+F7m=K6fp$fV5g{abN2Y<+Mf&m&5n%pB$j5H8&$0HIk4 z(K4JfGm(=gKQ)WE(OfX*N`(sZnK1gVbveLNufO8x^6_QJ7!pD3Uj@)}MGS2We;z(^ zK(3eu!;F@FG}9oX2qZG&@Kx zNf$te>*O)P!;8JWTkcy{&&;1&K4xTKH1~4*hG^Dc6jzBXANlxWrUP9rOt#Efa{}=^ zO>gf`<_@!F%Huj%Uf;GR90q2D_G)KVIsu0FIWpX(Uv42`Nm#?M+?cD`cm%Xw;R@9+ zjT_#XS|*FSOH4T=uMX>9Pgng|QDepj*YXp2poifJX}@`qHyMLpX0)ADj1C@vjIm#+ z1&>Wd!G|_ZAXpA%#bHRxs5D_n>G_2R;Avq(k}`Y#xUFSwI;cAi7Y(^AOasNfUfu-? zzn*<@&Y3Qmj0Ya75N9;_%p4EvoH2LN&Fp`a4!Quo;B!%v(&WB2H==F- z6Eukli3+9%zt$RqZm}dJl|w^wmlvv62~Hs|Vvv}HRdQ(63(>811ic*f|I9uC>>=}C z|5*)j`Fgs8Frq`JZi{*S^lv0kOZ954J59MwJA#lw{kux{8M(*4p1!=joqF3U^ zMv{b}0NC|6C=OSSy{bU&M6|*H15u2eaGVJUBQ{WnQV^{>Pfv8%H_&^`xfQ!Nxh^ID zG*ESt&`${yI)$TwR_Tj?fB?aWabZT)oH+Z+R^nRg5lJ92%nG3ijfqB=-~}o6jffH5F`7O>A)M|Gwa&ldFP~J zd3UxYRz5@;gHu3GJDzx@YIb$B;y@GKq^qa*G$-)hyXB}0+Zi4j7{FIgo%a$W_;SMt zqNEW0hRJIolA6BB^NrP`-8{*PJ6olpGgg>gJ)%zl*wjkqo3_p3>=--O55O4dp+ zqE-TXq8KY}mxWnSyJ|X7GJ4|+YI1Nw8N4<)h$a-z>V?Jam}~Dl${rbC@vy#qBqYtg z^ZuMAbT)-449Y9ms-oO}*-@E&0csckpkT$Dg7SSiIaJ3Q zexOhI0fC{7EOzRL{l3@ETI=2_(+(Oi753(nj;l`0U&VJr65)7_YY8GpfCF_CAq{a? z-_anEHg8)=PmoB$>vreGooMayd39^2M?xy@gs5MLoOiQTwxERO?H??5ho3hdF3ryZ z$08`}4&6+r?D)9Q>+Ji_HyCtC))FNWfQpQof7*W$iu8#`lo+LmfbEq9DvT@kZ?i#F z9W@E7ZAt~0?YH2p=`MZJiM|LiXm8Fzu;@_Pjow9O6-*v^-H8km5D-*@z9C>xsB|Ln z`{?|xr1>%TSg*&Z(r2pJ<%9%yW^F0GTCWXbAIdn zILD-(I{aPyQGKZ*paY;pV=;^}u27h6Zc&=4tpr?34Q9Y= zJ=_7f?)<-bktIqQvoCd-^!eCdP8#zrnxF>nHk;LsYT%+??pB;xoDbRWJ54(d11?2+ z6I5mc)Rf{kU{S=)ZQS+@sT|>`z^C*==w_QhgKS=uwc@q2`J}201WQJSMDoy~G(I^j z2=;g{;umT9;UEt2g!z0P1grf92yD(kcVerjKnIH)w2n&Sn6;>yW+8>}V^3TZ)IOG} z;rBfFBhbKQ^saxrHZ*OHQ2PNE%`Q~i9VBo2VgG4byQ73z* zj?!Aqi^D2rQYb%m4`LR-QX%h?zXC;vo=vU5#U+EIig|7S2+X<{i5uq07xQK_zv(&t zjrK%2KCHC&b9f5O49qCxcjerW(>HPvI;W8VCnKxGCVqvoS7@vIk_SB9gwb+Qz>DfP zIt8@yISQ1Sbd&Ca-!z4u1FF@R#gD`fi#+B&=%9L%+YrCZ6aZ`oWhOw)AmK7Qj{dHw zfZdAJu7Ed)c$Xoi2BqX~OBtE^ItcmE+@H2PXDdND$!vxFce!`#zp8E6G$};&(BF{9 zTS-cyXqFy`wOQQ0aMUPq>6>j)P!FC6a4QT-6lGy48QEWVzi>(jgQtFVAASGxvl?t- zmUYJ=pvd{rOVFi?Lg(11Jw0DH;yDx- zm%Dzdkm>k6KHhvckhYJm?u_~Qzm5L2(KjwA?3^7*R0JxAcTwLBzkk2V39{Y9qtuHN7Z~6TOpuR53v{*HdqTG1hR=G;5Ow^heltg^56 zIOtyu8oN<;r2loDO(0%)-PhTgr|U(Vs>3QhEtuQI#jd7r0wC=59ZSN-Sx;jPtgUFp zH4-T!*^d8h-maWI_F_{NQ(^u_y@}7hAE{o{RhN2eI@R0yNozy74!{GmR*)%8n!jC4^DZ9IaZU~HpL zWH+H}B((lhza?9gJd#rjJ3%OKzM7TG>LBjLvRAC^cK3Nd4-G$xPMkvM)<%HqJHYp~ zUT`S(nPMPk*o4m;iyUT6VE zD3LdTIHPaWsO#GQPKTsse5(FTW4D>xBRge_A@Rz>EX+OVv>iB}zYFJ&=u8;Y#@kLM zjEI)Pr+IwzJ0`Ry0^fE=N?21jQ7Zg)z9sOpLg=tDlzW@M*xrq{p_odbD3GL1AH}El zgPQtg(8zZ1i?Xg|@bo%AD+R~vBN4~N;#aidzmX~mOUOmVe+0=!l2auGM)>X>Tk8f1ZgVoWWx1xZ)OrPbwtPs8lm=&RB2>PiFK`&{@kG?lc^wMpkEV?5cPXKZD!Gs&Ooi))w)LGD;1x*8H` zu5SN?Q*BM@^x;EvEP9XBmz1Nq_P>zNmQNn(4{wRJm^``vMnmqKIKBKq^|Eu@DdsT0 zjmOJ5KtTI|T~aR|(w;qq%V-okQ%}6y>fUcziEcZm{zt$DNftLMQg$+5_RBY9uCGEM z;>JaC^8781imqp`JZzwUjDt-QltQ&DBxNcnaa-C5+&Rb&Wt++0REW(TjE2aw0I%V@ z^!G;gtE)pg3<#w7O5-5$QwGWTyZ0F}1S`V<74zNWCxcNTFol^+lZAsXvdVBGs_S!^ zfgPgYeM z7NeB7Fb-2?$ABft8CRob;_y{)H28S(#FSQK_`9&u#gUcI8ioAuL8suvgU@5aZXOXJTpc4YkqfyLp;Hx?F#>-#=QF4^h^G}+)@vBF$3n8Isv|!5Lb@pDHb(E zurqxkx-PyX*r%%e>Jf#dxo7UW5UiUbX`0GLHvAZT97<5Nuf_ll8$j&%n*Fw+t){8<0ZG&1!&Z7go0HC zfeULsvUc_2ZkKWR`ie)DA|+_p*xEr%GdNwF;*4l`gJ@c+Qp;ke3KmC6n)ps6*7DFk zPA`)B;{D3f(ni-}pEIU<6-Muc#Zt6>F$_~sc|SJ!&f;g;olxTmde6JPNFy&AOk^b& zmOfmHu>Hs~LVF2iAO1qav?uQryAp2|$F?wrd09#WCPs#-VHl|@^*?UEQwZrra@7-F;d3C(xR#S~CfdfloF~jww1cz0r!jL> ziQbD^Wc%nrW?b2k6vw=D^t|>rnaJYpJu?9Z1j~nZHULRTZw#XnZ*w6)SM_Bfd-ji% zQdMFa0mCBOTZCtv#qj1e{)jldeBVj1l^UkrTxG*1kAb|To~kn5Cfi%AL(eIRTQncq zrC4V2X!isoi}_8*r*HCSG1#GsAr2=Jkwd!;vhU6(ER*!(cUr7Z}{1nOv8 z-|Ws}_+Kz6sFlD4v?L9x`KgiX<3@^K(Q|6x0x`bP&y7oYSS4+NiO~?fPBCQmbGSak zpdG)WorCT2-*iGii3a%lt@(SAIaaIQr_-yT_Rb|j@65S9{m@!ayd14K?Z|x&dI~|k ztexcC)M_il|J|svkz2l4)TTCHz3kI?@$xYQOYhiLY3dbbjC#?*FNf9?nETcRVE+w2 zfAsY1!HTthmvpIeO_csLiO92Z7?C?mf#rFoJUtLtj68v(Uu;h2XIrsLzlhwIo2Q6i z#@KelH2~!q2C~dt;{BlYzvI&2U!@E!P0vWs!ISaxVtaFEB{Y@!jTlCpr0EGTK!)!TBtLVR=&aEPvee0)a8Qa@P30?9ZWD z|`>XCZpS2smfM7Y5&w`@D0QY_O8WCw4Re1304l;tMy-W=Pux(j;&&n4-GB5WaZeGiOePT*gm4t=O%Q4qWPVz zVV3_fhLy>D`PBhP1_g6*@8TLi0AAudR&pudp=p9Nq&RAd#LYL9@qcX}{hBRihnm0Pxyp;yrs zkmOJx%^;4B;^wd;&vI@;eH_H!9P9kr1I33aY~{mJVqe6gFSb=p$&+j-1!z6UC|(vX z7g0yoSAkdlC7v{UZU=M98Kb__7zSG$Hv?`$s6FR=WXZt@QRrFF!Rh<4&xDNhDzb>C zHvPL&D#xeoZ^zNI3W${U(0pxP{_vfU$lW9CDIZuwc=Db3(Z8CznPh{>mHw&XAa4R+ z`gP4bC&f4@D-k!~Zh=`M7{nodU zbu|SVl?^3%?!GMn{(p@tgYaI~QB*`iv>k+_kxP;h8}(k}HTCp9IzWu@6R@ET~&z7X%f1exBuI2~j=}v*z)ks=E z2AmxeoALaD2)sju0Pq=W8CPw-AE;vk&*Dozjh-k zd2gZc$1Jh?kq;MrRir(difXw{@pUavx_o_DvDNiL1W6u(#^`U?V#ot0U++gge(qY@ zXu^Q}f#rVO1}SKKKUlUPB=gm;$NUOWyoui~f%XmBiwmR)?cljhdV2cqLxZVC5cLYR*;Q$5~wq>kZyDz2Q>|UT{L$IR9WI=j*caEd$@RfH;FXPNk$Y@a@u`mu! z)PmABcxO3Ek9?f$lW|4{xSpANmJ z`lPNTAH&mC{HkDaL)NN-GDl#s76{@7mDdjaQz%<5Hbkw?^Q51d!miKZK+4bi`t?q! z*N_=_i^Z*rkMGTK{D5c+fV(%Z4hU%a&layNd^yXC1FsR(U8ef)t+5Nrw2=$}&8z=9_9s(TX-=`dY z@={l0BBxEmk*-E@>5&jSXb>2vpP#pN8zt`c?vE(UOG_o1;$18h8(q0<43W7YH1sjQ zHLIGW{l3NIrAbCu6p#EZqR>mZ8jqFeqfXkC0V{2EAsb6?vsu;Di<2f=WQ;PlzWW$i zFMgZA(Yg76vmWWvA|L`U9Hda^Mh%V9+uf$TvO`WJ))gUctfz`BbEt#6XXl235xu$1Y%#?UpzSwhf6t?^OC;do z@5eLvfDL;2%5?c(@xc{}UY|~U@Lu^7-X(ku{p-<1Ow5)!qj^~MeBFb#kd8#wzK(0` zq?nIcl>#NtoEjDJ;*v%j>@kdX*=$Wl+NhjWU_4z@L6T;_hxjw$VT6uGXI|=Md1m>f zJm=5gzb@A)6+gmWRDI01I(-YRBLQzUYRei_>@|&$x*#6~}4jL6e+x6VI3X5ojwF;wB#Zx`)7nGdL*D0eFMXpodZVQVm zE|{s6S@>aEmTc6}z^cMPx5FC0q97#n*UpRYW$lELZRxtAL_Ov?v~`&;W96NuJo^In zyXpOA6PF+IUX$?f{6e)3gzBwc>-rA7$qmb+bKwRrpL2%m`1@SvWz6}ViQR~4Ix(4- zCU)AEB@^|f7e0whcO)`G3h*s9;8(?&DR(zxg{te|vl1m(tH?O1g>6K6{4Yr3vdjOmwuN3xLdqDoviB^iEnI4 zc~6XKg>D&s%%DKh$yTi$%lQOh>55TVw;G$+D8l7u87|znI?k_OwvBu6If=kl&d=>8 zKct#PD>{BO%h^IXB9~rJ4iLy!ve0D40WU%T$tOv~w7&AnDCFP2t^6~dqblwkI5J|= z2yHO~Cl2tEnMM>W@AEVUp>^D8rr~S}wv<(usmkT^Z17gGJ6nm?C^2G8idu=w=OxVv zSsTzIIthE>ysZqul9kO1LktSlTC81PZHkiq%$+zDbSG6AJVLrJLcy+hdALspH&L!H zHmEz8U7f&{CdAn5W2PW|M#5=CT556giH99$86GvEkWv4t!A>l+Ma^|5@?mt*KeAtI zVf#_wXzQy9-^znli>m5)9)Z>{d`V&qhOi_Cyp*IQBn1!5Oq6DF4@`v_2IP|=Mr4a8 zc?1{&eWcF4GEOyCgYPF}wPb(WS|5nDOIY(w73(jgr~gCZ!+&>)@C4N8lYbVzqM@56J>J$Jo#-&^-S zmoC@9{J;PHYWM!_B&T_ywHYUPyTa)#Z3NnA3O|xLzE1m={Qj90$;Dl?S$|O(1!l?P2+hd1H zOUttUq$;~)v9L>4PDjRa;is&u-)>;MXIb9I{s`j;crSA{mOMrMYDdtF*{Rjn*WQuf zL*Vafj3J6Fhqsfov=tak^w}lS6OD3-Qdtrc$fBT_h+8xS6#rCieI>w_nBbEiu!ITm z3Of&A7HrWFiN*>!28iIsJ&}JXPocg!eA3o29%9{s(}sWv4tl*~Bk;Q8L(eIZWEQ@* zR+Bf$vFnpum4!?sN( z!_{Y&`#tN1NN`6cJIkKf*7bZfcTDG@MU;pA$Adh4_YcZ6fd`qugQ87mLZ!DV#D#7pKH=#*q^U`~% zY`ks)jm2zqK7(IU$ooI6W4Jil(tyFN#^3sfkL5&PG9DETV$UzH3q#7@6nk`f#|nt3tZZ zA73@~g=%5upK1q7Z@7*^vFYCZ)Wk@J{_2THfUOYUhlOb?*k6Zz``hQZzA;bZH1&SP z@IBLZSQu=!1>1Z`JhWu_GsJHx*-ow-(d9QAeJmSM4)XQtCn7qAL@_58rF-=pktzno zsmzDOA`n|8(%s(`he2hwa8Y3_rz5R`?-jueA0JJrq4)BDd=fV*y3ftiMusHxZz`9U z9MyDucOr_jqXXvp>s4I$QB9f7)fHOvRhxd#a|Za2pHia<17!>hbS`t={hsT_-nYYn z`_9;WI@@+0=sQNaV^p z9a^U!>Y61VgwE@0;t5s^+-XFjqK0P-J4$o}$$J}C)G=s=&o>w(f;e7#u7#CGZXSJ} zs4u&Ci=u7Mxc1;P#{E@5sKtHvMqLW;K?T{Yr9@9Snjvn=e15IN8HG~i)8)(lS0h?l zsEh#P#OKJ!thf&Hax@p=(MPD+bU>O^Yv0w*kS24q_S|8ifI&JS8V9-EB9KRv;<@iN zr$Hz-5+sF$gt2i|*o<8_ys&mYVD2xrHWQC!TilnR!iih7*&WJ5H~FsuRQEqii1n-b ze)LvFQML=yS9UpJAU7S2Q;Y#=*$Hp>*J4}4bYUdBrP3lIS4M`HdHdx{cwgTOn}zhc zYw!GWE}Ao32-e*qiSIBn#PG%FsVxq~#OW~PMo$VO{_aBMHsi^c`9HIhaC~|%93547 zT{|M}Ij!{%?sYM$q#Ap1^S27g;#3zp24OQ1>~c!3{6V=LU*oX&*zF$NF(9UeG`QW_ zoP)}NB!tV!o+OuME#-`5`sb?D9Sr#%29b}}*Hh;NEjc{Cs?ILSs;sY{w;r>79TO=V z5m#--WDu%gtfDCWD{=z{Afk3dE;YpV;?~kT;>5+UTYY6$&dKcMcDoX3n?c33&n;tB z$s)G297|}_4QpKY-7=W1r)LR*vTf|QDE`om4quvXy5jWh&AJ^-;!-Fg?b~4O z7j**@{YwPb+cl`<{Jg{fiU!WOxh@7(SI9p&pu-|QNfrx<#Y5G36SxAP1xzN`-SzZC zePVGOvMrCF+bF)0Gmxao9tz#UgW-w|gK7AY*YW%*ArOVN*(L*4NWw>ZS^b} zNNeq6-9Auc=U$v)j8(^8$q(FB-qnd0To|xxe$$QmF<(daY4;K>V{7teoz7um4C_*) zZSBZiwZVttnMzU+n0yrlv*_Qw1#A1BgO;Z7_N``k*qbZQ{fOLE*R1zDq~u=aJNs+i zxF>C8vNx~I(|PFm3GwY)P=r`?5Dn!Ifwc6)U|)a18?L9QP<9Zqh2A2)aOC5Bf|>8V zGv;G$Se>xlmaA{KIdP>`yNmMM{*suBgk-;_rhV-_^g^WR`_>k<3q_PZKRT7bQ^OZy z$@UqW#RA4EuR=tb9@aOI?RJO2IV=>$JO1PCl`CNG!j|lS?~&C-#~a@+-;tb7JSD9R zx%f)SN)2^2aCJ*J_+(9dh7Q5-PthVmR!1y;ig`hpkR4Q;gF2TG=UecU^l=AaY7K0D zZM(B1b<%TQG}eg20;g3(<))x;GzCvRIjvEYd|v69m}S?5??YPv z^|iC$zaVB=lWhhO{60j2Gqct|`imR<Jt6;&lzi= z1hPQG53Fbxvjp|Qa;8Is&;jV9e{!A#ZXAKo8xpe|jEq#90>i)=e*v|NmbMwlb6mCf zg%mc@_^)R|C=hyfO5MH$Nk_p&`IktVPs*pJdK;FQ<z zl(CX4zxyf0ZE)JC{ayxBrF;6oD)~=bYMOgUA8=HuiOgxdaa3My^Ecr}M`J^1;3MN8 zBO{ZEbMVxY3Zo>uYMqzV*ESCsz|SOQ|tu0dF+=EsxTmkFL)m z$TBzl-D3RvjzOWXj2Z52Mvep{b0cL~&+R$(_0pNW)R70Z%WO-Up~|(1z2h;)u^jY~ zRxsjE=ATs6)Pu4fL7Mn9Oj6>y{>XdP68Z?4tOYYuLd{my7E9hRuw)Ad$FC&y@$1KW zBeED65Ggep&F4V_4`p2>)NF91{Bg*GxS#*iEb-f^GJ^aN`LTr*g`&?KK0zND9!V)s zsQ)yQjPPgigtvO-NvQ3p+F<3oG7uzFgd@<_mK+5~8vjjC0^+9%kqtJfM2Yn`Vn=tL zU89og{82_vQiBM=2x7w}M%K1*^<7urxt(Lrbif(;r-*z5nv1MIGFgza1S3CVJsOis zMxG_+0;fq8ZWD){Y6c^7kkt`39W%g9sABaq?(3}Ek&9m%Co_9ML!BK&0DTm+w8y0O zgb$|*8Go6i0->+6r#%#mC3=T7Be&XBW^OX$8VHwqfSl;-6VvhmM;$qq!K<3FFsv1P z=hG?*I`kV{4yA(-H}3QCA`qloI;WANviJ-xlreU&mA;@jXN*1h&LBO8IL(pW*nMv;aq zKJ<%3_q_YB#$p-E`Lb8&!R~1xr{;54$7lAMOEqNL6&@<6X)EJoG6ZOD1|kpf-{VmS zwQe62xL-$CzSVi*YV}5#4)g4d0DhRGtKbfEv**E6B{q5JBaJRoe6JdW=De+d&&BoC z`2~-C%8V<@f~SxgbDhPjxBgPebcBUG(fal{Bl*dq?0jb2AGEDlOY{ujI{XwA% z0ngdf9_LI{iG><=U59N5x;L`1^2NvkH69jgE07(p8iY(T=_-xv7cXM_BH2jap0SXk zeRbiUR>Hq7>}EOLXugDy=0C&zr2(_yC}<(a!%XU3i8ZoU^AGoTdRMnw1|gq;WJ?U6rPyk-i9{(vd4 z83@1vt#%g+z!}wlS{t5UoiZDI&*yYkf(Y7M5YEjQ2(6g5c#b?3+{qN(p-hh!FBNaE z{K;rK8LmC!+R<2df`%(Q96|Q8+{S`m9gn)zU7b+4ruKpHFs%S)M1f1rr< zycz$TIb9T7+RGJb%#!3d4OM*GON(&$1WEJSQX#06?WI-SC z*1Cl@<(31s2#5DdiHK3$9i6sm%#{LC+-h}XGiXhKMoe4rC5_E3WOMfN$dmm9hv_i@ z(~%+Mo!mU|6OY^x{7uki)y)s2lZ?!2YtBQt?8aOQdmrsE79ye$gRkoc8}~~er@!g1 zGsJVR`V(wD!B~Oxv~I13RGlug(4 zz~P8b@wbfh^xA_1Z9hFczVL}fCBsrOIoQcU!9SwY38n&A_gZN3{jLpj)kqV8yNxTG zE;0PEK1A#2z2kg!C2@t4#dsYru-wr?4cj)Me}|9#Yq3c&1trtK@QS4w^e#{xHg@j& z+pWXSjOY*hUoHPPooAjO$QkjAe)Gh;e&C!zgOF`h09Uohd zWq3pik|m;$4Ka^xqS}nu{Qi;tawyv!QePrzB_`dMIg)8@ByWiQechOK@qq^|Z8*C+ zvU+H|u=9ugvg*Y@95Q8$q|rx4dYD~ydu|4sq}d3R*xNI=Nac9Tq5C;e0L%TjT&SnV z%Iq!HJpv&hKHx5B8{5G2XvIcI{S^90&vZ}J{N9RL#~0-4<8n8tK`dMe%60Jkn+e0I zjc#b?7atB1Ae?}#1cDp<#~69f%>TDP*5UGjU9>L@@BE>WA)JcyfnVv=#Rbt+^*bKZ z`HzN1oS+8?<_^B9+MP#-C5_NWk^DO_P1$UMm^{Aw)IkWyhmM54;Nr7cO#8mDIMD(e z`4sLaX}Qmw1^6RPsynheyG_Ppd;)?F@To;9fh~wVtfq#0Al%J-FR>6tL4{Jl{MsBZ zl^(d-%RKA;k<>soH=ckiZmIMNYgOz}gV+0#2}|t6tkbLeJx4w90ctQXCZ(dnb|y?; zECLB(@oc+07sBr>qgKQK2QSSiK3>SLs{S7qb8A z-F{&7x)pM!D187Sn0MykCS*g~cFpF{i$q059d0rr_u190!=jQJ566skxxHZYI@KjG zbfe%NGz=JT@*2_A3JwaxSG%0fTPP`b=&`c|45MH1OoIDc42z;8BJOcgZ)c!yLJ-V? zHLLUlz8fJ9w;Y+0oHk#>{%JI=2&(HB9red#Q!y)}yruuytXR1`6RMf_{)L|ny=QayL5 zGjdPVZ?aLO?kAS?q|JUBOzyCXCGNW!6Z1qfxwoOd0>}?%Z^TLKmV@n<&{!*_31QwV zr(K&w!&>@0D<7D=iEH|4ae&jzc&yQ2#%+f+gcU!Dj~!asozrHlQ|2ix#7mL#T#_J% zJF!&4;Gk|{-5;R3EOilqN2kTF&pSWe8!uQQCr>lB+9q(NBqnVfa`Q~rVyHs4_Gut~Jaj0*69%FE^onXH zr~1PU*KN$^tE_@}pHxr&%x5&r299&2yi%(BtL?0%leJ5=7uxttmT+Q=a3Qu%?ImZ@&)K#EMbiGlb=4~Bqqj8wu(DmT&S9wO6}4?$ZtD%ZZl9J_0hRI z)6@{)0)bvt2jMW@9i?AODk?}QfU~$H^MkVU2?1?MS^ipduU^ID`k_$p?NFQN@7Z4m zpD#Hw-u2zJZM~PQNacF$RnsrE>GwO+T1=@|nICAN(g$3w>q*#nR&U!`Th4G~lQ#w4 zyy#Lal15QZZ>7x%+CBI`w#_BehX54M(pF2*s;$1G$r=0IQ3cT~=VSe6G&w=PUDlH( z*41J0;HB!gvFa7jr{UWEM!9jKoxZ+z1W5io-yI5U?|hsEc&TqvWCiP8q3V_cA);bP zE@a}+M}rrn@~7dS%kr`%kcrR!lHH)A;)pxq1$Fp0vXlfAZF3gR`(p23ylN05z4x+B z@Gw#Ol~~7;iW6wxv(kLOCEpm-77si%DzQY&sAO^JxhFcb9-F*o?9Z{A2eGPlr$o&# z2nv0_hJn3BZxprs%j~S29(@@j&^|FoS#rn()XT@&53;eCT-GlajIBGW-@xCh@fxf( zRS|~I&h6Fx=98C2r=IFkF>|a}35>_H^1gafF@O&vh6$|FY_$f&hV&!H7q%O~+u z{1~+in#px>ML2G0J5NkVS|!~%eG9c)XGI|sxr(_GUj|F~#9G_*P++$^yP+9rUD#Fp z5@W`tI#5hy{{jI2mAnc40Wb|4%5iN&6;!U=J|(q;DqCGIQNDbvZ-Fbwq*#JuPttbw z5h;nWuqq+`?J{%%+b6Wu@^pQZNcG}R(am_h728yxa_!9T(z7DFS@it*V=fbJ?gd-h z;Gw^yhaR3zfUHen(pnoVF}u#}PXD~Lp!4*3$u|&C+tQkToj$P zJjs>SmpR&c@ApA4uF5ORdQBPsF1do}O$>X{s5}2tcfw6}&`(W=vSJ+m_=h2wO!*LhUpv@2$Z8&3QpKgq4xe zZ}((r-)X4b@du)$5VivXY01TV(exV;!Dt}GIb>h$mE?PHmJ ze5+TKr9mje2;Cjk@gMh&!w3VMCLz*OMJSzSZxOum}7*h5IUEBpq*H zQ4eu-w$ILxxT<6ci;RG`&}KVL&?y=W9RMbgANA@u?G+b3$u*S;A?hQe*hIG#V*n1_6Kvm^(rAD|NKhAo&(B8)2; z=xNwFsJL-zvWGDF_@AwaA-67yi!5X7K{B>rf1089XV&J`T-h5%4F5y%yB}0l$fXni z;nJE_%7ZMk#uGnUWCHzM@J^s8Nxe@SfN&tI;+``s5p zal!*Wv|OqHohaQ^REGDbXUQu<msVwF5T#^t@om7fiRhoM7e_M18oQ4*YKggQp>ADv2IoJY+}^G9xo^Qu#eT zelL`<)!fR7sOscg>I~0P{rlqr@%Jka^^*Eqoqi8bEG#;-5WgqMvsCrKFNU~`Av4TI z>c6o2xUnI27wbn#CB9@Y_`ekMC-E_rd3mPe9pe6UY*2Kc6DrtT^{1mMI6`Zvk!q6K z23e|Ha)eL507VpdqzlA53T(CHoogi?_@FDRseR%>uc;%*w}^U*I0Jxt1hT=ZwztNe zNUk&_EW|ai$^X;_Y?H^Q{6Pef>>!2Vf7`t;arvq|I>M^scf+2ffiaEnPb|83-AYfD zlPMc@H%T}7Z6tKY4sdTMfzwG!LjEBW0Y=xn27=j&8urpxB_T{&JLcfz>g}jXjiGYE z@}lC;0ILX+CADX`6%Hhs zHq7Kq1vpaF;JAbE%*>vcp^FPJ97kwz>aLHxu64>Uy!=*v7_s43x;4c5EMWxgVur*l z%SKSA9;gQK)zAQKaulkRgiX#{M!U>uGs0B;KXed@4!8ebaR7p;*(eI^8Q<{dUt5qE zD&o^<3etuw_E&5TUS`pkx^iqc?=I|3;wDBXR6X?DENd?%;vJXP#tva4O*2M|YeW9^ zw#VG<><8cX5Jz8#A5O3Ccj%*7JZQSN$n`)LNiMv{P9u5y$N>BY$z?aFx8dhw{bY#BSD{uiu43t1pf+ zrpa?}n_v!)_05E%e`{7HQpoMpV`sQT*>K3v(q@@YYzGZ{x0Q{>isDmV^_KQOI|Atj zqwmDasJtjYbRKtL$nc&DHt5Cb`a%>yO%QVgp`=b|O9$H5p-BUQ^!^yh2)GjC-nlCy z09P^yn}VtQ4AyiPuHkNO0FEHsUrBnA2~}aS{-Vf5M}q;p8&(Ir-rk`=z|&?6nc^k! zJfkV8#P#?*t)^9nlVl}O&kB9S^UspU*oy3HT`T~+A59kHpF89K>5_1&VKuwxDT5Oj85&o{$3S*;(pi_ zHGJIqyth@>>?O$wdYo1@{_x}{(Q(Is#+T=T3CNlG`<_oJua?F4Bj#Hk4y^hAc9Br% zO*`*WP6CS83-x?vf-$VI-Js3LP|@y(na2jdTftC#_=@w=>RwP0^f@V8fMTH{h@JMu zEUS+e1=#EUIFJWHsu}tG`TXeFC6W^^7#I>0uh3Z0ir48LJb+~8) z7Py)!bcRh9!r5u}Z<$mzpA#gb6wW^EvIs@ww_Ui~_=SC=Yp`GlTE#roomd_47kCzz ze#8}S+y^MYKn0?M|2c$Y{qK8;i4V8NGAWPse+3w`jL$}we38lO6J(>ssgZe0{JMPV zCR4Hc%Bvx$T~dY?)6un>y7Cr6P=FevwZ;)tvLF9k`yf>SlZKiA71Uzm@FQhTW~`HD z|MpKyV{84`0e4JQe(k!?=gof<0aNVdu1|@>Z{l$HpThzz8+f`(i{)&py!QKwn%3%K ze?A>je^2iG0$e-)&Ds?Iu{P9a-TItnC%rJ{;L+vwUrp9!F1t~%m+YMN*`uJ!ZOo}$ zdZ-1Z7B}wV;Xr6glA-F!Cmm`^4q4EhgITEmphL_*kjHl02a`k9B~YN-${J>OJ88)!Y4@-hmUoenl#P9)Kpk>@hN z)zwqCeu6h$NRv$|;@aqd%g~MAkzoG%SSHOCA>!OyocIoXE?{)pUs{7B%H2>#=ED>6 z>BrR*o#!F_1r9w=rS+;lBnMR7|T2KQ^-r9`g&?lck?kLf@qvl;9Q zCHQP2tkODV-G`YjO1SgV17%L9R;bK$aVLLJoaL#5OQ&T>iz+Q*PS9B%<*hh_Y|ii8 zir5Q1Hl|={aS4p=WGB&A*-s4VM zCL}}1geF+RrA;@VNpPwI#9PgHL6B78U&*@lu3YYVHCLB z6>$yl9NRL$m(_xuY8aV4Oz{HmW_Ofi^h?uXv^EC#l0%5)?4bOGWy>O@}762cu~!fCLd;#Dn@9M<^BX(2%8;7qrPLJ(&%S&!r0)mysDKnAeW@ zy~>TT-e&r_YfVar0!>@i0^~;IY9~JzIG;zBz$#UEis0-mox_q9pDOyR&@ZR|o-(_A zlrfd`PNDZVX+>V>V|oiG#yGg#*MZsSl)_Y1&uX?O%R`~vMr@?dLfE*g$A2%yX3C6B z2X`iz{(I?1eURl@`n+y8z2~c6cjU|1a4QFMGeV$vczy`Q``*fg8%3CTq3UkK6SNCG zMNqLAA*YLu57+k^fOS76lMA({~|4DbPq(zf5_=bKI;*>kEO|gcpkVk|J0cO`k0U~tQW;}H6MWRh++?h z!@C(@#WE-|v(5(v{49p=<%jyoSieWwJX|F;1a7G)Ns!v97`~VPLdpvo^qVGI#`VT0 zOA%ZfAipD63;2DJf^gbI2e_>j!JQ)2!v~KjgGG7C#w5EQsT}DT@Wc9CPP4*=PE#+#@^}5Z@lR*;5f+8V!D7(>nW2>7>kRIiauw> zqQ@KY0|H>AoDHX*2-z*BPD%h6g(-=4*TypP%AtRSZir}fa9#vPp^ zx1kdme4zP+btPn!cTBB)#C`Ic7Ro*S+)|3kt?90LM< z6m9E|xC$^XVz)-~K7B21jaauAfA!*bC|j-9LithrgBL+8G(7Knax(dHIG;M0k2^AQ z&3s&@fQPJp+(Cyv%etjr5+ zxl+(aMX9R;^htkWMhH%fx7J6pP$-8KqQe~M&9q&FcosBl+UAOXCz#5^in*(vu_%VQ zz0Ek%0^>Ow#=zKY#9`F$qRi#3M6qa8Zbd0M3_6X98F7?%dSKy~Wm*~?yeMLq)1WijS~DHV!W_OF-ElortP(0H{}P`FQ`Iu#hYIm5R`*CD z?@yVI#EMe9og{VPNByFkf^6>B{r=|iWdFh&w>WeM{Y1;)0GD6@|N8K+La&_ZIDvdg zv3VWLT3k-!cW5zyv$mP7uby|5#jW#n%tU$;NAj+a!W^HYwR!4I=L;ec_zh2q|0RIPKC|JcQH4{3W;0D>wgw$WJy+4|J&q*cszT6 zAM00}`dk!KR`&q61m3?nd48m-RfZ#${K<)@otkMdq>qTOJ@>Tb<2nGAmeJAC>9jVv zl5F}*HT_uYDCF2`Y_0!osWt(;8?5QqrN~MEn2i*QY*QG}z>$vDfJ!8h#fgKAVzeri zwNxk@EFZmhS4;p&^H?PTIHD+pU??9~x91gBuF@kar_q{`Z?K}8^wendrej7-!pmH) z&mBeXu8&aW_;aWqzR~65YJUO(wSAW6%fEtA%Ze0Qx(}Pq<~jh*;N#?(p8&B$qR^F` zs+J&)`0jK5&h}V1>Bx*vBq2>`UBdh8^Mm~SeE3_TK*g6Y+W-=2Tx#m<-oXC3bL0LZ zZsX+-uE0V%(gq7c`sL>ngEF27l%J4}%6p7L(6PcEX8HpR4^eMl-HP_K@a2E|#*66mne@St zMdzuZ%FA+VH_4Q`FGQpwSWuT;xLLw;BYK$WBRUSN&t4cV~jWU0W!X4{>#( zRpkve=%rXxLq%tNS%wM;M^JNcU<0r~-jceda2m4y=3^r$11`jwpRer$g5=$&XJm#7 zzg0hHl65zq0{1(>V;+6nI~5T* z@Y1f^m+#mxd*5iF`J~wXzTbrV?)No^<8?Lu6yEH*W9JnP1B|IH6r;;Cw{tfqfN5S_ z><-XI9d1r0?lCQUz-|rC&Ds6A18ecEM@y&Yj6*@U_=Z@?!os3=s3vna<u z@p!4JsQ{gn4B*ARt)1qw93(ez?0RzF3F+gfPh4K7Hdy$o@Zj2c|L_A`d;$?}Ue!0kZf+ z>Z7rflMgn+w7>X5-#d{O?ew@z7={9jU^HLK3d^FpI>Bw!;7_^lhIyfOwbSeBjNwi6 z^t&nC4@Kuc5Iv(`8tX7$uNb~YA{DBkTKz$(S<xslg+T6_kO>%)z$GpYlVt3LSXQe#-G1%QQo(tdB8r{$5%#6OIon;^5vJ0 z@fg(;*WUzUbTX4ge-jvkwle^H>s4<#O$Q;wz;h$Vm<7(LXJc;_@?s*eN&koI^VRHZ zVuL5R&C2;PYjjUBuGEOP;MZl#t}@SfLgGXT=r*kAD9AIruY+PDn8$0#;s7 zLbIa39~AU}ptGA)8yhzjltufNCS<9Uj&q$_#UXKXbC&^l{mxS%w-j!hhcx@=%Q2O1 z5v+UeIz*?nHE5xDH%>&hI^ahe>5^C}8MK$GS_TQ}=w5*60caHL*!^)yWH+Kf zBX6nb%?-0U+LyiO-^y}8jLT;~kg5z&VDF}gxmiC$(j!sONKZ0iO`gM*_4!L z_4veiTb~gdcPqer51yHsL2_dy)}BPZ#&ibFs|>UBh}Ej%ApBz!=)UaMZj15_eRTnF zm;{sS^TC0BKV|sBj~yyLKG^mye;qez#GvpN>pka}mzO8rKQ)etVGIvQzq?)oOuG$S zRk>mb1nkK11In+|SKhxS;q~kS&g^h`0+$lj{ukb0I{c+XWLu;Q%WI!$Spi#YxjiXW z)70c${}3`;i3$O&VD8xi=*zRh!ye73=aJLN(!;DaJB6yOU^F5_V2-Ex#7SK}VEPc! z8d~kLUbf%eO^}L*kN*!4uPp$z49eBwCS!~V0r;N#paBn!kkHrX1)t0vyV2E--@hYG z6IKoXRl^TcM>O|EsgRL^UVpe}mFYK+i?oY{|E9Ro{O!FHb}{S$Es^}E?OP~{o7g`y z0DGH27K2quQ8rJdqq&A3>q0~3W`#lgUu(3;NR7Q5FFo)|0F+&0KOa49*8mO0qA*zi z76g2Y$jBso z2JK`R(%g{~4P8k-e*746Q-?b=wW+M7MF83d0<_c~u#H_p2H>k^FD+AD2ti+^2!P7! zDIMA;1bUMvIYCjr_}X=+g%I7RABB16)L zLQhX!uK}EL4~NeICV&U#bOukvZJ3#vEr3R5J%AHN&CD180h4lyF_#}wObO7fcXoE} zo9^6qE4i2QKnXD0r|nZkg2@p{%E)9f)6t=T?j&tLKeK>#mWj0D;#3C*2bLnr%&f*m z03{W4A(3-)69A28;3r!X%Rt);0zc8$C-Z9VjZXkC{&;QhO;j&zmW@p=QCdbOj|L2g z|4hkmz@h_yAOCB&#Hv??5f&B(y75^4{xqiZx`Qz8v*w3p6f(*y`ajV+k`vzYy+6B^ zi{1pV@sF?nx=&?D9T|hmn7%a7BQtq_n87wGjSoV_$r(XVGQrUnEusv?SDe?h1-c zf{ksKxAt*zZMS8O{Zj;`~e$zKasx35NAEar5%Cy+=LTtvdVquH`llgc*;SXY@W zuN3CqIq8z8t;nX`yS8!h>olElyr_UA(FVu;o!Sh*vQ3Zd>q!ch86+4*%;SU(I1*t& zChF>(d)>)Wp0!ww7igr|l)Pokv`3>Nl-}1xZ`!7(NJJ8Zjgc*k?&v2yq4W4(K@4`} z-519l7x{E<`t!=)E;jDhiNiwviR)FiHyu1MF?B+2T%RAJ>xpbW5D4bUOBqScc_{;{ zLO^}0PzW1h^leO3*Y~p-GVX6901q0gvHQoNOkS47kli-uW)N#mnQP=DbV$hRCm7YV z4o5t^e;>2R6}gh0i?M^CnnGCdkaz@p39||>EoCAm891Hp1|)wZA#!A!rMOM4}Ru5#55|)$8d+vWGE#vpU@lDS0QCC}}1Lwg>|z?2J+Bee;Sp zfieixSZQl7?P1^GG?%bvDbhh7MFiTnMAf!j8G0Y5-(jhEHGoJR3GloyBL8}(EVU>U z5g@L}q}JrbAm)9|wO()c)?6m56dWV(%jCS_9jl&Oz!Dp2pwW0RG&e+(siKHoE2bhuI z(z4^okWX~g0e(P_vvNnxT3VNX?L2oGH)7=eQ8(Xn$e+R@>1d9-TkKe_55fd?UDBom zcZXrLjO=XCM6pxBB_5u@`$u1ZB#oWK|jsQ(x) z2`Fu5Z2uS$?y$i@6)MWl@2+&@NmAEa1sK%pvvoRHQ3=*Vy(7D35=^@$z7_ja7%SME za8A&C!g8=vHs&_cKSF6pODELL=Nv+cO%bro$6$SW@}|AL^aDk7ojXbqT{spv268ya zU5bg^4sivjfxs0ZKb%yxDaBfUmF&>jMe>?L?HK1{q9iVf+@^4}-JhVdyT3jAr+Q9` z)ze&itECGm_SZZ?IB44Pyk)r++>Ljis4{a9v@6UVFN@eaFR(=)TS^6h$;c9&+TfDN zGycpFHAugkzsp?8ih2Ak8unK7)1pdzA`c7~3UZd>+R!i!cuJZ{Wfc>MUz4c$MxkRb z4eZTK>=jC*u_4+(f|#s-TI)%0o=*hm#7w|u7*0Qbi>28x3z)c6b~IV&?FpFii%*Agucy+QI)iUbEvmhb+wlXCs5B3A=RU^L;L_g}sDFFrh!c{cHW zn^8D9DUv-94o7PPDRB6JbvF9!iGn?9PvMw{d%U>-D!(K>Z8$e@Cvun1ay0wZfAAU^ znS>AAUGW+#VTZGZit5We8w2ATUHq9?aIHr1k11Cr z$j3roy&aAE;Dgt(+$V$5=im6Hq5>0xN;uCjz{=2=qjHTt68>h-k-n$FS)ZoAK zzL1x}vgC44NkN&73}L1R_3HlZ*mKSr}T=po8yh0Y7W7> zdwE;AO26&l0ToG2jZGqa?`5M$I(Ttu_{IB2PFYX)`^m4c_Q?UED9%>E9h1=52)y2nf!#!kY} z{Ex8h`{y{B=s{Ara!$_VZJs#7ds$9Gf%S4#^!5H{eLslwBw0QE;<#+n@OfN(YG6=G3MXiWG%!6CHdgC{ zIyX4@w)g$hX9vvE_d#~t5vHd16R9v}(V%{kQLevBigC|i5oc1SUwQv>E)eDE?Z(PbV3VB>IgD943!G=Y#LLV8vgsHSA2W?>X|m3K?7j zwadY2kU|v?GP*^sY*q%7V*)CNLf9-GWcmeowrlN_80KGkqXXGkpNpi9@LYREkn#a5 ze({x+QAJ!Kxkc;$Aa2z&_JnW6BA4; z=55z1_v^Zk^>g-7RV1K^$GzOn#|o7k!yDNEn~0!!sT>H7QDwoy7Xr3Ye-nmOE3Jv@ zr~ia_r>GJD>qz!&CgS^>TLyM6$layR3$Z^C9Tz^3$*0lD6CmONK;ok<`>67UFFI~N+2k2Qu5pMd zckDS}ZXT;n`{7si$Tc5A>c$`Cd|N=JjchVeb+6KPP{KrABTm4Q9jF-62NmYzY4qGQ zfL)Lh(mV(nAe{L{?>2XRH$OMK&5IjsOn#@5m+R*}@bpi>@c22dHElkNw7fw9mz{Gl zS*<6MCpMaW+cYQp?7M3TWgBG$0vtA`@nJk+<;))0ujS0h(y*$Pi{d|K7Q#YB40~6n zom^=k(%o=L%p9IxGP!qvs7Y;rvqKRwhM^AtYuTe@Pki6o1gtysqI6kiuoTrnegxAE~TX2Mn@u$X5UNs&gl0Cb2k*VCzmmg1z2>G zx7T;Ap*mqsmW~=5t4UYBuZGDJ<)WJ;vo2K-+E>rE;E diff --git a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/images/priority.png b/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/images/priority.png deleted file mode 100644 index d2ae7942a64fc82cea3b0569d1efffd8d884a269..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23031 zcmce;WmuHm7d|>Ph;$<%AuTB(-JwWGN~a(oDcv0d455T{2uLH{Eh!;g(%s!~_PoCn z-~S)ZT%woE^E`X)wO8Etz4uJGijo}G6LPF45C{ZIL0 zmONq(gGdqsH~(NlFlA?V)8CQpC+h>Tv9Y7s13n~dd5R1KKF3hQr2&psGa4B%)Pk&u z3GF}MNAE~79#ozEV7a&kBQEC&4Xx#(vX%hcfbRbu^em2^28_b0S=?4`+{r#IIkCqI zCE;+Xm9L0_ufc&dx_?K9Y?^&1xl12*+&IKhU&cpEtb#kv6;Ui$q)j81Z?Cvf+CLk=` zUoIY2`GFM*yX(8ypHo#)S$e2#0s#iaj#q*|T}cw%X1;Fp-tM)KP)gzz{7M}fA)&eZ zMQ)*V0$^9QlDm8TZEN-Q^>rF4){|JfvE6f0!7og4@$trdDGog*=sTbmV3u#>A!+3~Fj>VjtZ}2O*zg*FsibU$0&7_=1i2 ztwpG`wBM%uRy?CJF+{*&W!w_$2?hq9@AZJ8w7K~YdjSebRl>`!X=yJ%4kpom-q0ZEus6*W8xvzcQ%gcY!A9kCWvpsoaB%*5f38+p4+M{7(S*y5!>56> zP_a7+buBIEY7Y$h_3Kw9SSSIb(hxH32*c#1gPtaFR;kWyp@KU$jdWwB~e7tV+*;CYFoocKnIkHh5 zdoz_4rajSowd5eCm*6*@ZI2;9iZn|)(nUNo$F?~gR;10$&5f^5)=9;DgdLrn=Bi32 zIZ2!q~{+*o5xFd+KcBk(bTLQa2%izaKCMG6aEj@?eMwI^Q`_UXZDF33D8a*SU zXSdVq{I)jnV-Qf#ogFJK_Yj~fI*`WUZH!$bzbC28~KbFUTsuleF zDWRf*`|H;)Tr#roKs20{kt`_^8N6X((&_8 zHTy)#27+P>QV#LQj~@`fkr5RzRXR>i++S>T%*+_u+uOjWOl)jHoy$kszVF}T%SMv= zXJ$TM+t{EL5_;y+xL}$r5r}Hs9)J=sdVX~SFtx;fdpLVRGBe$wA_gY z%=-0rY13{!oMmj9qz6iVCRh&yi82!M z;o91s{7o00+r9(O;tbNZZ9S4YYaj{)Z0ZpPNg?I1v&-(uh zBP#bbJmU)OuHRA5WZc}`po=6#L@x|{@14Ofg>Uw?*@%zV;*}$omW*KQ79bHpW$daP z7G?E0O<8n1`%_p}M&df}5Q>hCO^hRQ76Vqrp;gnsfc@ie`u^xI9@F1Xjk%M%3?EKN z9H#VL!$A*%JxGBnjw|AEX34!_K9GP>IkQJ}s-`URLQ+yvH~|L-hvcyNGJQ&v-LORu zbRK{UOm5D$vw!`1Uu@8Mpj|rt+!^8#$f8}u?0s00s=aC zI+wWt*LD}E<_KS0x1&)LIy*bV^NE&$Ax|S??D64JOx4ivuzFZo?7oVVJc?>SIfd`t z*Th7q@55=vO1kI4v0x2H(^0^!NF06ml!52F@u?~P`m)joU9cL2cCGg{1w}=t+KHXZ zxEw84*;ALcvsIt6i;ESD^&2&%Wo11Eow_yj^!6%BU%X8SD=+6PyN5+b6Wg_1=fQ8> zG30aE(}tM}JMXB2RV1r0>%)h44fOavdJ61N(7_0rJueT=S~ZkXy^I}=xw^yEI&&wi zxO05D3z4_B)PNsq@c-!M>AEqx?3XPg=S#xL`ME;^Vn zEr3L9`1tri^a?BgJP(P$Yh}N7k$B3`x4G`5pSAnY=Tb=Z{d-!luyxycDf7Ed-72c8 zG%YtftawC3>s-S`Q?-jetUmX!GpE20dq zlkg-i(-2Z2m*T4)u?HIXk^(nKxBA@AClctR=o%YmmCx9i3?#fX>5F@@@*~jzzoMcd z?cuUNJf1_5ElAEzRb#ivzOuTyaQZ?4e=P4E z0jOmiX58VR8rB;+5vfIFhsja7cj@CIqo9O4?@nT*{9ypTzM3fWS$~iKkeBfG@{mNc zXd=hCUqg{Of;Qc41p`L>1HM=wR8>EGVCLrGSrGdQ0-zS834xHy9xlkYvoQCa@t^Pl zkfg}K1t`SfYD z5u}EyzWz&>gZb@I*qb8RAJrz3OgxwYb&=Yf6a)6yoMfOhHXMnw`RW z#uo-}vEb6OMhsIE6KN2iTCEj^k2h17jC4LQvJ!1rO3*c3=b1{1NUE(fczs*rYJrSg&IlRV^*XhqHXKdZ^F;Zrx0Cl?Ei? z*4AO=%fB_+K){W3N{CSd5#s2xN=r*+4oA1YB=J~ae-WgF-w$(;(}O*mu6JS#2ngW( zI7n()tpmHXo2|llo5=1g##!0YLbW?t0zin{?SAbs2-o`CU%>02i(&dz4nx^IAFgd@ zexVGDT&DKK57yc)M9|4aKNk=n1$`!zZGei4L%(5sp|+3cH1Ays94Wz)h-4(Zy+sg_ zkhnhmrH9>HTDQIhP2T-x zekXOTz_KO42>fPjWHmJtrdm=391vk*4+8xI12jQf_@=IS)wK!t-T2N(g@p}5DQGAt zfCgn{Wy!yJ6EI;Vqofo)g_HZ|V<)&L41<8-IUOAmdDQP50!MG}W-YWmKD z2e1$830Mn?jiEFsAQC3$I}^Z(F9kLKU;vN-z)O|R%Y*t&s=*ZgVbfLue0*F|(y-oM zdEhLjh?VI2A2N!TmQ45r1jdy!-xoHK(6EhGy27{SYB{QOO5{TK@XP0%_W(Tt z9kl+mDK2bmY*}@6!ZVNNo|}`C6Z?z34}g%8w3$Q{_|Mpc^qB?VA_DaCc@*cnQofY9 zID`Tl4K$-EoM>FciHQkZNf2js-C}Wn97W1ZSKmMCy6AB= zvhUYDOdnd1a~gC4bC>sv^-K zYnJL^0CfU%9h3Pw2a;wlHC2l-gCU+jut0g1=%1zIyMsV{V2S07t=@;_~vc+x2?l z@hVIV4)NsQzU^#%ytiutAQKcHcwTdXmS5J0J~xI&?d5lUx@iik{nf>s9lX;o1Dp-) z2H=tH<4|h243v0zOj)eilKK^`AWl#6N>`s}1i*00qSv{eBX6g|CabHfSE{EB2tds~ zC$(b~6*Yjv8>*bZqCysz!+&t$W|_D2Z`G$UY0zP{tF6BEBuV-?4gR>f@qhzpkEdrC z;&=Clz9hs@8Mv%?;7_T)s_1=xK6Nl!u0K~+TugX5?*s!2Yj8_SP0jJoZ50cK*Q239 z+H9-=P(^=C&1_&)3ofJ@-!T^Euh~(Iq9fET< z0E0aZ838|dMIIFv6$KY(qI(>MhlYqjQVw?m)4O&iiWUMh5pm&yn7O&R3BW@K4td|d zPYINc6##8? zaEt}zMFtd~u-^FHI7Jwh2reaM6hNnhL_`v*Um0}S=@lg9<HUk3x=?aoCD0ZD50Fw-jcw$3uQq^&hL)pMW-wv}=b(}x z%_=k00DLLdw2r?8*alHX)rc>JqoFKHj7K33mxw4BV82umPhv1SsEh6G?d5a(26I*{ zAvIk;rgme$e~$pn99&Q{W9pUl85eKp{#|7f?TOtciCQTFMR?fOi6fEPo*!H@9Yo5&{@RV7IyM8YxR$ouSb?Z;YLlVOR%#PfgNv()e%^U-MRgVd`k(mAXT$}U zx&M0r{MUZ}3EHa9KwAMXDdqe#IjvXxRc9m7X-a7W-Q?Hrj@m|kWj8m&z-~<_b;J$qe-}k ze$>QjK#u4Fx=%2uf!qlA`X4QZQrl05#b99j0D&*1q_Xo9&jwC*^w`9SoZ4M!5;@Pu zr|BL$%zEzY-xLF+DcQuts6lxKMf5wu zlIS3*$>D%QkwMKO)Jb)aTDqlk@kH+J)t$L$vjL2VRnrJ43NiHC*$PME1~0JJQtVF@ zU+%DBkAK(``0%${s0FWDCPpG~oGL5E9OFK|BZibRNYy(BuV6~==H#8XO-iu`)RF$TL*=F5A^7XOAXpdn)eb$#&TEcLmv0Ey!Z2g6p+% zGkqONUpbEXdj2Qp<2h{%N`S(FCg`cpHU4u;?ZJX@Cod9-Q=51)JUaNbRFVl-I z`T$8abQS{--`Sh)Z;t(L)hl{wGzr_4Llty?AjvI*ZV)_SwI76@^7~F={Q8d9w<=+n zSS?2m_8T;~(6+WV1_I-seF6ER^TP~o+1R*dBSxbdWWD6Lm?gh&eTZm~;iRMKV%8dD zTpDf`;|31x;ia7ju4>Oq+e=c;O~y{T;0d?81slFT0_XC^(jDk_C;oTEuoo|0 zzyUg7SVA=1%5azW7@qX}IO@y7D{a1*{RkhqLt1`ZA;J3_bZ^xntDs}I8gx&iKUiplx7;#mOQ!Rj*9i5%c8*>yaHPpiurUh@U{PVc0wrSjkvb!gY2IRn~A%`+z8JW5Z@vZ#stc1a8XlkGoL=FWQ~Dx;lo< zM9mL^0{FC6;lEgT)JM;fxF{Dk{jURiTd&?fSaOJ}D*njJ<9ppYZgwy&9#$aJUsP;K zOG5klb$#bBTe4W#9h74ocCkXB3VizNb?dLm$@W-W)wjtzHU|j1dfz?kj@G-tM0~wo zz$db`Ju%j?FD7%))N_NaUeA-zIsP;c6!|Xg~ihu zTH)lChmTiLim;CT${SjSLBBM){^PrRG-EX{VW?Vd=iRap;yE|5(oXOPI#0>`<2$y= zL)PCXWlpLVs)GFTRy@RNqD=JSfwvnt9c^Fj3lOJW>Yg&b0g6aJ={PImJ$}?xt9$a* zLXnWsPTN~D9WuAQ#LgIUk^r=XLkXWx`YDsHTk1rPN*b&7#ze*MgiYEKrGvKY2dchA zJ|o49+EWbK{GR(kG4{~t;pim+x93t}Y`B1~Y3F3>d-aJKt^zIOkc;T9ahl@-9-*Vj zn^pUx+`+Pnq!TWDzm)uZQ}H(fELJvdC(YghGfdk}t;_V>_)&Eqzu-%w)mjgLuCEj# z8<#m&)!ewS9Ka%cw_%XMAtQTgMOqwT^@s&HKU z8vivyO}hLeqxeG{%)hkF`FIkjFAH}-TT;iW{L_f>fet~$bZ9p2|2Z9y6R4tT9z2ux zT$~X;k*7LjJy7drTUMO$fiMhAKc!upyl4y@@w5p989b(s{e$O-m~tyQ%T+)0xBf)?tDu9kav;NjFKwK7dABN~3)d3hqI zWK86U^`uC6<0s;@V;y09=$Uw?L12tHC6rmL$E3d}vM(%HiH~ z#>A96S)ppEUMNesiIb@4Y!aGh&d0TOZ(4`PJ4LUS9NZran6}?1(fkFm=oJDW7N5jUYZlza-F}W)q&0ahlA0tdt3|*mKMt6Ci@>IBJ;SH&OKOXq$jhkyn zI9G$%RQV9p^8gv54rnaxZ!3r-wOp6=mVRS(yizFDE97(#YOZo9f9LMQ&@!)q9LjPO zU!gGa$?R(~+trwLqsj!+>!}YEZl(*z#Jm{{T+oJx?toXQY2UViWP$JW zxm)PoF-1OajzlY?j%*Q$>SZnIOl*u$`Cu)zm@a!~rikyuCyMgxY18e3!X+g~9KA#W zz2dX)e!zzpX$4)AsoeCkXvP->(syPy+>XjqMyE8Jm490Pd6LUm>~eXU(MI~~cvaSt zu1{!c@56QI{#^vfD(XesQ5BPousx~}EFmZFU$nt-R-Mm#mQu2`Fwp3x9k1pq|LSq2 zE?)NX`tHQIS=cbLR_xo8;b#ZhPr%1g#E&M@Fg?xUz9jqXr}R5x14p)1nyzN!>+--t zzHu!pX~qmvr7ZoDve>gAxqtJ4Cn1$$Q+&U1_WZ+CM4|~bSEskFwq7~L<1EvkI1f@k zd=vAyLIe)SO^&$XnG8yUPM75?-5I6pyA0POg*StRlIrjx=tY-tUucsZg z75M|FE7i*$|GPKBb@rSeVTxThd-$oMyEDj?QeNd_QNVSSNhN=mu(1)_U(XN|T_v)FQo+50 znD3qqfKeHYQcE0{69m&3s$cUb zsxsJVg&h{UnDgPdkc%_{%tqSOitW^jzPQt3&43{1nQkhJwL<#`rh-Cvl)9cazg75w za_Hrn8ccXCvH?3aIbFVU__HN_7Kz=ljrD}5WzH8hq6{ZahNL?I#5VH0g^0)JfjHSr zi9pL71isLKjuVeEWGgM?legBRV$4rPasp}I9+A!uS!p$=$Eq)KPG>2x8veDcQqA%> zQ^uClbAy}-VtL4-fLQN!+zr9EWZ|14(_5WJJSUe9C3`;5Hj(3DBKZ*qb}1dQl@tJ+ zt1a!Hl619?rikP{8-jF+^cX)KvH&KbcvDm?kYpi=*%*s^O}PPk3oW5LmDBNJ^6}Ic z+j@m>@WGQX6zhrN%NB~aEm7THaVl65K`oC-z>R4CiKks%4Vi?_uV)n?V#_=qc`i|A zU3%z;4N+0Evzws2j|DFBSP+r*nK2y`C{zZEl z^c~SqV>G}C%D!%p9%U{5`i#L3`d{3k?a94rhn-)e-L z9ffeU6zWyHpt?4i2)&~Q>Frd|7Ie?ZO7j+<`0*7%;QLMygG7iKR#^L~Yow%?G=w6e zt)|l)H-^(ykGmt#8Eky_M@l)`a4Ka~FIgIoS?Il7S3xOuAtH|oV#;afVOKyT|31VU zCHTq8+@i@*h;KAQSrw&b{VO7*lrkk~|I;<(vPU@^5{J8pPY3y99%WH1bOP z9~AA1AAX%>UnH6aH%<2<+KQ|lk488`Xt`K$VG9CJK?>OyHer)1NVev3k_I|+PRtrP zp`$|<_g;2f4Ql89MqQ#Zb<2dE;x|!hz*<2(>4+5E`R?3Y`3L87&8##NzItN?<6_(Q>e*<`=1C;_D?oDG!Dc43Z z_}H{z#Saw_zXDv5mKjfSmtZM2l}(d}qqI93gb}_k>4`6%i?n;XVL-}X6IxbtQ&41g z+bR6~`IDA|qf9LjzAN+o{rjea$)wY(8>NU|etE1%0;*yu%NT6p6adkSZgJ{=t|Ogs zgE*2*p#Q3+t7=-qKQ~O%o9X|jl+T@yupkl4@YVGz7X?IEE5EKIx^b>bsh|2tx)cNCSFpL2eC zw~W+RKpGbGUvtd!lJ`}#8N-bpHsU(x(;#(AtQfu9C7uxVY0qoQG_lz? zue|JSl244Ymwj2R_X~=f-3S`}oX(biTd0uy6$noowy}PQe2bnrZiccXA{qfv(LWS- z_Acr1dP@+#E6JtjXk%}%BcP$VxX1l+CS=M3MW`a)*Z83>XnN$~I!B23%>tfK=6}cW z{{K*e{%;*BbAJy4PM)UYrcoj|%fyY(;Hd~10|jgRt1QY_OA~{fdg+(r1#WTl@}-9a zP?pvnpj&NuNeaAuLBnY-Pm%ZZo%qKx`6EWyY-f8@<+M{1A}imf6dqe)10sBcC|<(% zk{X=Omcl+l{P8k`)kXe4V@Z?9F#KL!13O2Ba*2Y7Q%^Y`C{Wo{ z=_Jw7HG&JLg@g!qP}RGaZIVrjz{A08kW+WRV2f)Ip?8n|TvoY!u8tN|=rMmL{t!wz z5+0@(1PQ9dffn)^Dt=D#{EUVwqu+jYDHibC=;(VH3)Yh$S(N9gi()R)mv3#7frckt zhxLTzo45AX34!D%rllF$^J= zM~_5Ij}NBcm!`p9s*OubV?CMW{Xf?QuX**Qkt30KXm~v?^wmzo*h%0XU+~MFqVt-z z@A{J(MWvQU%fwt?DP_fv!DC^1LV784f zuE8^o4h4co%;1Qjzg4KXt!^ObQN8=4HG+(+H>vr|VmHRCG&rmP z(*z!x{w9pd5_?_Yz24W0TMp}HUBgKz@5CW2E(dML>tzyLDY0(*6!e4N_fuO4%xvA=RJ%&o*I1kv`_R-E9BsCR(syTMF;zN*UN>B97H^tN zDpC~7`EP0&UJ>>=`9y3Lvysx~EESY=&oq0+JdTEz^LhC0eTz@KJ=$Rn>m!E+C0Azh zkgGah;YM>9qB<=zTL`z-A&lnq2%z$9nuzWXkGQJn4JQLvC*(9GI(qbLO&X`)zTVX7Plyzt@Y*E^84# z<~Kyb4t08D&<~$hh__!kpNe%`a1JB$L@C6k{++d%5v*hAt1$PYGzz{zXjo4omBp{x zBznD;j7hVz?Oispkr`glxUA4`(b1-QM|xbo=6~$(8$m{0895zB#6~M7T1VfVqUQRr zYQGZ?TiBfl38nM7`Jz40pQ$|9smKtdKyN8R-dkpqZJptvrUd1tE`9iJ>YK1=A0V$jF+2Fs5bV z!uWRkOSQteh$lTf9{2SZ(hIR0^c`iQs-5ZG>}<}pSUKaceg8P;#Wo$ykly9a*oz_| zT--S%ce_@MEGG0YWpTGh|EoW;B%@72M&xLc$)W@ZjyU_$Rq_aa{oMD2Y4elMK^4aInxz*p{SiH1{Jrqd%2 z+2V39;HXjx(()Sp;2 zOs#yyZI(tHF@g2OA(mF006!uutJCNutISNoA1WCs@HePKbT)0`TLFO!_v!SI9)sJm z${0k5hD`T?ehdWpBFyf(B8EQIYx5;6KnC1@g!x-7q#OY$3k&;`gBaU8drsQWr-9dB z@Cu{X>ZX_}T-0smu%65qiQB)AlhboQY}t=|t8t$lV`cMY(Xu>Lr^k2zo<;XgEeA6Y+k=P!1ROA5s8%l?f71$F!zaea%9FtI^aWKsdnnS3Y%_N!H^IBZhvFBsdy@U8e3j^E%Xh)T>w2Y{^p>J_9H^U;7~|&;m$mwq=1ku zD>nV(7b;1f8}|~rDnnoCXeuPR&o6hNSWoc2rUu1~8&C}dogc#5u8`HK1<^hA^@~>3 zDFHIT9YIE`t$WdDpugZHd_UB^T43$YwO;U3M&Fnw0G|LaX{1u)R{RSW95ht zUGGv5mhIcV96{K+^HaQG<#P^&H0l1nH#{d|*Q6UAYC~>5H#}|2;_Zyop64?SxXa}^ z_Ul+ro?f-yavrtZ#y*as6^J+>{xX1-``jDvP2tEH>g;@o!LP=J!!c}nLKIv?NsU>) z#g9^buDh}S@^OmS*9%;*SeGhd#2?TOb6U!Ae`1!&oz)$Ok%=KdjLJ$S+vTXU?I+%B zrn$}4F8BU@vE?*SvgI^aHeVvoTQ3)T+xnQzerPsef+D;jWMvH|6)NBAg!lKLjzC4@ z?rN&Xh?!Z`P9#0?Ijf6}7|C!+Z5nh_n?3seQVckDCE)lK@8MqhLa+O>`&q*^aqgmX zEjZ7(W4|_#okHgF_T^-=n^Qd0Hpz4UM+hbaG{yN< zDP9J$r?{I7%`REjc%311r~aY#9{c1JzNXi~8J>&^BgjIBacYC-LlybobqwM%VUYn0 zOt>y;L=@G$?=GsXY^m4$AO)I5Q=asJ2neI2Xp2DxQAtOkv44@mWryOov<7qrFeR~EGZfGQGZ@<*baCJ@E~PzJ@s}T z)|0%Cn{V+~@|2K*#Ag!Tk@)(RdO-HNZ z#76RBu{6+x&(%dhdV&1EQlK91L@Flwz=W1ee}d37C?~yErY(dMGM4PSo z{pvVk2;2WIYOn@c8VScatP14sEJDSlMT35DgB|t%ZMa)S&}Zdlqk0)(>a+7T=2S{$ zx^w^nQ^2KwNRNR}Z!_=NRGE{-ZZq)UwYf_4;%B8)79Sj9u5H|@#)FS27C!pa5E$AB z_D(Wexe8&g8TZ{jTUH@&(Pt~TBZqr~cZDt2O#ToN&=f!@eH4d4jq{Q#`ifYzGZ2NFHgCQ>~&Q9Ihn# zA(oAd(fG39QhZ=Ax@3`87)|4K?tDsQe}CrrOT+)=HXgF&O#XD2z&V-r zzz1$H-gSArg_X#|O9X8JE~4f38{%f)_AYhlkR1_r)wdArjg(og{sTCS$BV_eT?&ma z7gC2EUz`hK*`_4>j9&f@LRp&SQb_OQguvx>B=>LoRMxKD@S`QYp=oSCyR|l*i4!4; zq@>Um5svx8?aA#=oLj=aJD;(M?0j7VaHOo{;0qe&H4n&mhr0DClOH(psIO)I>NY*g zo0hA_H&Ux;T&oePqOIvVW3nIpKdb8mp-36FLzmwdg+vK?D|*lz_Z<+CyN z=h{H(#jDLu>J$5#-ySojJ463_5?P8=H>)*F?@K*k16LvIsK|b zEvilH;5CgG{{8jWYjw6;!P?aj$*qn0ux@oVa_?(tg3~rn+JdoHZ?xl(`_7y9Ho}YF znu=yaugu0UBB@ECN4SAPL|!c=5DS)FcGLSmdgG+fpQjkhiti+i`eOtX$-esy8pImp z4B$KG1-e^QTwZoD zbgng0A!+lH_Q`A9q$O61!XN@|vfKaPv9T~FeFg~-X+TX<@4mkOQ5tw1b|>#TEW?&Z zjwdNz051DClZ9KIR49;Y5xB6YSYBi*O6xn8=7a}jUeaS!h7=ZxGes+5g%E zz=rzQdXiwh%Fdg5UD#Xfl8_GfW-W~rWrJrM26O%rcxgNj%{W;Y=s>n9#76&sDK603 zvrv9&k=W@aEgD(h`%D*%T#B6M(z@Hc)|zS&uu%D_nf3o0lz%hyP|;}N5Gwwl`09

&XhtcB%tDXCe5UH&>INUsL*6G_q~bovgF|s`PB(L zbw6{+eON&ij}tZ+@Z9{o)^cZ;x=?Z7v`%g9c%2aEEC?Ec=Q}J!0(@L9Gx^E^*(i$e zwmJcULTku}kX&<0<#7!zYE{=xlR_vcsBvskar9+o>WLYlan6RF25PJIP2*=LB{K|= zuXccpflpH0jem+c^EgCt7VJ{aKzRFs8E6}b&*u+cWS53shc!G)SWT0*ek#>}K1Jto zM!F>#RZd8fvjyd4df2cQ*Fb<&#OFVES&@bt+7+1*2G?gWv1BHer36~M$OeP+ArNLD z(8zcRWI!Nf9Plp^7&ZNksPi)WcVzcbmvn)PQ1nYrEWqmUJlDqo8ai zOl=D%h&|jmN=K1nnLa)U-28p79RU?F`G55!lEgLx_eqh(_a3NufoQm*mYj&57t;5A z@l=PH`(tP{&9|9woK2dY(;OX4K^U1{StdD1^Z|V@8B%~aA%{%|7Dv@-EzGlinw60b zOoGDmoJiUt%9RQy2T$X5sJ+*t65~b#;CnMo5=pQdn0} znS_xEzIr7YpW2HcT$PuaYY&$i1z+)$O*Kn!m%Wuw2i;D@8q2a-0``-fFZ@QFH zg9z-JqPwiiWPmjVf?lMd>Au8P-rhy6jM9|;*IN`DbPa?y$vemm1x!ypPnf&jrAM6n zNdW@iT)9SajLRnNS;KPT0Z(OHom&tNMbID`m2Cg;M$XL9BPzWfVoA`LsO}LXMySM4`OCb&V9F$rJ9N^IaGaQmDAB zJ3I0CKa*EUNT{%VgiWc3B3VrOVt&YxfMLWp4Y94}E1?mhtn2bO5;&P|yUvHNW&8=P zzj~$QeZuvI|K6|MKQPAqQ3^c_=E^}rN&-7VNG5fAl#)+wg-pmfruLW~shB-n`)qa4 z%@5=)_@KpYavbSdJo>{gLYJ2pAeoCy?!7v<%hLYb>w8Fpk_$ROg`u{R9<^Z2(qT&%qKAyN2bL#% zqhVmh%oo)~kkcT7h*J{;_Ttg0)^j|2Y;E?$ffb652t1_o@YKJv6-UQ?KEKXFTcBN4 z^I|-}GV9>YZPo7Q67AZ?SxsvF-JMz6Dex@@o-?ANu+Kjx8}!@W77er45QVLvpfu4U z2H@h;W7G!CGdR7rcueYx;UtiE1fMfqyS?tQ|G06LGT@$ZdAE_u^V!)s?lWT(6|e72 zj;PN0vtXrEVeP8wJXwOWdLlyu%l2f)> z>HD{3QFPWhZDQiP{k}8HcTp*SsZcXB^H1X>#6``eO4N62a-+Au18UdQFxBq|$BvQA z20-Soe~liAM)S=zwX=n`L_c1(es|y0C$HZ+6|C}Up2gOb>)ASI@to#tc3Nz(VYhBhKpThb$U2(h~k}J~c zLr<<3XZAs`;d9Ybg?hSy@x@sf#pv<=A+z0}_IlJy7*>bMb^z2oxD#BW`xlFA{%`S( zmVxF)IX+Q_h)_$@m-gl!PCqb2V>jN>cH1RxaN)3>C8U{rX0!o6jhu`|r-HdSa60FJ5m=$z&iecawoT z=E)1^CJU$Wi(?7igS+Pscl-A8a)yg+JVLq;CrXFO#+Hx1kD}yy2{QKW)x9~=Yj`&S z$v+8C*RI!D+22o&WC>nApqb4vUQT-j%WyxH`geDC#XVPJjuNOpiTBAm{_`AnJf+_D z*Uv=<-BB#bzFBWb^l~?FTnG5S6o8;roC?QrVY07lnd_No{iR@9dX+7!!S;8Q-yqTW zJNa?_Fthzuj1u^eX4Nx?i!eNLpJl{#0A}z4l@O3$&Sl=hkCLcbE9bIXEizZuFdt`b>ZCE`@6bOvsrAa@$fVu z4S~-Mj&d+fr9S)hgs8~}Mk=kkA3x@z+}E<-@?P)q_hUV&*}d{SWY#w1_>d5JOyKe5 zqw>@g_}&M`g(K&gETh`psz3?Kxf+di)|PB{v72ymvH6mwU)c zbDA?1fkHysS(*P=JNF&bMAz>DJctM?;G@z62_Pc97{Dl95Ca5I2#WL~5$Q-Z0R%+g z6{STw(nF|%v;d)rs6Y@=Laz_fyYv>wJv{H7x%a>KulwJf*~ttEyL0xO-`PFc%=Z)3 zbjV>7`c?xfbS3&HXIueW#Sne@5IyJ(x1Ygz8F9U1=_>+4OmO&O+hXbi;-&|?UK(M7 zGthLRk3+t3XT<@2U-5EZ)|Pbs(;3}J(;BT>G`f6f*n2awzb@c?^+&DAMk;$1UrE0r z4IBNkHQRogt@C}Z!0h*V%C2JHB_)qXt0TUpFA>o`rnBu%UC-Y{$l3my_1@g-bSx@* zFg91_I8=r73*6x04cuAYea4eEUa?@GZuqLgT1G7fVG)a%6DJ!*gr=tS8lrNjr!U5v z-7u9rP+3UaGM)IB^KjJBTlI6>=|8+^V7BzlbtE``FP|o7+|+I*y1u?AoAG1Kcl_bU ztlK#p(y=xv3e;}!VD0kCQN%aPCM&RkAf4AO0>9tx9~CP%!iGXiTEB^5_FTHB(ZgqD z{tTdKs)>alh{W#dpigRaM^%`zLXDd7?PN)w4>QVq+YaVI!~fID!HJl{j2AkxEA_~V z#sld>(?dr2)nQ>Uk2ERv`R+q<%lm_YVk7VUH5T;oRhn60r`Wp`%yKv^#1tXnj<00$hTkidMR;s6_s025$wz(ib=bEN>{NBc_)5y4G@3c;9@Q^8Q;H*pJ zqeoe>>~FHqx|lVCvJRZ(eehwAkHOIi9j;NhHz}L)?11<9DyZ;hid%kpR9sdZsYxLe z9iPI{bf9R@z|Xw36Z7g&Z%t@csR+u!9aP-1|J-f8`lD6(=^3|gJ9-Kw(Y6dBIGa0g z>~MmM_vo(TXMU2Bf(5UuYu`~-kvw`DE{B=c!=dL#SI6_zEL^&`zN`jPIxSZD&PpqC z87+TfNr7R?!DaF_^dlx>_on{oydknqubfKzr{c%w z_R}A@#<4rAF8iITVaMEoHs5+o-Cf&0lB0c^1j$1=*O8i6$bD(rQCJW2Cn9<{q1at( z!a7ww_({W`4X1ZwTVJIE%4kPTVFFgpj_~fG!tKY1i&9tYXQr-NB61&N{QN%q((d{Y zJ#=)~9G#cS;e(@CQe6|JU{ted67HJ~NDVnF)snRm)Msa*j6OO3;-eMtgNSqLRUA$2Qkd99~#e7~xa} zky3-kB3u!m4SI^IKmEp=+&;P0H@Ad8sCwf4n}wc=p-+CL#68gE$DgU2rJ)f6A*}d5R3r=`5S^hR@6Sxk=Y=SAbNA|tVAiy zda~C!x{&zx#&e`A(J>r$1}Dfy(wCt3NZ}9&u1)ZhWPT#>)L8EmaMzi8p)MEtvqFa% zG$z1K8FK4Pm#jb9pGOzUw!|<4*U1Iz+_9;IO1H$iY zK8PTPb<;kDg6s-qD$+} z$*<}BhClula5u*d->-w2k%q|Z@iwrqw;od^!%1)$oI*2HrVVAin7+`S#Sz>|2c)eHQtZ)u=+4& ziZ~^rjVM|0_}=}6N;nff=GR`P9f~j?JF#{*uTRhO{xSnA%bBV3BM}lhYRL=MTrg)d zA~=_v55teKw#{h74wXr==5{O8rj?G&ON$&0qYF|}zsCROw+Jfj>j{Z{3%AX;CtHX@ zgTgx}=s0C;8AW_AGjW?GeLJ5u4n_rHXTXMDFyf^o^4hS|GVyL&YOs)7HK$lW1q4Ze z&R&f>7b$ooh?;8le<;d0QBZA+ zA^`Y1t~v1fAItdv_xQi;s}d;`W-uMhb~SiCRB%+|rsO)kyL9y|!mT!2m*GS(zT?eC zg`v^~i1LG}E*#JA7%Bu7ZML4%RFka>PzE6j%l8>+zhfbDuRkl5>bAt#cty5=eD5GJ zt-CCSPwmMw)Qe3{~>K z02nXr#Cw-4lKwepS<43c+UXV&i4?bLg8N^`8?Eydws^7fB})`~Iw(C!wd&5;Rfn2@ z10T&Rv2jtMpp|b@|J_PukRfI{bMnOLNUy0Fb3G|>ElNJ*>ZE*b@?^yEu>p%Fc9}KL zO9`~%)=0v?TLFlWp>j0xvj;`4atTaluJb`F=4%CIVr^SO%Fn%kej|ELW1YV3vTH~5 z(eDTtdYA~*s9Jn=fFrhmj64*Do)5AEA*p)OQhnJv_CnW}g5qK$Gcz-C>zx;n;NRyXt->3o8v`7c^r4=j$LzV?g9Z34bQgo~MAV+0y^dL)JK zuvs2m2p|~%%jsZ;O&+tH+45z7XQ*@ql4b#Odc~0ezpE0R{8!kqqqq5u#|^*yw*eSX zID8fn=&qMs?qUW4e7@Z%L1jXg&}`(dM2@&T2d__m->9h9GB(!5sSdyMDqRP5P?@Qj z8AYaCTkFkpEZJPU6Bf?TJ8_BMZDPR#PD_6`f?(kO$ zK(GMKqkmv2v`1HSk1!RE`nJ0^xeUUNd489l0f!O$`?avwbiDDkfC&v7;bt4ieV@oCdH?xrjFQSZb7l`d3LyhW4lm=3Zw?bG_5EU{aaB(9?THy)! zZ31-S+|Ml2YS*+Msx&G-n5)d0;pO>;UCR#-n=0=`N@mHuy}*@JPpF)#zi#S3_B5Ui zE#8sp@7PEpnF8Oc7T63cg&9HoszICWo76c;<3v$ykgdb@m0FborUdWyify#R`JCqF z4@7IFOV{<~TVCpn3ucB&hWs1sGZ=Yq-Le^dXrbpd=3hTwI-~cLU~x5YQSHdcNYgUg zP=EsbO*8GwkzsqX95Y5Ktezn1wv?2;LaYVz%K|U}g~i2Q%LU)382_~M{1A1GI4tY5)&5AGtOel3_Qlosz-fNS)ocv z*IRGK@C7N_*}mAkgGh!Ukw}VC9Hqj=th2Loe{82Q@0RDxQvgz&?vJJW(~eoL>i3$@ zOu0&qx~ClPOhrJ~(S z;ILSD{n8|Nc1B9e=FWXxIyR@CfM?$j{Yh}K=mB^b$^6}qrCq?bULt|`E(In7KCDhv z@GdNAI>NF82-O5CjUqTKL@BOV`y8(}`CrG28$0&o8=P*6v-UY^1rxo>W11Yt$_!Sb z%QKy+$AW^ms;cV5jTV(@;hxmg)GFsen9ION0W|$duyic~O5z7lS)AtX!S$AIpONW)wmHtG-B2JMrB-TbYm?)y#wR8^0VP39Ozbyj4;|!F z=2i$FRSk@6o-#qnAsIYXIv#L9-`>pvOXQGla3jbmeX&(!QR0)X+YQ!!T`P4<$7D?c)^K3 zj*pL@&kBcj ziXhRB4ywRiPKO-=X}bxc(xesAqSr%~KW4jbRT9Sk&Tr3fM=-5@R9NQZPwH%K>#(hbrn(hUMiBi$w4Eq&MV_r3Ms zy>E;+-g69xp0m&1d#%s;2oKF z=Xu~CM5i}0YN+6kH|qN^@EXlQ`kfO5g82jX7w!uqCMg6$1(6XKRdY|@U-a-+n_Lt= z9%-$4zfAZ>`i*~372@oB9K`oH4#jWO%gQHrRT-IUnMTfLN+#pUg7sqq>^yw3; z*QJfF-~C0yZb>ON1% zb9sQSe(*P}Pywab@8K-#Z#U(G|L@-_$Y9Vk&?nksV`B|x!~7=$1`khnc6P|2Pt?dU zRjj8gddS@tIw@eE+SLGeKTcb|Lv~wqAid7!P)q z&n2-K9{9`!5jflZ_Mn~(e3U48~l2zQz-Py=Vslj~&+`kJ5;B?*|wa0E{`B89ka_ak?5z~TD zk5w87fByX0*)kq1ig>^)4h}p6zkAN!DB^WumW^@R3$PS9-@kt!h@|}&-S@7|5aNNzCXKXzKW{q zEU5&zi8Db&?n=#wQ1^GsafK`Ca=qrnR%O`Tx2R~eYOV0gH1>9=CI!5BVb{)BY;xHf z9UXPJnb3cHxK~zES~+S06ApvV%%z`caLj9#vKmNavQ_X=fL&rq9C2@|+zF+)r9~if z3O3|jfAC+oxHT##@FF*+xU4J)2NFZhzj>q`2A?=<(;J3E8y6oR(Az8NeYNN&fbUD- zb9>pN=zEGw#^V41*ADDn-Tt(mI%I}HDMUt0Ok6cwB_t*Lk9@EAiz_M!k_Miq7I@TwVWsdo z6%>{1UhyH=-ex^sQx;cNCUu8m$y!!&wtemhy|`@FWc_QRi_I6L$8mCJjpz0ql2vWkj?v>mEm;^q;tv3+UwZQ(oPg<{h# zuMFDA_}vbJzx{Qm%hOMVb zZ&atcre1KlPJO1Ey|S(@nZDNnr>@7w7l=PTqsGd-eS7e)_g#N}C9oNFA;QWa$-tNQ z^z3Y8Pm3Jq>C=xJ14$-e`VHV#)gEVN+f7S5_qKE2(MY*$Ix6&A$ztDfBAImFfVe(& z$5-3J^y-z|RJqOz7Z;b;mcR4Q4u@3L)d`ripG8MUf4KYW*tq{~KtND&sE?B0wXEf4 zxAaqd{Hp3m&q7yM*Pp%0_Qbh4?G!$jlC9;DU|;!0$Mwy}A=GT0C~B%ECFaIIPZzw; zh9LgeXItyA=@wW*6#O)}?3bdLbn3p}%*rSz^nOj!k7#J%`J9wwGGAv~rS(eaiakZ{ z=kTy3C|E0NYaCM2NSOq>P74m>@d9~$!Jbyni!Re7J!JXuD&KogHBC*gg8>^ZT1H0n z7YgYjdV1tt-QBQ={^;vlZ$4`4Zu7YvzTs5_x7r@d!=a?~n@UYHH8nN*d%UWIhXim~ z($}}m{1G`24gm#I9F$xCzyKUXSy>r|##&lLYU&c6o_ybGYK-dVmDSV`lLj_wAJ5O7 zqbLMPR##Vlj*LhFL{C>Joc0NUl7@JkZHg-6E%-g&&(ztbnF|lq+AKEV*Dw2er5%kI zDd%BRQpQF^K%dwww=HhD*!pID`}WP@^pDKM#01sr*H3Zj@yKD9N z%NLiD3ihvGzZ#uykAZp@@%0sQJ($~I&n&+tdj9-5h%=FZJ8K9A@kcOgLx2rilLL|y zwqarK&CG5D#~jxQ=;uvh1?jlbypcQ_+9%=10=H%e`spq!%92`HLUw+Wo-Q5-ND=jPgTw2l8Un*t3 zIhbNxt@X#P{WfF4=W0F-j_N)2oM7WZlnF0Px2y9rfAnfLGWr|(Tn zOg75vmrgxmWD{S-7ZuUNQEBRXd<7{m(Eo+;IUk?4n);XLvWe0rCVAUU%uN+u6z28w zrc-6_GAYvX^PhQ~4RQPI{u&raU^D4;7u=Gf@DShK+cWJBfqwe@c_Qa(XZi7=o`Zwq zufSGemalehUS8{=ut_flfW6P{4;Pgmj#{s7TI&36=a&UyK|SgFUYlB4SXf*%a>Y*X zju*zZJlyQ57#JMYvH+MG5q@kLX>TTGHeGRQz>($za#{8-(rJJjx zqpOjZ+;(u)Y|@VFuAb~9(We_p1`*>spM@VzVvV`d<}VtOlZmcx_9}aJoZsr}XD)ah zwSKt2m>!^f{3`_mQTg#dBYqDxK_MZY6ztYhuZl}c6HZS*IPztDGwy*tNfGvIYq`Ii zH?E)mT2Y|@0!Rz;K;L5nA9lq1a@Ks!f#=U?j@YNf#Le1DfB_85%mjtw3}EFFL9q{r zVF^A1HI{3c+H(F|R^Nyjtc^ycJ`-lB7|6ospi^YQn9J$k^;j>f2S7DwjEsyj`|hqs z{1QV#kUh3C+}^MK2>-D2HK{)@R_LXD+jYSfdK)j5@6AqOCd=usgck$$ez!UR{hor` zvb5iQgMs}w!%lb^85tZ2ZO0$ZVwa8Gd(0hg8$fY?mwtsW~NJ!f&9#uN%#{lMG=qtLLm$+ zPERD^0IZ_W30}obOsIkM0Rs~%E-CpmZQ!TpdmKpl6JJx8y8UktOaAxoY5-6cT<2{w z?>VQH)YYG7`8_l~d-lwIaY}bu)4=EX)v{l^z}XT;EEq5C%e(_CBe7xR&t1w77emX&)RP&bMHVRDsJGlT21XOqokH%AbaIQ-hZDu-E=D zaArzGNy!3$m!Ns^aFTJ7ET2O@;YFr=Oi$5+PWW%n`ZL?(PjXGgYGC=21j!U8P&O8#5W3R2Q@6SsoW* zL7|}opgHzf)%Jr%>!Uxzs`2PrB|LIf(A69g#P}wpdepcP0)`lrv|E>SHZ0+9r`IEEY~fIz@YC@UElELZd;%h3&{u%pl=pur%?OFy1& zNEX#*z77g9o`~CyEJ`wOdVRXmAXXxhASWjW4gwgXzj~>L=(GzA(A@XR>jg|SUlE|! z*)L;u2=+>-w+eTWa@+j?G!(sba<|bI%#_Fd7^Znx-H#0cDN{eom53BDNlCTVZ}$}h z=N+oo6u_Vo)=>-OQr0d6hTYP?j#>PGaxXyg#=-!Q_v~2-Ck+J03O^75nhYaDZ^Xom zI7p1R(qIH1B;A~gcfzlry^3Z`YHDit)nGy;&@?>K!wdm}&$RjQ15(23x~~Q1TiIt1 zC>c5-^Z5iFjaI8CCpbGUGc%^Ds>)S(8PxS3 zqMr3s*-7yLU>t`FjjSnh?gzEgEfo(=jkHZ2NWPUehz~6$tFlu($)z|OUTFJhD|Lphp zI0&R8XkTj~q;|)iOU1>-sOaco-rfRobhsSyXA=uc5L|rx;P2l#c*tV7vd)%Tz1TcX z-(!&RU`ytWSs%MtAF0~fGCAu>NlS+*7TLxE2$M@@g?snz9gJSMx^jWw8?q94FU{Be zYuoBz2J+)AyAe@Q;@a9IgJ$fTBU!NkPnWhhW55}2-oOu<)l5IYgn;Aj1OqaCt_F~E zwWBjLsF6MJIGsT2&R>|Cy-vX<0Zu^D01{vwXQs3?MdjteVIb9V7Y*WUEtmYHF2~7! zrg}MoiM)C9CficGl)9)qRkKVhpwVdywmyA9Xt=DFzn|gZ;jI9y?gp6c-6iA2d4*U~ z5@FOG0%+CzmQY_TWgqvlH$vJFGGKUUpJ!)h!TJbkUevlqjgBgfIJIFPsSaG_(jH04 z$zeQz=CD4cV=n=gNE{I}6afSYH+Ohz`B#byLj-(a=gN-l(9lqiKOBNLg{GQXP_6Z} zr>9i-_JX@rY!OmucL1nuf~E?S-HBolKb|cU0I^%LRpt6+K|zQR5zuZ7n2BQ}BM~4Y zpOKl9&=m@CkppvvC^9xv(-gNjbZX3?bc&f#)h2yw0LsKbgkd; zHBrZ|Gg~weP{M;+C|Ji>!Al}QcUD0TI&CR5=rYTtyhe(Tk3ZlG>0ag8bBc+L4b7z| z_s!ya>WwGSxgIMVqhsHS50e|oY$jk8fDlI2b(vHzSLhsl$F%p`W$}z;*>kTPFiD5f z$`jD2cU`Q$gbl}tMie38be?Vu0Lskfd*?2f&U2DpXj7)a_*PaHCT$iLbhBjb z(Zj=|;h=8*_}7aps+TXJPe3V#bQ)S{W|&iqSkTao$WN!*7zxx5 z%tZJ%mOi^{At*WDggM6V#!M&k4C1P_wKZ0kT{Vl;5WoSiK>sJyWuBIx^qRQKF^1QI3kN5~$`g%WO<@wE;raC_Nf&&6*QxVi+Assu;Yu#AF zK?Rmt!0-Ulz4g)!a8FupZo=T;;F)ix0}@abm_Ec+6bRVfwivNJ+Z+-zGoy=$h^Vq( z7E&DfAw}r}lt!?@!)X$r`LWZ!n?q@#AXz=ETpM*+(}sXRy7Xky&K$O}u@SJYj2hn& z7ZXDOH30hKx{E>KcsS6QBI6t|79&-u-|9_a&z08NHIm4r0~-32LYW}|qWHk~a-J*BJx8H-(U;BkNv<~x4dik#NKh47!zSwy+) zGd5fT#~lb-ZQi^vy`(5~jR;(^4j|J2e6WISdG`EyPD{%I`_v{-5?FR^*Ji-fc?wIz z-(O{w-@OZmCH-z`B{JmhX1e{diSN)D8|Uu4P`C#a`Y|YYS|%o_)7G$rv@~j_?~Nr8 zLmr-FF!nl_#*GCsr5BhY$HV+b+26iBP15&dsA$|Ifph@Q`X|Lm5S$Aj>_R#rL# zVdjXMde2O?$yli-i<+8Rhh06eAYg_=!%jgO4Cl-AnhB2DZkd5lW%E3@&~+N(1Vsch z_rMT`OU(;5oP5^8U$A=rbpRE$)Q&M^#ck=e7<0#_})AmH` z?CE%Ww+LMSNytQFN;5C1(=Ibm_d=prLddd45o3w zBvpC&7cgV@A!5XaEj23(i#R}`d##@;LQX++WNf(77Mw-|Gi6BAw&HKrB3T4#bh#

z5%u)+`~q-zm@?bEar^!KucyQU?p4#?@(c_N-`r1(D^rGC^pZ08-8{`G>>D2~#|vZt zewXPs{+aOpGniOgw7U|R2DV0cry-1Vd#p!ux9DF1Q>$?! zQRmO`YWKGf8*fJt3nA}8gHTacrl$0}t2U=7p0cxkHx1O!a~75n>$R!PX?I}sX7Ubd zxAju`{>}OG=a0L7C6Fd>JvEXRDS1gI z>`SIlSTm%bn|P!ONCW6#z)RaF_L`Wx2M*;ZaA1j|CBY=}fRQqE1r#CliEDG~FZ9B@}) zJl0;5WE~KRBLYU^f?$qZy!nebJZyVy&G4TOs$d*Pvn%Po!-u0hy{7IZzSsc}#bJnZ zIy*ln z0PDL;RZ%b)hgP!cgtqBte}DfmDB@Kh@kz-rL)!;IzxM#b@pf7c^_+86_l6%UWG_btkOf-*0^N4nNxo-2(tm=Bi_maI#zm-I_K<>ni zL0nJ;K(5f=6$F9%^KsBiAD9cpW_+=)HCgK^x1Qn&s<5;i!vnT@bdCSZAVK_rmPV`b z!*jdl11_ys1b#_Q3ScnsQdPB-2RNgm{We@CK=r{QhbO^nj?hqFMdB6vPD#m3qID?P zGYuE%>!Md2>DVg)=?sXs*+$Zl+? zr1Q8RjtW~M(1Np@nwlaR1-R=d#UIAV=fG8Fs4i-uXmr*NILtifC+iS^styl~j~Q*t*KveJ4T8 zfyW2MA~Ymq4G@a+`O3E-Rsl?L^RZ_*N}{`f3fR@kw$1H!Z1G3jtKs9+et&F0(!o^g z`0BwO0v_a~T2};&S)9x2!BWZ~yN+^;Hv8j5IdUl#pVE< zrom*kya7M;Z}(KtClmowzUh_zXe#S{vG%n(zV=3(e)3O|vJbA+9cn)y4WI9fH@8r~ z2RG1#FTUq705|yX;R6`XUgt`>=EtJudB5D=EyCxJXD?oesW;bI8vW0Ys@ehqQd*xh zJ=4_il*TGHB2{wx_f0yho?vePSPciX{L6K3B)Pc$!9kmg%MY?9(*$qC4^-ZnNHHD& z^ZRwv9pQ73B`Z&*5Bjd5Pm-;~#Kd%3TjzGS*WQK|wZ6K*4Eu{obg*mi8HDSjV)l2+ zEk;90=h}-dM_!bUBKUhRDQY%8JlCWc6H^VfDdeNKvrNzXf(&nds*$nO7>@@)pM3w& zFF+NXs&+0L{>HQ%iqE;Y-nxxZC>shncB|>T%(Jx-h7X-BqAGRc_+%os>ag=u_}#!I z!h^l=ux1A$!zsR%%E^7WkK;jub5OF{$mbjQ?5e?t9)mw7_BlQ65}AcEjjaydKQPoL zW~!U3NL-==9(&v@UEzKCyr@1Izo|Mfe4cr`!q4*^V&7TZXLO6h(>3_gF7r254a)&S zLg#I(R%Djakk$HUGbTC0qYwYc7S-u^raJn0S*bBFfRzwoMSyt0a@%V|`S1Qfy)~<2dLO6%YvvU4_?j$oMD`R*u_I zSj)5G!Ne!yvj~fYnc5g_E;}DhNn=(QU4k9zw)xuLiwICOF%VMPGQDZ+37I#;5J~<8 zkx-_BXxQ+DOlwj~oc$QR(q%`*4M`U&zgUTG#D=6Y|Gl^7KUq8>c_yB6GX8G1f#U^Q zNr^i%`XpT0f;U-ZC4+xWkK8yd@{e`yvk%qH*(81*_AF$~Zazupv3-^H{XH+{Bb7B4 z!zdLg{T-Yl=eQ{QNK0cq1t~l3pF3Pl@)9K^Am+^(%SjjGk5tZtc6}Q+c-ei^x6aMI zu~u`?Tn^K(ZS$3x1M{+;($(2n!3Pgpe$>ZA_w%zz~0I1rLme0Inm4ul4a7Q7*dua zbakX9UDcJwZxYIQMG+r~X;pCW&3;tmP0l!H!&`>0Hdx7#v~dd|T))_>GRpEQ|Hk5) zDSlFntm|S)lG`2i_k%gwOY4IweonGV8wf;>Yz{r|+tVsLd*V9s5^=pi+J=%M=Jj+$Ik}E1MXZc@Dku^{j-qAzR@by`W;9o? zpOXUES&>gNRMO_)A}{JN=U3?3nQ-v1V;Q8#h(NI?3+dCpC-@@Yev=yOcs;5g7WsPJ zP?-rct1S3ec3o38opQFxEspMi)T2HQEAUd^GDTN$)d{;R8ybQ9VWp#`i_@wOdL2l6{20C z+_gnRvubDgIlq1$;sy_)yo8ng$jbO#LM<9<_!9Wa z@V$M7Mf0J&kb-awdC6MUnn6186gD1O0*2}w)-;Um1Z+%oV%oB__idae2Et=e+KWvI~icbKP z@o_|!0rRoR&piyzZD_bRe*uq3?W-mBSIj`q)xrn+cRFV*juOgoDNm6!87sv+qRE%> zwMU1IXvIZC52UuN_WCbrOWp7&8ho+kkdat?KA_&l=*;;*pCrQL2CDfxT79H_?(*|( zbl39~N3H4|p8c(cRIza+W_fIa+zuNn>oR{dh|=`R{;2wG#7E4b<;MiZ8de5wq-N-o zl9PVIP{-WgK3@ioA5Pr=qIB~){JF$)YvR&d&?My56)|z`51$c6V zSW-RZj?Ak2aY0TPCj08-q*S%5Vv1rcF%o4=JoJeOXl>x`fVs2L3vQ-g)$?+wP4gRZ zm29Ws?VPz?-6$wS5U-!R5bjTpqzGfuia{Hmv12O8_gNc|_n!27qBhaBaPV=cP4XEk z;XmsOagXuZl$=IkNCPw*8M^!vbEPv`54wJL_k!k063TA z8g^bevAtrS+BeX^-AC<08ry$96~s&VmT0SSdR zJZcj+EajIUcHo;;Lp!snsQG?0GfTjwHVr_Tkl&N2yS45j?I#K+6rgia(xX6hxrNA; zSKBhmB_{=oJ{R$u+>SXCHs4E!y@vIOF-B&LBYU10Q_@(ch%a_Qg_rPgsj-}j zu%xJ%s4@H+T%LhaS{FAJ#EAGPy2BP0!`f-=(y{s!)t|+UVEuIA{d+p86_!U%c=3YgwV^b zkxJ5!iglR)uSw%0_Jx!QYpD?zk`xsCxU{K2TqEy*s-^L_wQ_BAK122@)D>f_Q}aF%XLG*~&-t#56Rg?6FX&srzDn%6U` zh9@_i#e0X66JK|P?x&iVu^nSGcxo8^dJ1rV%0$BE1-rpaI*HJd3ZfojrMDxI5gkG= zhTM-kYZN#LXb-!`Nmp&%BNZg52T}2 zAj_bQl#U{mSCmxHi>Sz(%Q|wBDZRz`jye z9e>!683vP^s=h~!x)cjIO0HrD60N)xh`}C;V#o{mM`c@=+&RxfJC^`2jn%~V^x*wzLfMM6cHCE^bc!i%pO+4 z^V1aB3KxwCqt~iMRs7v=%VhV}e~gBQ0X$~iyowBXX~70IY9i6%xXC^3{JzSN%teFW zc)!+JxxP|We~jl!QPG7$8Y7B=pw4On3^M2wE_v#=&d_nG^IileC*tgna&~3{AK2H8 zxQex!>L96@^cc#b;ekWpVIO58v7a{qt~7G&CgDs`L7oJ+%^bF!Ng)Y+!VHT>r=+up z^L8rwy;olq_scMepww(@=CF#!WliW4KG+9DCB>+-&gI2Y5v}0b|K`Gh z#fp->MO6!t=2D4{O7HGa#fziNiUTJe8iuK7&o5n`;iX4NAaTI9lW~=k zDkoGQSs|)M?%%L%fXRpTavwN>&?m2dlNC6}6z^c>TMm*c9w5B{4q$Hf+QT=OPzK)< zS9BVtH+akAhTUN0@N81soP!OT7C&zJyl2IHOGb+y_SXpdM4xP4L@!uSWiizM$Q0WI z;02y8JEOGY;wzfm%qY>9*bYNw*?lfGV7n_FGK1fG>bphw=^IF&|!hN{TsaJ? zLJ=-dw7(KIgg-TQ1nYP%SSNXsCfkAS0l6hYg5}Jm`12GElnSygeXb?+VI;{2QtJ5o zU+@X5=IVN4h{8p$gdwWBukgNF21TNlTEc{$1Bmv}Sg-tlHT`B`mK*RslY2S5iuzcaYIb(*Ec{_b>7x$`1?M z{`fYN4+_kC+Q%M0s-4qc(ixnj1x54|`^%xUvIKe6+lY|tBP_q5ACBvA3212Ry(Vhf zB+iAnp@i)id#m2h4A}60sTQpK9AKeczg?DEGsRUpTXeIaXO{fq565%fMKkmEZA;AJ zRU##|=ZXlKyDxS6WTAGsqHf#xP}nBLbP@l4dQ%Wz5J>JY=Ax?4OJU@E7>!uM5u<>Nvy(WHqFkGZv28eS4Cbjl z(;?IPKFaumJ_5eSLR|U{{HgCPYgyJV=T{~CVHX>&Fk+U zeP|L?_$ebUPHr3#Bk68M8N_M3>T}b9O|a`iiPW*`_c%bF3lW)Ct~KGugBURs9|$Gp z($l-&tGk6+ktkYKmWf|138E^>O1XPVo{`53tbW*LCMD@0cLWm~)Zi934)mwv9gq)pAB z;sjW6)!%C6?pg47{NBY6IlRs^ZW3r+n6lO(tVLLU2H8I&Ak4jw(6BEA#S(4fgX@ z&J~#(#e%KwNaRVA5&cYQ@t#AqVZVrj@&{gYPAbKw3O4g|_R7@E8kQD`xNGx8-JmF-pe%WIp>IC@Tv+AdP%%_Q6x!xQ6or3G~z6ISCmjfSM+^do{k~P4380Z!%F(;a4$T<{3uDK;I5t7xGK#i}#C` zi)C~Xvr!GJv@1MdU(OV5=)E4May=gV{?l{(6Dx}EA)cSTuaTUaTg7gFlkBd3*TPQY z$7nSl46-13<#pAeq5WaFZ;DbF*;*71+!je(>0xNjNg>}dDyH{m;Uk8Q4BAUB+o19m zvdtjG^Tu7PAi5WMHW!*j_NiMDMS?{6o>hn6>@;eUjk;Nn&ChUB=THh=eItGRJU`Xo z;_8VEH))4ePSeCU2-R5%@e(;*=YrYwm}M@^-pR(p7_C|I3%6Az|m?t(B5ev9VKA>Bk2s z(XoM>hp)I57pX$aBXf-3vF~l47EXX@iPRqRo>{Sx5z%o1fBb7(lKn60N~10NL0!ML z!~&n zX1WM7&GrvaHO2Io>j=d1GwMm5^v5dQoxDvpHa3ii39+l`)_6Czf$OLO(0($|CCR16 z7#S+L@Vwh`JGi~u^Bh%D=zdT_m`*u%a(Kj9XSJ|=zQ;~ja7&H<5DTJ&moJwE7nW_j zeiMU4jl;u4z{5oT*eN~nG!QRCHM=rRy_FFQv>&WBXPQ^F_qg{s$`0r)x6Nd`Iqs7b8L9&=H8)G{xS(dl4muGsU23An*dPv`i?2Fr>=L_;EnODN^1~C9 z43tKV7t1;U6prmR4DFc_cXyAp*(Fvu$ss6Xy^o0$Ta54KY1OJI$^! zh6)~b>huuwiHuwe)t(vHZ0&-C%+QqGCoIMp+CfH& zPK1HFH;G<6?TxkeA=j$UHR~F-4T%{MxtOAizbp+2vTErQ=dz`klPs4xJJ+ppoBe28 zj{tF&7efmKC98*sp(3aSMvd-&F-l$5Zo0&qg@S`K7TilUIgT{f^lrSs4Mc^8&-T=7 z;7$)dLuRAu&tVv-I!WmdEI*)>onR`=kRHQhH#BiU_&_|Qs7;rex0-%Euqo2hvq~#> ztbn)`3(=?~(j3?z6u(v#Me3t*w};OXr7da!Ai%PiO%@ zJH-C_Mj7hBhv;`R@>1aXQR9shFICfFW@S0Ac6AcB1IGo;OVEA-(U4V9F{p7^gF{4= z(^xPKlL1@(M>O*-;~gZFb4a3CiH5NC0xR~EvLQ{bd;)CZNCXlA@FL1kB@8=NXW8SczA^nVOjR2&W>fux3@mWSrgaiNfsv&Vc@ESQd|(nW>O`niDW zD@R76dNiF|_Uq(@R<($JTrW|u5MlH)z+J*q4~9OW#mj@2;CwU58MZCr6pIJG{}Lc+ z>5=0PeWK1O!bY@Mc&YY9P+2rW^d+i8aVVr`gW@M89#RCVxN=U>Aq8fjl?C*PvV7nm zaW=e;Q>EIO1j5kc;yL#}0xs$=D~KJRRKU7Hp}1~GiH8IE(8L`9pZeQ*Oymr5UO;-U zh2ug1Qc9WCN=W`0(-xJA`-L~Qk^e3Q@Qsj?JhurN77$z-+1rBf{eeS39;jO11sI?C zs|$zqD4d6iuwk*Y4_MGAq;F4OJlyWN0(tj$-If;Cp}o+V+z$hf42#{I-Gy;OpRFI3 zIvH{m{~aL=J(-PJi&U~5=^Fdy+w+y8DS^ogY>AE=5X2snaM&7rb*>m5luJ)E#e%80 z%u7Ni*4Nhc0#l~<;}MpGS_2w29l~L9N^tu3?MOApkxmK*VScCL(85IT@D~pkV>@3d zAj2rQ*#b^o9P$Y>M@!91+3Ju1u=3*Qui%@4CAn`>6FspZ*sGc!vMs9@0zoFQr8X`g;OOBY znQA=i3-)+uhhN$Jm7bMs2=^Rr(qo#1a|A62~R_ z>oT69ng+a_CMnJ5`7rNov#=9fkCZYB$}KVC)1ptj6xI>ld6-*X1AJz&%NmJW=&^ z4+FxQM(3^39bm?EG>4aOK10OE=E~vDHI`EypTRJ=6Cz=rUxnPeXXHKfB}MJqU}q+V z%EJ$^E-1`bBI0`4z~=}0a1{(yzy9ioJosJS?casv_iB!N-{CA$OD6Nc1J=FLSyGpr z|GMeFq``3s24geaJ;pni}DE*!9__|gp%Vh+X*G`Y;*!9#vnj25!< zF&~#6Zl!KL>ek_5lFa$;6CF)1``uYWpwKvV`oON&_GLix#sQ#XZqoa@qgYlwjHv7Z0vY+hN@1I^}dg3e-(FEIs=iwUrAU&i}|H<)}vEr2R^e#a^Pc|bVQLq0qX zO)_5#8DM9*al9nR>>BP?{|n}~z3mYY0n;9Lg$&~16-GB!B|ECI|20OhiJ6tOL!%g>B3s)s!$C>SLO2MgSF?6&{*C?_F! zAZKK+h8>B@DLSo-t>@HUDTw&*cyySEGkMeIxf_Es+_tuAtQyu%G&~G*e^RERBqNNv zKyw@Kv@!LFnl^*Bo2HQv7s*l5aKWs?Ah}}Vp%wMy`BTHK73h(U26cz5lTK~!&7AQB)FtLE zh5sTfEN{^CTdd8wnSbPVCh#NMzhM%3{zVc;PY*Rv>)%6=f!;*1NNtzho%$!Xq#`Ie zNyI4cpm^#?!x$_vq0-LO#vG zVXTY!Xl&PKLry&ZYqz=%f|y0Jq9UoDJE%lv)aEZ}LhW|p^v4{b7+$7GR#@aMR0rj` z^h$V>t@aW-zqthRHCgiYgbBasaEWoIU<(_+Pa!Y@gA8KA>;Qg`=I#Pr@FBjJhciCeK{KTzgG*EFF8tRYj9!J znFGGii~|NAQBhb^;Qv!;-gGt2k6#@aYW&mhk)=yT)kyFIQN$Rk`31udj3xpZT)MR% zw?`f^)=|+C;2Tj6Y8r29I5TT|lXDuSQ+d#WWtZQWSpIrs)-DX4_d?7f=bvl?Z#P*L~G%{deuldP`MiiGDPW5>lm9c}ow$e7rR{#72TN#gvfG=Ri4 z*|#7UPC}m;d5wRap~aULM*(QkINI(O)n1x&1|BAStZ1ZS<$&^S*c0T6xO~_EWUQ@b zg1;;sM^YTIsr&y{z_$$Dr{Lm_UG=6pSlx1|9W8Avv3PYh;{~dLA0P;;5SvbaU=C)6 z=sAh1A<=ZXM$?aSUSPWHQy<oosM8oVxB!?4EuX7b` z9;I&WsmBH_n9)M@A561%TrPs(AbiVC9+Ga|^s1uZjY=@^g=^5wsED2GrNT%3@4$LO z>E)Jft$>Q*zw7IV|Df_Lm#d*nL(OhBYQnlgLT;GqnVt|@MTqCb{;bcGe<9I=DiiQz zW_FiV3*@ENS32np+A%A@PBwMlSa4Z-amW~TuGsWE_%VVl{pnx{WiL6;EuSK~gpq?> zYixBCs(rf`yVUpPWIou>N83~sn$+G{3mB_%pn z4DO&$&`f%1j_R>GwUs&?QwecE$l^Cydl;FUkSs~g=xADQKGFO4U^FB8NVI$lnNo`V z#M16>SMO$Fpe-htPJnLg6q<7tm4YoFXnI63GspH^^!~)8iU5zw?5C0l;>L1W@b@j} zh1oYMFBIOX^Z`c^<4V|hRruymEWc-x9iCMI2MNzyk4bzQThM~l7#Zv2CT(iezu$J= zkcB1CBK7vH%!}oLQ9cr`+1|}>N>76k>=4n5*l#`(ofZHoL*Ok-LZb#8AkY-eG(6nVP2m}Z?b4(#gaCd533_(*X5knI*qLwcPu3rpL+8NbZSWWa zu7iv)w23xUx#@<{BHG+QCl>y{NE4)pzlzd};!!XZ5s~;`(*-pI9t?#3A2m;&dpNlN zrBzP$|EE>DS3Fb36UQR{7}k~o+L=ozX3pWLsGlaVzZdZW@u+<#EHHeIxxpbGcIkKJ zGnXCr4%#LBb*d7g6CGqcB_)QHWext5bxf{*QU5Hs2@js29d5xxXn1NFj~?sYu0&NP z+$j2l+Yd8mgMAP~Oy5!9V<*0V77=kEz8gRo3smCWRftt#Bz)zhdBRLr%qOVI_T@~D zLtkKT_+|75Hgkz*x(dI@dw&LsdTVnkYh(r;R|y<^{3%p5c)0JpOvzp&u>WfRvR`iG z@b&^reevvAuV9lu>*3yavE26Y2Dc|I^|cC$|HyQ@!9Cyn^A%kJTx|wKhMzNaQKrRq z-JawRi>1Gbx#eS|bnvZt#@43?Sy-kwmi?5ZmOW+pGu;JfX|=mI^(&{=`)a*q>-{L-OGDDj{Ek(C%jMN?l8(bbPsYAYX&A8UdLYlp$Ya9 z5t}^MpHGfLEY=hD(zZMQ+~ThL2~Y5YxL^N(=7!*7w&-|4>1DfS)?-Kx1agio3VpJu z;d(FdWhf<2G4l=!+G-c`^1-I?no{>TzaHV^Dq!n#k}#A}SL^F3XD7gH!k;na2ZxGn;{0cv4oa%>tgX1Q zm}x5W;OV!IG78S~{->)iGhWN99(jqFwA~O|E!3$;^VeCA;v0-k__Zi1IEFtfZY_RS z9fC|Oqpy=Tr;x5RAC7x!T>WDYqf*Io15du~il4;uAj$c|2nBJU@_xW{ttCi$x@^J^dR|TyscPeAuq0gQd?%C*Q(C1^doiSzbxhs8pC4bku zTx@fA@iLP`8BiBZlYmOP_OsSl9CnC!s%FXS#N{A->-unIX z{qy_pcMp&Kv+cS*KIiSaUeAS`gop*FuMW*zlg1+ZI*4W0-VA83G9QdgWo6mr1&5{A z_j1`3D8zpAu@I9t7Ev)FOA$q-Q762!4St2FlRwQpTf2>l61X2ePyg9i{bTlpule$K z?XzC?gSLaCRP*+EZQCzCRU=G)$4W`9-l>M^izC@>MFc30on{36T+Yk8R@ya|@q-L> zXhq{->7`@gk*W>lMbBXdli2shYvv4f)yUdMRYTgB z$3j-e+>aZJ$;!6dFfb?N{<-JY?_^6RX?H(cFOuAk{cBZ4!Wxj() zDy4M__F2Ds-}s?WiOEfjH(qm_rm zC%N_in0+*B5$>0&a#Wf$Q4_oNzMCWlx3dV4e$R@?T9QS{QXQo6d#<)YtpinShu#=J zGRUqtdUWRF3GYJZFK^L*9mAa}T_FzGn-@4SjX&{k3l4E}dmJ>f*$+~nmF!l*LZ=nR zj`RF41Z8n8M2tOIlsG1DOl|i2^mD8?v$gjk5@^bnr@E;qB=epR!nV*w2g@B@qlG9w z_-c0Smyo*b>{esB#q^P`nDpJAW4Uk8^#K_PP1ePX=;-Yy4{Er^X{1fY}79}-+RTFb&dHUB5T3@?DC13QKtLv^dXjv5GC8@T%PvPl2Kd=nwD|1 zuQAx349Y^ojhIvq2ZXdml|R?pLU2lMrD;S!itNjrN=+Sx0(>+ z@F5@gi4#+k>D~eBMz6T#QB_aoWv|IKvh-PkcYA7hEqOEQ=}r zr2n;`=B5Nx)C)dA2}=H_x&YTztv6>EXNN-(#8m`Nb*HD|RyyPN=an5(n~_bW>khA^ zYNFulLK_#i63}B=yr7dICxt2Sd~-jR3qh6*A8kUA@3E*Y2=ZB!mDHi;AHFzqE%mm) ztz;si7jgPghgu7x+!5Y{9kq}^kQWM(=Y_=cWV4RM62c}*7&c+Ba3ZdVJ{lXB1lJ+E z^L1xCgES|j-pYJ6`;3sqN`IZ;-O2 z;jRIMgV~+VgWYdvt4=PqNvGalpV!n`Sn%HI?M<4fB~G-PoL2Ul-YeOTH*^`KZ;bEE z+4@aUKjvMFdfU0~DIt>&c`fyw;^bsqFt!ZYK|ZGcKYotZMn-=BP+y7eL)$>%Tru`7 z0`12_=(Eo;%p^5(oYUt$2nP-Skr;{BxTTGLEhGpVq^MiNB=1dZpLYn!ykQix-*n4; zTzC)}W-KNjQ((N^&w!4pb7Aj2cN6Ja5~6Hs#uCfqnB?($av|;AwC4_0I%<{F9{mnk z?3QTURwYsfxiZ6IzeRt}YsHkZw2zx_pL~GYCD+nsL&h9ePe>}0wDoexoH#=hR*I!H zWUIMnDqe1Ht!|kN4mfO2Xd&_Nvkq7@=q-5qw#cmGIBm2l+-B9I2`qL1`^r$*3 zhR^tN1_@|=mJ>yPuh9$%t2i0_d)?bZB9ygm`#XG=;Dedgt!_^h=-fDtx zK}DGh*3PT!`j2;lE`isOU?&?gdHB1QALL@JwxFb1iTQC#DJl8FUSOH9*=+IR`)gcd z3E7K@!~EM!A87^6rWF(xp159x$ve%8>o7Qt)cP^^7}KumDY6Z^&C-v!)eCPFN4Vnu zi<3Fw@%FK%$I`7bx@jI0u5URA-wt@dqg6ZAf%lv3bRUAqCZ1~kq$Ai2YUL<**`HcT zmMeCsQD=Xzcd@Ts$;a_;TTFU*gR5qiY@2u9vg_AXOJZi|v=YE+ZaHYEqwSFcx}ma= zbAr6DU77Rgfm^BZn7&Ka@l2o7NT-JT^r5#+eiQ@72byprglql5*cn4pF5H`9kboG1p<>J`Ejb<^a5XWTX~PP*~uSmvYs9u?FMdq zP}u6o;Xh|RLp0AgmUCYw{206Oxy#hSrkk;izD&dDsXIF!9}Y}gTT>=!QWP^7d?j|3 zXErF6zQhAlGJ4;~&a8iD24_wQQPc6==VU;7Z|EvZM(&tjfRL%e+{3 z>VCq+aI*%=dIzt)o!=+1w^_$6qkbjG1#-;8zrWBqit;F39$1UeeC3CR2%w}`W zmt~+wJ^`0jK%?>XUYDAb(fc_Tx;{yJu~i8t0U>P&_fa8MOI;PByzX`*U`hnn10246 z(<*Vizqhh!%{5wii{GU=J!4U0vS-Wk%i7;WeF=wTs!tmkKaq#ULBzTXBHoqZs~o+H zOHpfFuI86!WORflQEqYF0Qf9`cQ`|5s?N~G&sc^HS%nRq8(JJYu;;NfXCYa_oN=YV z0j1z*d6828NS-Oy&q#8y^&=8uYB`-BSS$i0AP1^_T`r%s&W}L$T)M>mb7XlO*^QQ) zYXBL4%5GJM;NdI5s!MVCyeOSPt%#lztX7$bqCu}ZGy5tpE6na$B{dF@kMH96TDN1% zyml#_ZV9H|yC4-u^_FMZ*?Jq~5#XBA;}a80&-QIvzF7qAx-=YCDj=<$c9wR0_d7b{C|nE^h~ zMmvCAN9f9_E3Hw6`;%VB^aA2k0`!pT;9|f-HKWa2cXajA&IPg@Z-Cb{UH=frwcOLy zl?`;#^q!{WsEww{&(F_j=rrNq2J=x|<44{18)%p;ZhU;azvStl_PcW?CJ%?hzUh4E z?N!{#zilIsz9E1?P_~#z6oCO8-@?0Kas7Jn&u=58j&(s(Db^Re38fABS2YT*YCN8I z|3HCBx&kI;UQ86~E+!rZ^Fl+I0>~1HZ5Jvpou~|d67g5+b|S~4*SKDkf~;_$5370P zh$mzXHAG<5@v>_O4IC|M7#($1v3ZUfT!d9??A`{TW0rMNN0=h#vG)5{e-RG^soW{% z7E`>IfL2hOCQW#anlX`DkIq zT^90WR%7t6mAXB@45mX#lB{uun7!3svDoz4T+gxnJw&%~QzaGw=KL zJLs5OOLZe|upfl;#{-y1fDp6P4ZY``w_bptPu=#{BbRU z75g@5Bk1?QcH{u-ma!|Bq8gbj7cZ@22hrMG2tQVfY9YvERXC`s1rT0mOZ-s1o2+Kk zLp{p^aLvCN7V^nd>EO>?pMYLKgA7&I#6-!oy5#BU`F=xQ(^=>`1vAw?3pi?qXslsCtJIB2 zhz$3^a+#8qHInz&(M$U1r^Ur)@EEA@AZ_>?fR$c=#p50tTEqsrK)L(7zWR`Pjfl0I z@nUKQaI<$KS#=SOefrv2?Q|Z#lEK)B?G8M5x_iWH=ot(I$mbdrK@l$)?iY3poqFmg zX?*y~-(5pB{+i%Z0BEKpDX; - } - - class RouteCollector { - public function __construct(RouteParser $routeParser, DataGenerator $dataGenerator); - public function addRoute(mixed $httpMethod, string $route, mixed $handler): void; - public function getData(): array; - } - - class Route { - public function __construct(string $httpMethod, mixed $handler, string $regex, array $variables); - public function matches(string $str): bool; - } - - interface DataGenerator { - public function addRoute(string $httpMethod, array $routeData, mixed $handler); - public function getData(): array; - } - - interface Dispatcher { - const int NOT_FOUND = 0; - const int FOUND = 1; - const int METHOD_NOT_ALLOWED = 2; - public function dispatch(string $httpMethod, string $uri): array; - } - - function simpleDispatcher( - (function(RouteCollector): void) $routeDefinitionCallback, - shape( - 'routeParser' => ?classname, - 'dataGenerator' => ?classname, - 'dispatcher' => ?classname, - 'routeCollector' => ?classname, - ) $options = shape()): Dispatcher; - - function cachedDispatcher( - (function(RouteCollector): void) $routeDefinitionCallback, - shape( - 'routeParser' => ?classname, - 'dataGenerator' => ?classname, - 'dispatcher' => ?classname, - 'routeCollector' => ?classname, - 'cacheDisabled' => ?bool, - 'cacheFile' => ?string, - ) $options = shape()): Dispatcher; -} - -namespace FastRoute\DataGenerator { - abstract class RegexBasedAbstract implements \FastRoute\DataGenerator { - protected abstract function getApproxChunkSize(); - protected abstract function processChunk($regexToRoutesMap); - - public function addRoute(string $httpMethod, array $routeData, mixed $handler): void; - public function getData(): array; - } - - class CharCountBased extends RegexBasedAbstract { - protected function getApproxChunkSize(): int; - protected function processChunk(array $regexToRoutesMap): array; - } - - class GroupCountBased extends RegexBasedAbstract { - protected function getApproxChunkSize(): int; - protected function processChunk(array $regexToRoutesMap): array; - } - - class GroupPosBased extends RegexBasedAbstract { - protected function getApproxChunkSize(): int; - protected function processChunk(array $regexToRoutesMap): array; - } - - class MarkBased extends RegexBasedAbstract { - protected function getApproxChunkSize(): int; - protected function processChunk(array $regexToRoutesMap): array; - } -} - -namespace FastRoute\Dispatcher { - abstract class RegexBasedAbstract implements \FastRoute\Dispatcher { - protected abstract function dispatchVariableRoute(array $routeData, string $uri): array; - - public function dispatch(string $httpMethod, string $uri): array; - } - - class GroupPosBased extends RegexBasedAbstract { - public function __construct(array $data); - protected function dispatchVariableRoute(array $routeData, string $uri): array; - } - - class GroupCountBased extends RegexBasedAbstract { - public function __construct(array $data); - protected function dispatchVariableRoute(array $routeData, string $uri): array; - } - - class CharCountBased extends RegexBasedAbstract { - public function __construct(array $data); - protected function dispatchVariableRoute(array $routeData, string $uri): array; - } - - class MarkBased extends RegexBasedAbstract { - public function __construct(array $data); - protected function dispatchVariableRoute(array $routeData, string $uri): array; - } -} - -namespace FastRoute\RouteParser { - class Std implements \FastRoute\RouteParser { - const string VARIABLE_REGEX = <<<'REGEX' -\{ - \s* ([a-zA-Z][a-zA-Z0-9_]*) \s* - (?: - : \s* ([^{}]*(?:\{(?-1)\}[^{}]*)*) - )? -\} -REGEX; - const string DEFAULT_DISPATCH_REGEX = '[^/]+'; - public function parse(string $route): array; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/LICENSE b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/LICENSE deleted file mode 100644 index 478e7641e93..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -Copyright (c) 2013 by Nikita Popov. - -Some rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/README.md b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/README.md deleted file mode 100644 index f812a2a014c..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/README.md +++ /dev/null @@ -1,273 +0,0 @@ -FastRoute - Fast request router for PHP -======================================= - -This library provides a fast implementation of a regular expression based router. [Blog post explaining how the -implementation works and why it is fast.][blog_post] - -Install -------- - -To install with composer: - -```sh -composer require nikic/fast-route -``` - -Requires PHP 5.4 or newer. - -Usage ------ - -Here's a basic usage example: - -```php -addRoute('GET', '/users', 'get_all_users_handler'); - // {id} must be a number (\d+) - $r->addRoute('GET', '/user/{id:\d+}', 'get_user_handler'); - // The /{title} suffix is optional - $r->addRoute('GET', '/articles/{id:\d+}[/{title}]', 'get_article_handler'); -}); - -// Fetch method and URI from somewhere -$httpMethod = $_SERVER['REQUEST_METHOD']; -$uri = $_SERVER['REQUEST_URI']; - -// Strip query string (?foo=bar) and decode URI -if (false !== $pos = strpos($uri, '?')) { - $uri = substr($uri, 0, $pos); -} -$uri = rawurldecode($uri); - -$routeInfo = $dispatcher->dispatch($httpMethod, $uri); -switch ($routeInfo[0]) { - case FastRoute\Dispatcher::NOT_FOUND: - // ... 404 Not Found - break; - case FastRoute\Dispatcher::METHOD_NOT_ALLOWED: - $allowedMethods = $routeInfo[1]; - // ... 405 Method Not Allowed - break; - case FastRoute\Dispatcher::FOUND: - $handler = $routeInfo[1]; - $vars = $routeInfo[2]; - // ... call $handler with $vars - break; -} -``` - -### Defining routes - -The routes are defined by calling the `FastRoute\simpleDispatcher()` function, which accepts -a callable taking a `FastRoute\RouteCollector` instance. The routes are added by calling -`addRoute()` on the collector instance: - -```php -$r->addRoute($method, $routePattern, $handler); -``` - -The `$method` is an uppercase HTTP method string for which a certain route should match. It -is possible to specify multiple valid methods using an array: - -```php -// These two calls -$r->addRoute('GET', '/test', 'handler'); -$r->addRoute('POST', '/test', 'handler'); -// Are equivalent to this one call -$r->addRoute(['GET', 'POST'], '/test', 'handler'); -``` - -By default the `$routePattern` uses a syntax where `{foo}` specifies a placeholder with name `foo` -and matching the regex `[^/]+`. To adjust the pattern the placeholder matches, you can specify -a custom pattern by writing `{bar:[0-9]+}`. Some examples: - -```php -// Matches /user/42, but not /user/xyz -$r->addRoute('GET', '/user/{id:\d+}', 'handler'); - -// Matches /user/foobar, but not /user/foo/bar -$r->addRoute('GET', '/user/{name}', 'handler'); - -// Matches /user/foo/bar as well -$r->addRoute('GET', '/user/{name:.+}', 'handler'); -``` - -Custom patterns for route placeholders cannot use capturing groups. For example `{lang:(en|de)}` -is not a valid placeholder, because `()` is a capturing group. Instead you can use either -`{lang:en|de}` or `{lang:(?:en|de)}`. - -Furthermore parts of the route enclosed in `[...]` are considered optional, so that `/foo[bar]` -will match both `/foo` and `/foobar`. Optional parts are only supported in a trailing position, -not in the middle of a route. - -```php -// This route -$r->addRoute('GET', '/user/{id:\d+}[/{name}]', 'handler'); -// Is equivalent to these two routes -$r->addRoute('GET', '/user/{id:\d+}', 'handler'); -$r->addRoute('GET', '/user/{id:\d+}/{name}', 'handler'); - -// Multiple nested optional parts are possible as well -$r->addRoute('GET', '/user[/{id:\d+}[/{name}]]', 'handler'); - -// This route is NOT valid, because optional parts can only occur at the end -$r->addRoute('GET', '/user[/{id:\d+}]/{name}', 'handler'); -``` - -The `$handler` parameter does not necessarily have to be a callback, it could also be a controller -class name or any other kind of data you wish to associate with the route. FastRoute only tells you -which handler corresponds to your URI, how you interpret it is up to you. - -### Caching - -The reason `simpleDispatcher` accepts a callback for defining the routes is to allow seamless -caching. By using `cachedDispatcher` instead of `simpleDispatcher` you can cache the generated -routing data and construct the dispatcher from the cached information: - -```php -addRoute('GET', '/user/{name}/{id:[0-9]+}', 'handler0'); - $r->addRoute('GET', '/user/{id:[0-9]+}', 'handler1'); - $r->addRoute('GET', '/user/{name}', 'handler2'); -}, [ - 'cacheFile' => __DIR__ . '/route.cache', /* required */ - 'cacheDisabled' => IS_DEBUG_ENABLED, /* optional, enabled by default */ -]); -``` - -The second parameter to the function is an options array, which can be used to specify the cache -file location, among other things. - -### Dispatching a URI - -A URI is dispatched by calling the `dispatch()` method of the created dispatcher. This method -accepts the HTTP method and a URI. Getting those two bits of information (and normalizing them -appropriately) is your job - this library is not bound to the PHP web SAPIs. - -The `dispatch()` method returns an array whose first element contains a status code. It is one -of `Dispatcher::NOT_FOUND`, `Dispatcher::METHOD_NOT_ALLOWED` and `Dispatcher::FOUND`. For the -method not allowed status the second array element contains a list of HTTP methods allowed for -the supplied URI. For example: - - [FastRoute\Dispatcher::METHOD_NOT_ALLOWED, ['GET', 'POST']] - -> **NOTE:** The HTTP specification requires that a `405 Method Not Allowed` response include the -`Allow:` header to detail available methods for the requested resource. Applications using FastRoute -should use the second array element to add this header when relaying a 405 response. - -For the found status the second array element is the handler that was associated with the route -and the third array element is a dictionary of placeholder names to their values. For example: - - /* Routing against GET /user/nikic/42 */ - - [FastRoute\Dispatcher::FOUND, 'handler0', ['name' => 'nikic', 'id' => '42']] - -### Overriding the route parser and dispatcher - -The routing process makes use of three components: A route parser, a data generator and a -dispatcher. The three components adhere to the following interfaces: - -```php - 'FastRoute\\RouteParser\\Std', - 'dataGenerator' => 'FastRoute\\DataGenerator\\GroupCountBased', - 'dispatcher' => 'FastRoute\\Dispatcher\\GroupCountBased', -]); -``` - -The above options array corresponds to the defaults. By replacing `GroupCountBased` by -`GroupPosBased` you could switch to a different dispatching strategy. - -### A Note on HEAD Requests - -The HTTP spec requires servers to [support both GET and HEAD methods][2616-511]: - -> The methods GET and HEAD MUST be supported by all general-purpose servers - -To avoid forcing users to manually register HEAD routes for each resource we fallback to matching an -available GET route for a given resource. The PHP web SAPI transparently removes the entity body -from HEAD responses so this behavior has no effect on the vast majority of users. - -However, implementers using FastRoute outside the web SAPI environment (e.g. a custom server) MUST -NOT send entity bodies generated in response to HEAD requests. If you are a non-SAPI user this is -*your responsibility*; FastRoute has no purview to prevent you from breaking HTTP in such cases. - -Finally, note that applications MAY always specify their own HEAD method route for a given -resource to bypass this behavior entirely. - -### Credits - -This library is based on a router that [Levi Morrison][levi] implemented for the Aerys server. - -A large number of tests, as well as HTTP compliance considerations, were provided by [Daniel Lowrey][rdlowrey]. - - -[2616-511]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.1 "RFC 2616 Section 5.1.1" -[blog_post]: http://nikic.github.io/2014/02/18/Fast-request-routing-using-regular-expressions.html -[levi]: https://github.com/morrisonlevi -[rdlowrey]: https://github.com/rdlowrey diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/composer.json b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/composer.json deleted file mode 100644 index 62aad22b0ce..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/composer.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "nikic/fast-route", - "description": "Fast request router for PHP", - "keywords": ["routing", "router"], - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Nikita Popov", - "email": "nikic@php.net" - } - ], - "require": { - "php": ">=5.4.0" - }, - "autoload": { - "psr-4": { - "FastRoute\\": "src/" - }, - "files": ["src/functions.php"] - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/phpunit.xml b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/phpunit.xml deleted file mode 100644 index 3c807b6acbc..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/phpunit.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - ./test/ - - - - - - ./src/ - - - diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/BadRouteException.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/BadRouteException.php deleted file mode 100644 index 7e38479661e..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/BadRouteException.php +++ /dev/null @@ -1,6 +0,0 @@ - $route) { - $suffixLen++; - $suffix .= "\t"; - - $regexes[] = '(?:' . $regex . '/(\t{' . $suffixLen . '})\t{' . ($count - $suffixLen) . '})'; - $routeMap[$suffix] = [$route->handler, $route->variables]; - } - - $regex = '~^(?|' . implode('|', $regexes) . ')$~'; - return ['regex' => $regex, 'suffix' => '/' . $suffix, 'routeMap' => $routeMap]; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/GroupCountBased.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/GroupCountBased.php deleted file mode 100644 index d51807f0772..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/GroupCountBased.php +++ /dev/null @@ -1,28 +0,0 @@ - $route) { - $numVariables = count($route->variables); - $numGroups = max($numGroups, $numVariables); - - $regexes[] = $regex . str_repeat('()', $numGroups - $numVariables); - $routeMap[$numGroups + 1] = [$route->handler, $route->variables]; - - ++$numGroups; - } - - $regex = '~^(?|' . implode('|', $regexes) . ')$~'; - return ['regex' => $regex, 'routeMap' => $routeMap]; - } -} - diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/GroupPosBased.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/GroupPosBased.php deleted file mode 100644 index 4152f7a7efc..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/GroupPosBased.php +++ /dev/null @@ -1,25 +0,0 @@ - $route) { - $regexes[] = $regex; - $routeMap[$offset] = [$route->handler, $route->variables]; - - $offset += count($route->variables); - } - - $regex = '~^(?:' . implode('|', $regexes) . ')$~'; - return ['regex' => $regex, 'routeMap' => $routeMap]; - } -} - diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/MarkBased.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/MarkBased.php deleted file mode 100644 index 61359f5e73f..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/MarkBased.php +++ /dev/null @@ -1,25 +0,0 @@ - $route) { - $regexes[] = $regex . '(*MARK:' . $markName . ')'; - $routeMap[$markName] = [$route->handler, $route->variables]; - - ++$markName; - } - - $regex = '~^(?|' . implode('|', $regexes) . ')$~'; - return ['regex' => $regex, 'routeMap' => $routeMap]; - } -} - diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php deleted file mode 100644 index 713d8972f5a..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php +++ /dev/null @@ -1,144 +0,0 @@ -isStaticRoute($routeData)) { - $this->addStaticRoute($httpMethod, $routeData, $handler); - } else { - $this->addVariableRoute($httpMethod, $routeData, $handler); - } - } - - public function getData() { - if (empty($this->methodToRegexToRoutesMap)) { - return [$this->staticRoutes, []]; - } - - return [$this->staticRoutes, $this->generateVariableRouteData()]; - } - - private function generateVariableRouteData() { - $data = []; - foreach ($this->methodToRegexToRoutesMap as $method => $regexToRoutesMap) { - $chunkSize = $this->computeChunkSize(count($regexToRoutesMap)); - $chunks = array_chunk($regexToRoutesMap, $chunkSize, true); - $data[$method] = array_map([$this, 'processChunk'], $chunks); - } - return $data; - } - - private function computeChunkSize($count) { - $numParts = max(1, round($count / $this->getApproxChunkSize())); - return ceil($count / $numParts); - } - - private function isStaticRoute($routeData) { - return count($routeData) === 1 && is_string($routeData[0]); - } - - private function addStaticRoute($httpMethod, $routeData, $handler) { - $routeStr = $routeData[0]; - - if (isset($this->staticRoutes[$httpMethod][$routeStr])) { - throw new BadRouteException(sprintf( - 'Cannot register two routes matching "%s" for method "%s"', - $routeStr, $httpMethod - )); - } - - if (isset($this->methodToRegexToRoutesMap[$httpMethod])) { - foreach ($this->methodToRegexToRoutesMap[$httpMethod] as $route) { - if ($route->matches($routeStr)) { - throw new BadRouteException(sprintf( - 'Static route "%s" is shadowed by previously defined variable route "%s" for method "%s"', - $routeStr, $route->regex, $httpMethod - )); - } - } - } - - $this->staticRoutes[$httpMethod][$routeStr] = $handler; - } - - private function addVariableRoute($httpMethod, $routeData, $handler) { - list($regex, $variables) = $this->buildRegexForRoute($routeData); - - if (isset($this->methodToRegexToRoutesMap[$httpMethod][$regex])) { - throw new BadRouteException(sprintf( - 'Cannot register two routes matching "%s" for method "%s"', - $regex, $httpMethod - )); - } - - $this->methodToRegexToRoutesMap[$httpMethod][$regex] = new Route( - $httpMethod, $handler, $regex, $variables - ); - } - - private function buildRegexForRoute($routeData) { - $regex = ''; - $variables = []; - foreach ($routeData as $part) { - if (is_string($part)) { - $regex .= preg_quote($part, '~'); - continue; - } - - list($varName, $regexPart) = $part; - - if (isset($variables[$varName])) { - throw new BadRouteException(sprintf( - 'Cannot use the same placeholder "%s" twice', $varName - )); - } - - if ($this->regexHasCapturingGroups($regexPart)) { - throw new BadRouteException(sprintf( - 'Regex "%s" for parameter "%s" contains a capturing group', - $regexPart, $varName - )); - } - - $variables[$varName] = $varName; - $regex .= '(' . $regexPart . ')'; - } - - return [$regex, $variables]; - } - - private function regexHasCapturingGroups($regex) { - if (false === strpos($regex, '(')) { - // Needs to have at least a ( to contain a capturing group - return false; - } - - // Semi-accurate detection for capturing groups - return preg_match( - '~ - (?: - \(\?\( - | \[ [^\]\\\\]* (?: \\\\ . [^\]\\\\]* )* \] - | \\\\ . - ) (*SKIP)(*FAIL) | - \( - (?! - \? (?! <(?![!=]) | P< | \' ) - | \* - ) - ~x', - $regex - ); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher.php deleted file mode 100644 index ea98009bd26..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher.php +++ /dev/null @@ -1,25 +0,0 @@ - 'value', ...]] - * - * @param string $httpMethod - * @param string $uri - * - * @return array - */ - public function dispatch($httpMethod, $uri); -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/CharCountBased.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/CharCountBased.php deleted file mode 100644 index 22ba2406f1e..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/CharCountBased.php +++ /dev/null @@ -1,28 +0,0 @@ -staticRouteMap, $this->variableRouteData) = $data; - } - - protected function dispatchVariableRoute($routeData, $uri) { - foreach ($routeData as $data) { - if (!preg_match($data['regex'], $uri . $data['suffix'], $matches)) { - continue; - } - - list($handler, $varNames) = $data['routeMap'][end($matches)]; - - $vars = []; - $i = 0; - foreach ($varNames as $varName) { - $vars[$varName] = $matches[++$i]; - } - return [self::FOUND, $handler, $vars]; - } - - return [self::NOT_FOUND]; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/GroupCountBased.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/GroupCountBased.php deleted file mode 100644 index 0abd3223130..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/GroupCountBased.php +++ /dev/null @@ -1,28 +0,0 @@ -staticRouteMap, $this->variableRouteData) = $data; - } - - protected function dispatchVariableRoute($routeData, $uri) { - foreach ($routeData as $data) { - if (!preg_match($data['regex'], $uri, $matches)) { - continue; - } - - list($handler, $varNames) = $data['routeMap'][count($matches)]; - - $vars = []; - $i = 0; - foreach ($varNames as $varName) { - $vars[$varName] = $matches[++$i]; - } - return [self::FOUND, $handler, $vars]; - } - - return [self::NOT_FOUND]; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/GroupPosBased.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/GroupPosBased.php deleted file mode 100644 index 32227d4944d..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/GroupPosBased.php +++ /dev/null @@ -1,30 +0,0 @@ -staticRouteMap, $this->variableRouteData) = $data; - } - - protected function dispatchVariableRoute($routeData, $uri) { - foreach ($routeData as $data) { - if (!preg_match($data['regex'], $uri, $matches)) { - continue; - } - - // find first non-empty match - for ($i = 1; '' === $matches[$i]; ++$i); - - list($handler, $varNames) = $data['routeMap'][$i]; - - $vars = []; - foreach ($varNames as $varName) { - $vars[$varName] = $matches[$i++]; - } - return [self::FOUND, $handler, $vars]; - } - - return [self::NOT_FOUND]; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/MarkBased.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/MarkBased.php deleted file mode 100644 index fefa7118571..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/MarkBased.php +++ /dev/null @@ -1,28 +0,0 @@ -staticRouteMap, $this->variableRouteData) = $data; - } - - protected function dispatchVariableRoute($routeData, $uri) { - foreach ($routeData as $data) { - if (!preg_match($data['regex'], $uri, $matches)) { - continue; - } - - list($handler, $varNames) = $data['routeMap'][$matches['MARK']]; - - $vars = []; - $i = 0; - foreach ($varNames as $varName) { - $vars[$varName] = $matches[++$i]; - } - return [self::FOUND, $handler, $vars]; - } - - return [self::NOT_FOUND]; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/RegexBasedAbstract.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/RegexBasedAbstract.php deleted file mode 100644 index 8823b9b2528..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Dispatcher/RegexBasedAbstract.php +++ /dev/null @@ -1,80 +0,0 @@ -staticRouteMap[$httpMethod][$uri])) { - $handler = $this->staticRouteMap[$httpMethod][$uri]; - return [self::FOUND, $handler, []]; - } - - $varRouteData = $this->variableRouteData; - if (isset($varRouteData[$httpMethod])) { - $result = $this->dispatchVariableRoute($varRouteData[$httpMethod], $uri); - if ($result[0] === self::FOUND) { - return $result; - } - } - - // For HEAD requests, attempt fallback to GET - if ($httpMethod === 'HEAD') { - if (isset($this->staticRouteMap['GET'][$uri])) { - $handler = $this->staticRouteMap['GET'][$uri]; - return [self::FOUND, $handler, []]; - } - if (isset($varRouteData['GET'])) { - $result = $this->dispatchVariableRoute($varRouteData['GET'], $uri); - if ($result[0] === self::FOUND) { - return $result; - } - } - } - - // If nothing else matches, try fallback routes - if (isset($this->staticRouteMap['*'][$uri])) { - $handler = $this->staticRouteMap['*'][$uri]; - return [self::FOUND, $handler, []]; - } - if (isset($varRouteData['*'])) { - $result = $this->dispatchVariableRoute($varRouteData['*'], $uri); - if ($result[0] === self::FOUND) { - return $result; - } - } - - // Find allowed methods for this URI by matching against all other HTTP methods as well - $allowedMethods = []; - - foreach ($this->staticRouteMap as $method => $uriMap) { - if ($method !== $httpMethod && isset($uriMap[$uri])) { - $allowedMethods[] = $method; - } - } - - foreach ($varRouteData as $method => $routeData) { - if ($method === $httpMethod) { - continue; - } - - $result = $this->dispatchVariableRoute($routeData, $uri); - if ($result[0] === self::FOUND) { - $allowedMethods[] = $method; - } - } - - // If there are no allowed methods the route simply does not exist - if ($allowedMethods) { - return [self::METHOD_NOT_ALLOWED, $allowedMethods]; - } else { - return [self::NOT_FOUND]; - } - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Route.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Route.php deleted file mode 100644 index d71ded18ad2..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/Route.php +++ /dev/null @@ -1,38 +0,0 @@ -httpMethod = $httpMethod; - $this->handler = $handler; - $this->regex = $regex; - $this->variables = $variables; - } - - /** - * Tests whether this route matches the given string. - * - * @param string $str - * - * @return bool - */ - public function matches($str) { - $regex = '~^' . $this->regex . '$~'; - return (bool) preg_match($regex, $str); - } -} - diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/RouteCollector.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/RouteCollector.php deleted file mode 100644 index 4386bbf3aac..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/RouteCollector.php +++ /dev/null @@ -1,46 +0,0 @@ -routeParser = $routeParser; - $this->dataGenerator = $dataGenerator; - } - - /** - * Adds a route to the collection. - * - * The syntax used in the $route string depends on the used route parser. - * - * @param string|string[] $httpMethod - * @param string $route - * @param mixed $handler - */ - public function addRoute($httpMethod, $route, $handler) { - $routeDatas = $this->routeParser->parse($route); - foreach ((array) $httpMethod as $method) { - foreach ($routeDatas as $routeData) { - $this->dataGenerator->addRoute($method, $routeData, $handler); - } - } - } - - /** - * Returns the collected route data, as provided by the data generator. - * - * @return array - */ - public function getData() { - return $this->dataGenerator->getData(); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/RouteParser.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/RouteParser.php deleted file mode 100644 index c089c315163..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/RouteParser.php +++ /dev/null @@ -1,36 +0,0 @@ - $segment) { - if ($segment === '' && $n !== 0) { - throw new BadRouteException("Empty optional part"); - } - - $currentRoute .= $segment; - $routeDatas[] = $this->parsePlaceholders($currentRoute); - } - return $routeDatas; - } - - /** - * Parses a route string that does not contain optional segments. - */ - private function parsePlaceholders($route) { - if (!preg_match_all( - '~' . self::VARIABLE_REGEX . '~x', $route, $matches, - PREG_OFFSET_CAPTURE | PREG_SET_ORDER - )) { - return [$route]; - } - - $offset = 0; - $routeData = []; - foreach ($matches as $set) { - if ($set[0][1] > $offset) { - $routeData[] = substr($route, $offset, $set[0][1] - $offset); - } - $routeData[] = [ - $set[1][0], - isset($set[2]) ? trim($set[2][0]) : self::DEFAULT_DISPATCH_REGEX - ]; - $offset = $set[0][1] + strlen($set[0][0]); - } - - if ($offset != strlen($route)) { - $routeData[] = substr($route, $offset); - } - - return $routeData; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/bootstrap.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/bootstrap.php deleted file mode 100644 index add216c7d01..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/src/bootstrap.php +++ /dev/null @@ -1,12 +0,0 @@ - 'FastRoute\\RouteParser\\Std', - 'dataGenerator' => 'FastRoute\\DataGenerator\\GroupCountBased', - 'dispatcher' => 'FastRoute\\Dispatcher\\GroupCountBased', - 'routeCollector' => 'FastRoute\\RouteCollector', - ]; - - /** @var RouteCollector $routeCollector */ - $routeCollector = new $options['routeCollector']( - new $options['routeParser'], new $options['dataGenerator'] - ); - $routeDefinitionCallback($routeCollector); - - return new $options['dispatcher']($routeCollector->getData()); - } - - /** - * @param callable $routeDefinitionCallback - * @param array $options - * - * @return Dispatcher - */ - function cachedDispatcher(callable $routeDefinitionCallback, array $options = []) { - $options += [ - 'routeParser' => 'FastRoute\\RouteParser\\Std', - 'dataGenerator' => 'FastRoute\\DataGenerator\\GroupCountBased', - 'dispatcher' => 'FastRoute\\Dispatcher\\GroupCountBased', - 'routeCollector' => 'FastRoute\\RouteCollector', - 'cacheDisabled' => false, - ]; - - if (!isset($options['cacheFile'])) { - throw new \LogicException('Must specify "cacheFile" option'); - } - - if (!$options['cacheDisabled'] && file_exists($options['cacheFile'])) { - $dispatchData = require $options['cacheFile']; - if (!is_array($dispatchData)) { - throw new \RuntimeException('Invalid cache file "' . $options['cacheFile'] . '"'); - } - return new $options['dispatcher']($dispatchData); - } - - $routeCollector = new $options['routeCollector']( - new $options['routeParser'], new $options['dataGenerator'] - ); - $routeDefinitionCallback($routeCollector); - - /** @var RouteCollector $routeCollector */ - $dispatchData = $routeCollector->getData(); - file_put_contents( - $options['cacheFile'], - ' $this->getDataGeneratorClass(), - 'dispatcher' => $this->getDispatcherClass() - ]; - } - - /** - * @dataProvider provideFoundDispatchCases - */ - public function testFoundDispatches($method, $uri, $callback, $handler, $argDict) { - $dispatcher = \FastRoute\simpleDispatcher($callback, $this->generateDispatcherOptions()); - $info = $dispatcher->dispatch($method, $uri); - $this->assertSame($dispatcher::FOUND, $info[0]); - $this->assertSame($handler, $info[1]); - $this->assertSame($argDict, $info[2]); - } - - /** - * @dataProvider provideNotFoundDispatchCases - */ - public function testNotFoundDispatches($method, $uri, $callback) { - $dispatcher = \FastRoute\simpleDispatcher($callback, $this->generateDispatcherOptions()); - $routeInfo = $dispatcher->dispatch($method, $uri); - $this->assertFalse(isset($routeInfo[1]), - "NOT_FOUND result must only contain a single element in the returned info array" - ); - $this->assertSame($dispatcher::NOT_FOUND, $routeInfo[0]); - } - - /** - * @dataProvider provideMethodNotAllowedDispatchCases - */ - public function testMethodNotAllowedDispatches($method, $uri, $callback, $availableMethods) { - $dispatcher = \FastRoute\simpleDispatcher($callback, $this->generateDispatcherOptions()); - $routeInfo = $dispatcher->dispatch($method, $uri); - $this->assertTrue(isset($routeInfo[1]), - "METHOD_NOT_ALLOWED result must return an array of allowed methods at index 1" - ); - - list($routedStatus, $methodArray) = $dispatcher->dispatch($method, $uri); - $this->assertSame($dispatcher::METHOD_NOT_ALLOWED, $routedStatus); - $this->assertSame($availableMethods, $methodArray); - } - - /** - * @expectedException \FastRoute\BadRouteException - * @expectedExceptionMessage Cannot use the same placeholder "test" twice - */ - public function testDuplicateVariableNameError() { - \FastRoute\simpleDispatcher(function(RouteCollector $r) { - $r->addRoute('GET', '/foo/{test}/{test:\d+}', 'handler0'); - }, $this->generateDispatcherOptions()); - } - - /** - * @expectedException \FastRoute\BadRouteException - * @expectedExceptionMessage Cannot register two routes matching "/user/([^/]+)" for method "GET" - */ - public function testDuplicateVariableRoute() { - \FastRoute\simpleDispatcher(function(RouteCollector $r) { - $r->addRoute('GET', '/user/{id}', 'handler0'); // oops, forgot \d+ restriction ;) - $r->addRoute('GET', '/user/{name}', 'handler1'); - }, $this->generateDispatcherOptions()); - } - - /** - * @expectedException \FastRoute\BadRouteException - * @expectedExceptionMessage Cannot register two routes matching "/user" for method "GET" - */ - public function testDuplicateStaticRoute() { - \FastRoute\simpleDispatcher(function(RouteCollector $r) { - $r->addRoute('GET', '/user', 'handler0'); - $r->addRoute('GET', '/user', 'handler1'); - }, $this->generateDispatcherOptions()); - } - - /** - * @expectedException \FastRoute\BadRouteException - * @expectedExceptionMessage Static route "/user/nikic" is shadowed by previously defined variable route "/user/([^/]+)" for method "GET" - */ - public function testShadowedStaticRoute() { - \FastRoute\simpleDispatcher(function(RouteCollector $r) { - $r->addRoute('GET', '/user/{name}', 'handler0'); - $r->addRoute('GET', '/user/nikic', 'handler1'); - }, $this->generateDispatcherOptions()); - } - - /** - * @expectedException \FastRoute\BadRouteException - * @expectedExceptionMessage Regex "(en|de)" for parameter "lang" contains a capturing group - */ - public function testCapturing() { - \FastRoute\simpleDispatcher(function(RouteCollector $r) { - $r->addRoute('GET', '/{lang:(en|de)}', 'handler0'); - }, $this->generateDispatcherOptions()); - } - - public function provideFoundDispatchCases() { - $cases = []; - - // 0 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/resource/123/456', 'handler0'); - }; - - $method = 'GET'; - $uri = '/resource/123/456'; - $handler = 'handler0'; - $argDict = []; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 1 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/handler0', 'handler0'); - $r->addRoute('GET', '/handler1', 'handler1'); - $r->addRoute('GET', '/handler2', 'handler2'); - }; - - $method = 'GET'; - $uri = '/handler2'; - $handler = 'handler2'; - $argDict = []; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 2 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user/{name}/{id:[0-9]+}', 'handler0'); - $r->addRoute('GET', '/user/{id:[0-9]+}', 'handler1'); - $r->addRoute('GET', '/user/{name}', 'handler2'); - }; - - $method = 'GET'; - $uri = '/user/rdlowrey'; - $handler = 'handler2'; - $argDict = ['name' => 'rdlowrey']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 3 --------------------------------------------------------------------------------------> - - // reuse $callback from #2 - - $method = 'GET'; - $uri = '/user/12345'; - $handler = 'handler1'; - $argDict = ['id' => '12345']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 4 --------------------------------------------------------------------------------------> - - // reuse $callback from #3 - - $method = 'GET'; - $uri = '/user/NaN'; - $handler = 'handler2'; - $argDict = ['name' => 'NaN']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 5 --------------------------------------------------------------------------------------> - - // reuse $callback from #4 - - $method = 'GET'; - $uri = '/user/rdlowrey/12345'; - $handler = 'handler0'; - $argDict = ['name' => 'rdlowrey', 'id' => '12345']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 6 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user/{id:[0-9]+}', 'handler0'); - $r->addRoute('GET', '/user/12345/extension', 'handler1'); - $r->addRoute('GET', '/user/{id:[0-9]+}.{extension}', 'handler2'); - - }; - - $method = 'GET'; - $uri = '/user/12345.svg'; - $handler = 'handler2'; - $argDict = ['id' => '12345', 'extension' => 'svg']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 7 ----- Test GET method fallback on HEAD route miss ------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user/{name}', 'handler0'); - $r->addRoute('GET', '/user/{name}/{id:[0-9]+}', 'handler1'); - $r->addRoute('GET', '/static0', 'handler2'); - $r->addRoute('GET', '/static1', 'handler3'); - $r->addRoute('HEAD', '/static1', 'handler4'); - }; - - $method = 'HEAD'; - $uri = '/user/rdlowrey'; - $handler = 'handler0'; - $argDict = ['name' => 'rdlowrey']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 8 ----- Test GET method fallback on HEAD route miss ------------------------------------> - - // reuse $callback from #7 - - $method = 'HEAD'; - $uri = '/user/rdlowrey/1234'; - $handler = 'handler1'; - $argDict = ['name' => 'rdlowrey', 'id' => '1234']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 9 ----- Test GET method fallback on HEAD route miss ------------------------------------> - - // reuse $callback from #8 - - $method = 'HEAD'; - $uri = '/static0'; - $handler = 'handler2'; - $argDict = []; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 10 ---- Test existing HEAD route used if available (no fallback) -----------------------> - - // reuse $callback from #9 - - $method = 'HEAD'; - $uri = '/static1'; - $handler = 'handler4'; - $argDict = []; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 11 ---- More specified routes are not shadowed by less specific of another method ------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user/{name}', 'handler0'); - $r->addRoute('POST', '/user/{name:[a-z]+}', 'handler1'); - }; - - $method = 'POST'; - $uri = '/user/rdlowrey'; - $handler = 'handler1'; - $argDict = ['name' => 'rdlowrey']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 12 ---- Handler of more specific routes is used, if it occurs first --------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user/{name}', 'handler0'); - $r->addRoute('POST', '/user/{name:[a-z]+}', 'handler1'); - $r->addRoute('POST', '/user/{name}', 'handler2'); - }; - - $method = 'POST'; - $uri = '/user/rdlowrey'; - $handler = 'handler1'; - $argDict = ['name' => 'rdlowrey']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 13 ---- Route with constant suffix -----------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user/{name}', 'handler0'); - $r->addRoute('GET', '/user/{name}/edit', 'handler1'); - }; - - $method = 'GET'; - $uri = '/user/rdlowrey/edit'; - $handler = 'handler1'; - $argDict = ['name' => 'rdlowrey']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 14 ---- Handle multiple methods with the same handler ----------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute(['GET', 'POST'], '/user', 'handlerGetPost'); - $r->addRoute(['DELETE'], '/user', 'handlerDelete'); - $r->addRoute([], '/user', 'handlerNone'); - }; - - $argDict = []; - $cases[] = ['GET', '/user', $callback, 'handlerGetPost', $argDict]; - $cases[] = ['POST', '/user', $callback, 'handlerGetPost', $argDict]; - $cases[] = ['DELETE', '/user', $callback, 'handlerDelete', $argDict]; - - // 15 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('POST', '/user.json', 'handler0'); - $r->addRoute('GET', '/{entity}.json', 'handler1'); - }; - - $cases[] = ['GET', '/user.json', $callback, 'handler1', ['entity' => 'user']]; - - // 16 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '', 'handler0'); - }; - - $cases[] = ['GET', '', $callback, 'handler0', []]; - - // 17 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('HEAD', '/a/{foo}', 'handler0'); - $r->addRoute('GET', '/b/{foo}', 'handler1'); - }; - - $cases[] = ['HEAD', '/b/bar', $callback, 'handler1', ['foo' => 'bar']]; - - // 18 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('HEAD', '/a', 'handler0'); - $r->addRoute('GET', '/b', 'handler1'); - }; - - $cases[] = ['HEAD', '/b', $callback, 'handler1', []]; - - // 19 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/foo', 'handler0'); - $r->addRoute('HEAD', '/{bar}', 'handler1'); - }; - - $cases[] = ['HEAD', '/foo', $callback, 'handler1', ['bar' => 'foo']]; - - // 20 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('*', '/user', 'handler0'); - $r->addRoute('*', '/{user}', 'handler1'); - $r->addRoute('GET', '/user', 'handler2'); - }; - - $cases[] = ['GET', '/user', $callback, 'handler2', []]; - - // 21 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('*', '/user', 'handler0'); - $r->addRoute('GET', '/user', 'handler1'); - }; - - $cases[] = ['POST', '/user', $callback, 'handler0', []]; - - // 22 ---- - - $cases[] = ['HEAD', '/user', $callback, 'handler1', []]; - - // 23 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/{bar}', 'handler0'); - $r->addRoute('*', '/foo', 'handler1'); - }; - - $cases[] = ['GET', '/foo', $callback, 'handler0', ['bar' => 'foo']]; - - // x --------------------------------------------------------------------------------------> - - return $cases; - } - - public function provideNotFoundDispatchCases() { - $cases = []; - - // 0 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/resource/123/456', 'handler0'); - }; - - $method = 'GET'; - $uri = '/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 1 --------------------------------------------------------------------------------------> - - // reuse callback from #0 - $method = 'POST'; - $uri = '/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 2 --------------------------------------------------------------------------------------> - - // reuse callback from #1 - $method = 'PUT'; - $uri = '/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 3 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/handler0', 'handler0'); - $r->addRoute('GET', '/handler1', 'handler1'); - $r->addRoute('GET', '/handler2', 'handler2'); - }; - - $method = 'GET'; - $uri = '/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 4 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user/{name}/{id:[0-9]+}', 'handler0'); - $r->addRoute('GET', '/user/{id:[0-9]+}', 'handler1'); - $r->addRoute('GET', '/user/{name}', 'handler2'); - }; - - $method = 'GET'; - $uri = '/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 5 --------------------------------------------------------------------------------------> - - // reuse callback from #4 - $method = 'GET'; - $uri = '/user/rdlowrey/12345/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 6 --------------------------------------------------------------------------------------> - - // reuse callback from #5 - $method = 'HEAD'; - - $cases[] = array($method, $uri, $callback); - - // x --------------------------------------------------------------------------------------> - - return $cases; - } - - public function provideMethodNotAllowedDispatchCases() { - $cases = []; - - // 0 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/resource/123/456', 'handler0'); - }; - - $method = 'POST'; - $uri = '/resource/123/456'; - $allowedMethods = ['GET']; - - $cases[] = [$method, $uri, $callback, $allowedMethods]; - - // 1 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/resource/123/456', 'handler0'); - $r->addRoute('POST', '/resource/123/456', 'handler1'); - $r->addRoute('PUT', '/resource/123/456', 'handler2'); - $r->addRoute('*', '/', 'handler3'); - }; - - $method = 'DELETE'; - $uri = '/resource/123/456'; - $allowedMethods = ['GET', 'POST', 'PUT']; - - $cases[] = [$method, $uri, $callback, $allowedMethods]; - - // 2 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user/{name}/{id:[0-9]+}', 'handler0'); - $r->addRoute('POST', '/user/{name}/{id:[0-9]+}', 'handler1'); - $r->addRoute('PUT', '/user/{name}/{id:[0-9]+}', 'handler2'); - $r->addRoute('PATCH', '/user/{name}/{id:[0-9]+}', 'handler3'); - }; - - $method = 'DELETE'; - $uri = '/user/rdlowrey/42'; - $allowedMethods = ['GET', 'POST', 'PUT', 'PATCH']; - - $cases[] = [$method, $uri, $callback, $allowedMethods]; - - // 3 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('POST', '/user/{name}', 'handler1'); - $r->addRoute('PUT', '/user/{name:[a-z]+}', 'handler2'); - $r->addRoute('PATCH', '/user/{name:[a-z]+}', 'handler3'); - }; - - $method = 'GET'; - $uri = '/user/rdlowrey'; - $allowedMethods = ['POST', 'PUT', 'PATCH']; - - $cases[] = [$method, $uri, $callback, $allowedMethods]; - - // 4 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute(['GET', 'POST'], '/user', 'handlerGetPost'); - $r->addRoute(['DELETE'], '/user', 'handlerDelete'); - $r->addRoute([], '/user', 'handlerNone'); - }; - - $cases[] = ['PUT', '/user', $callback, ['GET', 'POST', 'DELETE']]; - - // 5 - - $callback = function(RouteCollector $r) { - $r->addRoute('POST', '/user.json', 'handler0'); - $r->addRoute('GET', '/{entity}.json', 'handler1'); - }; - - $cases[] = ['PUT', '/user.json', $callback, ['POST', 'GET']]; - - // x --------------------------------------------------------------------------------------> - - return $cases; - } - -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/Dispatcher/GroupCountBasedTest.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/Dispatcher/GroupCountBasedTest.php deleted file mode 100644 index 74820fcaf98..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/Dispatcher/GroupCountBasedTest.php +++ /dev/null @@ -1,13 +0,0 @@ -markTestSkipped('PHP 5.6 required for MARK support'); - } - } - - protected function getDispatcherClass() { - return 'FastRoute\\Dispatcher\\MarkBased'; - } - - protected function getDataGeneratorClass() { - return 'FastRoute\\DataGenerator\\MarkBased'; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/HackTypechecker/HackTypecheckerTest.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/HackTypechecker/HackTypecheckerTest.php deleted file mode 100644 index 7bc6ebb310d..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/HackTypechecker/HackTypecheckerTest.php +++ /dev/null @@ -1,39 +0,0 @@ -markTestSkipped("HHVM only"); - } - if (!version_compare(HHVM_VERSION, '3.9.0', '>=')) { - $this->markTestSkipped('classname requires HHVM 3.9+'); - } - - // The typechecker recurses the whole tree, so it makes sure - // that everything in fixtures/ is valid when this runs. - - $output = array(); - $exit_code = null; - exec( - 'hh_server --check '.escapeshellarg(__DIR__.'/../../').' 2>&1', - $output, - $exit_code - ); - if ($exit_code === self::SERVER_ALREADY_RUNNING_CODE) { - $this->assertTrue( - $recurse, - "Typechecker still running after running hh_client stop" - ); - // Server already running - 3.10 => 3.11 regression: - // https://github.com/facebook/hhvm/issues/6646 - exec('hh_client stop 2>/dev/null'); - $this->testTypechecks(/* recurse = */ false); - return; - - } - $this->assertSame(0, $exit_code, implode("\n", $output)); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/all_options.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/all_options.php deleted file mode 100644 index 05a9af231b4..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/all_options.php +++ /dev/null @@ -1,29 +0,0 @@ - {}, - shape( - 'routeParser' => \FastRoute\RouteParser\Std::class, - 'dataGenerator' => \FastRoute\DataGenerator\GroupCountBased::class, - 'dispatcher' => \FastRoute\Dispatcher\GroupCountBased::class, - 'routeCollector' => \FastRoute\RouteCollector::class, - ), - ); -} - -function all_options_cached(): \FastRoute\Dispatcher { - return \FastRoute\cachedDispatcher( - $collector ==> {}, - shape( - 'routeParser' => \FastRoute\RouteParser\Std::class, - 'dataGenerator' => \FastRoute\DataGenerator\GroupCountBased::class, - 'dispatcher' => \FastRoute\Dispatcher\GroupCountBased::class, - 'routeCollector' => \FastRoute\RouteCollector::class, - 'cacheFile' => '/dev/null', - 'cacheDisabled' => false, - ), - ); -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/empty_options.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/empty_options.php deleted file mode 100644 index 61eb54190d9..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/empty_options.php +++ /dev/null @@ -1,11 +0,0 @@ - {}, shape()); -} - -function empty_options_cached(): \FastRoute\Dispatcher { - return \FastRoute\cachedDispatcher($collector ==> {}, shape()); -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/no_options.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/no_options.php deleted file mode 100644 index 44b5422f583..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/no_options.php +++ /dev/null @@ -1,11 +0,0 @@ - {}); -} - -function no_options_cached(): \FastRoute\Dispatcher { - return \FastRoute\cachedDispatcher($collector ==> {}); -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/RouteParser/StdTest.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/RouteParser/StdTest.php deleted file mode 100644 index 41f194ba8b6..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/RouteParser/StdTest.php +++ /dev/null @@ -1,147 +0,0 @@ -parse($routeString); - $this->assertSame($expectedRouteDatas, $routeDatas); - } - - /** @dataProvider provideTestParseError */ - public function testParseError($routeString, $expectedExceptionMessage) { - $parser = new Std(); - $this->setExpectedException('FastRoute\\BadRouteException', $expectedExceptionMessage); - $parser->parse($routeString); - } - - public function provideTestParse() { - return [ - [ - '/test', - [ - ['/test'], - ] - ], - [ - '/test/{param}', - [ - ['/test/', ['param', '[^/]+']], - ] - ], - [ - '/te{ param }st', - [ - ['/te', ['param', '[^/]+'], 'st'] - ] - ], - [ - '/test/{param1}/test2/{param2}', - [ - ['/test/', ['param1', '[^/]+'], '/test2/', ['param2', '[^/]+']] - ] - ], - [ - '/test/{param:\d+}', - [ - ['/test/', ['param', '\d+']] - ] - ], - [ - '/test/{ param : \d{1,9} }', - [ - ['/test/', ['param', '\d{1,9}']] - ] - ], - [ - '/test[opt]', - [ - ['/test'], - ['/testopt'], - ] - ], - [ - '/test[/{param}]', - [ - ['/test'], - ['/test/', ['param', '[^/]+']], - ] - ], - [ - '/{param}[opt]', - [ - ['/', ['param', '[^/]+']], - ['/', ['param', '[^/]+'], 'opt'] - ] - ], - [ - '/test[/{name}[/{id:[0-9]+}]]', - [ - ['/test'], - ['/test/', ['name', '[^/]+']], - ['/test/', ['name', '[^/]+'], '/', ['id', '[0-9]+']], - ] - ], - [ - '', - [ - [''], - ] - ], - [ - '[test]', - [ - [''], - ['test'], - ] - ], - [ - '/{foo-bar}', - [ - ['/', ['foo-bar', '[^/]+']] - ] - ], - [ - '/{_foo:.*}', - [ - ['/', ['_foo', '.*']] - ] - ], - ]; - } - - public function provideTestParseError() { - return [ - [ - '/test[opt', - "Number of opening '[' and closing ']' does not match" - ], - [ - '/test[opt[opt2]', - "Number of opening '[' and closing ']' does not match" - ], - [ - '/testopt]', - "Number of opening '[' and closing ']' does not match" - ], - [ - '/test[]', - "Empty optional part" - ], - [ - '/test[[opt]]', - "Empty optional part" - ], - [ - '[[test]]', - "Empty optional part" - ], - [ - '/test[/opt]/required', - "Optional segments can only occur at the end of a route" - ], - ]; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/bootstrap.php b/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/bootstrap.php deleted file mode 100644 index 27e6d4c8fbd..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/nikic/fast-route/test/bootstrap.php +++ /dev/null @@ -1,11 +0,0 @@ -> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi - -script: - - cd ext/pimple - - if [ "$PIMPLE_EXT" == "yes" ]; then yes n | make test | tee output ; grep -E 'Tests failed +. +0' output; fi - - cd ../.. - - phpunit - -matrix: - exclude: - - php: hhvm - env: PIMPLE_EXT=yes diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/CHANGELOG b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/CHANGELOG deleted file mode 100644 index cc679972ec7..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/CHANGELOG +++ /dev/null @@ -1,35 +0,0 @@ -* 3.0.2 (2015-09-11) - - * refactored the C extension - * minor non-significant changes - -* 3.0.1 (2015-07-30) - - * simplified some code - * fixed a segfault in the C extension - -* 3.0.0 (2014-07-24) - - * removed the Pimple class alias (use Pimple\Container instead) - -* 2.1.1 (2014-07-24) - - * fixed compiler warnings for the C extension - * fixed code when dealing with circular references - -* 2.1.0 (2014-06-24) - - * moved the Pimple to Pimple\Container (with a BC layer -- Pimple is now a - deprecated alias which will be removed in Pimple 3.0) - * added Pimple\ServiceProviderInterface (and Pimple::register()) - -* 2.0.0 (2014-02-10) - - * changed extend to automatically re-assign the extended service and keep it as shared or factory - (to keep BC, extend still returns the extended service) - * changed services to be shared by default (use factory() for factory - services) - -* 1.0.0 - - * initial version diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/LICENSE b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/LICENSE deleted file mode 100644 index d7949e2fb35..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2009-2015 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/README.rst b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/README.rst deleted file mode 100644 index 93fb35a89b7..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/README.rst +++ /dev/null @@ -1,201 +0,0 @@ -Pimple -====== - -.. caution:: - - This is the documentation for Pimple 3.x. If you are using Pimple 1.x, read - the `Pimple 1.x documentation`_. Reading the Pimple 1.x code is also a good - way to learn more about how to create a simple Dependency Injection - Container (recent versions of Pimple are more focused on performance). - -Pimple is a small Dependency Injection Container for PHP. - -Installation ------------- - -Before using Pimple in your project, add it to your ``composer.json`` file: - -.. code-block:: bash - - $ ./composer.phar require pimple/pimple ~3.0 - -Alternatively, Pimple is also available as a PHP C extension: - -.. code-block:: bash - - $ git clone https://github.com/silexphp/Pimple - $ cd Pimple/ext/pimple - $ phpize - $ ./configure - $ make - $ make install - -Usage ------ - -Creating a container is a matter of creating a ``Container`` instance: - -.. code-block:: php - - use Pimple\Container; - - $container = new Container(); - -As many other dependency injection containers, Pimple manages two different -kind of data: **services** and **parameters**. - -Defining Services -~~~~~~~~~~~~~~~~~ - -A service is an object that does something as part of a larger system. Examples -of services: a database connection, a templating engine, or a mailer. Almost -any **global** object can be a service. - -Services are defined by **anonymous functions** that return an instance of an -object: - -.. code-block:: php - - // define some services - $container['session_storage'] = function ($c) { - return new SessionStorage('SESSION_ID'); - }; - - $container['session'] = function ($c) { - return new Session($c['session_storage']); - }; - -Notice that the anonymous function has access to the current container -instance, allowing references to other services or parameters. - -As objects are only created when you get them, the order of the definitions -does not matter. - -Using the defined services is also very easy: - -.. code-block:: php - - // get the session object - $session = $container['session']; - - // the above call is roughly equivalent to the following code: - // $storage = new SessionStorage('SESSION_ID'); - // $session = new Session($storage); - -Defining Factory Services -~~~~~~~~~~~~~~~~~~~~~~~~~ - -By default, each time you get a service, Pimple returns the **same instance** -of it. If you want a different instance to be returned for all calls, wrap your -anonymous function with the ``factory()`` method - -.. code-block:: php - - $container['session'] = $container->factory(function ($c) { - return new Session($c['session_storage']); - }); - -Now, each call to ``$container['session']`` returns a new instance of the -session. - -Defining Parameters -~~~~~~~~~~~~~~~~~~~ - -Defining a parameter allows to ease the configuration of your container from -the outside and to store global values: - -.. code-block:: php - - // define some parameters - $container['cookie_name'] = 'SESSION_ID'; - $container['session_storage_class'] = 'SessionStorage'; - -If you change the ``session_storage`` service definition like below: - -.. code-block:: php - - $container['session_storage'] = function ($c) { - return new $c['session_storage_class']($c['cookie_name']); - }; - -You can now easily change the cookie name by overriding the -``session_storage_class`` parameter instead of redefining the service -definition. - -Protecting Parameters -~~~~~~~~~~~~~~~~~~~~~ - -Because Pimple sees anonymous functions as service definitions, you need to -wrap anonymous functions with the ``protect()`` method to store them as -parameters: - -.. code-block:: php - - $container['random_func'] = $container->protect(function () { - return rand(); - }); - -Modifying Services after Definition -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -In some cases you may want to modify a service definition after it has been -defined. You can use the ``extend()`` method to define additional code to be -run on your service just after it is created: - -.. code-block:: php - - $container['session_storage'] = function ($c) { - return new $c['session_storage_class']($c['cookie_name']); - }; - - $container->extend('session_storage', function ($storage, $c) { - $storage->...(); - - return $storage; - }); - -The first argument is the name of the service to extend, the second a function -that gets access to the object instance and the container. - -Extending a Container -~~~~~~~~~~~~~~~~~~~~~ - -If you use the same libraries over and over, you might want to reuse some -services from one project to the next one; package your services into a -**provider** by implementing ``Pimple\ServiceProviderInterface``: - -.. code-block:: php - - use Pimple\Container; - - class FooProvider implements Pimple\ServiceProviderInterface - { - public function register(Container $pimple) - { - // register some services and parameters - // on $pimple - } - } - -Then, register the provider on a Container: - -.. code-block:: php - - $pimple->register(new FooProvider()); - -Fetching the Service Creation Function -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -When you access an object, Pimple automatically calls the anonymous function -that you defined, which creates the service object for you. If you want to get -raw access to this function, you can use the ``raw()`` method: - -.. code-block:: php - - $container['session'] = function ($c) { - return new Session($c['session_storage']); - }; - - $sessionFunction = $container->raw('session'); - -.. _Pimple 1.x documentation: https://github.com/silexphp/Pimple/tree/1.1 diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/composer.json b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/composer.json deleted file mode 100644 index a5268f16118..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "pimple/pimple", - "type": "library", - "description": "Pimple, a simple Dependency Injection Container", - "keywords": ["dependency injection", "container"], - "homepage": "http://pimple.sensiolabs.org", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "require": { - "php": ">=5.3.0" - }, - "autoload": { - "psr-0": { "Pimple": "src/" } - }, - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/.gitignore b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/.gitignore deleted file mode 100644 index 1861088ac1f..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -*.sw* -.deps -Makefile -Makefile.fragments -Makefile.global -Makefile.objects -acinclude.m4 -aclocal.m4 -build/ -config.cache -config.guess -config.h -config.h.in -config.log -config.nice -config.status -config.sub -configure -configure.in -install-sh -libtool -ltmain.sh -missing -mkinstalldirs -run-tests.php -*.loT -.libs/ -modules/ -*.la -*.lo diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/README.md b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/README.md deleted file mode 100644 index 7b39eb2929e..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/README.md +++ /dev/null @@ -1,12 +0,0 @@ -This is Pimple 2 implemented in C - -* PHP >= 5.3 -* Not tested under Windows, might work - -Install -======= - - > phpize - > ./configure - > make - > make install diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/config.m4 b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/config.m4 deleted file mode 100644 index c9ba17ddbd5..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/config.m4 +++ /dev/null @@ -1,63 +0,0 @@ -dnl $Id$ -dnl config.m4 for extension pimple - -dnl Comments in this file start with the string 'dnl'. -dnl Remove where necessary. This file will not work -dnl without editing. - -dnl If your extension references something external, use with: - -dnl PHP_ARG_WITH(pimple, for pimple support, -dnl Make sure that the comment is aligned: -dnl [ --with-pimple Include pimple support]) - -dnl Otherwise use enable: - -PHP_ARG_ENABLE(pimple, whether to enable pimple support, -dnl Make sure that the comment is aligned: -[ --enable-pimple Enable pimple support]) - -if test "$PHP_PIMPLE" != "no"; then - dnl Write more examples of tests here... - - dnl # --with-pimple -> check with-path - dnl SEARCH_PATH="/usr/local /usr" # you might want to change this - dnl SEARCH_FOR="/include/pimple.h" # you most likely want to change this - dnl if test -r $PHP_PIMPLE/$SEARCH_FOR; then # path given as parameter - dnl PIMPLE_DIR=$PHP_PIMPLE - dnl else # search default path list - dnl AC_MSG_CHECKING([for pimple files in default path]) - dnl for i in $SEARCH_PATH ; do - dnl if test -r $i/$SEARCH_FOR; then - dnl PIMPLE_DIR=$i - dnl AC_MSG_RESULT(found in $i) - dnl fi - dnl done - dnl fi - dnl - dnl if test -z "$PIMPLE_DIR"; then - dnl AC_MSG_RESULT([not found]) - dnl AC_MSG_ERROR([Please reinstall the pimple distribution]) - dnl fi - - dnl # --with-pimple -> add include path - dnl PHP_ADD_INCLUDE($PIMPLE_DIR/include) - - dnl # --with-pimple -> check for lib and symbol presence - dnl LIBNAME=pimple # you may want to change this - dnl LIBSYMBOL=pimple # you most likely want to change this - - dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL, - dnl [ - dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $PIMPLE_DIR/lib, PIMPLE_SHARED_LIBADD) - dnl AC_DEFINE(HAVE_PIMPLELIB,1,[ ]) - dnl ],[ - dnl AC_MSG_ERROR([wrong pimple lib version or lib not found]) - dnl ],[ - dnl -L$PIMPLE_DIR/lib -lm - dnl ]) - dnl - dnl PHP_SUBST(PIMPLE_SHARED_LIBADD) - - PHP_NEW_EXTENSION(pimple, pimple.c, $ext_shared) -fi diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/config.w32 b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/config.w32 deleted file mode 100644 index 39857b3254b..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/config.w32 +++ /dev/null @@ -1,13 +0,0 @@ -// $Id$ -// vim:ft=javascript - -// If your extension references something external, use ARG_WITH -// ARG_WITH("pimple", "for pimple support", "no"); - -// Otherwise, use ARG_ENABLE -// ARG_ENABLE("pimple", "enable pimple support", "no"); - -if (PHP_PIMPLE != "no") { - EXTENSION("pimple", "pimple.c"); -} - diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/php_pimple.h b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/php_pimple.h deleted file mode 100644 index 49431f08a84..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/php_pimple.h +++ /dev/null @@ -1,121 +0,0 @@ - -/* - * This file is part of Pimple. - * - * Copyright (c) 2014 Fabien Potencier - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished - * to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef PHP_PIMPLE_H -#define PHP_PIMPLE_H - -extern zend_module_entry pimple_module_entry; -#define phpext_pimple_ptr &pimple_module_entry - -#ifdef PHP_WIN32 -# define PHP_PIMPLE_API __declspec(dllexport) -#elif defined(__GNUC__) && __GNUC__ >= 4 -# define PHP_PIMPLE_API __attribute__ ((visibility("default"))) -#else -# define PHP_PIMPLE_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -#define PIMPLE_VERSION "3.0.2" -#define PIMPLE_NS "Pimple" - -#define PIMPLE_DEFAULT_ZVAL_CACHE_NUM 5 -#define PIMPLE_DEFAULT_ZVAL_VALUES_NUM 10 - -zend_module_entry *get_module(void); - -PHP_MINIT_FUNCTION(pimple); -PHP_MINFO_FUNCTION(pimple); - -PHP_METHOD(Pimple, __construct); -PHP_METHOD(Pimple, factory); -PHP_METHOD(Pimple, protect); -PHP_METHOD(Pimple, raw); -PHP_METHOD(Pimple, extend); -PHP_METHOD(Pimple, keys); -PHP_METHOD(Pimple, register); -PHP_METHOD(Pimple, offsetSet); -PHP_METHOD(Pimple, offsetUnset); -PHP_METHOD(Pimple, offsetGet); -PHP_METHOD(Pimple, offsetExists); - -PHP_METHOD(PimpleClosure, invoker); - -typedef struct _pimple_bucket_value { - zval *value; /* Must be the first element */ - zval *raw; - zend_object_handle handle_num; - enum { - PIMPLE_IS_PARAM = 0, - PIMPLE_IS_SERVICE = 2 - } type; - zend_bool initialized; - zend_fcall_info_cache fcc; -} pimple_bucket_value; - -typedef struct _pimple_object { - zend_object zobj; - HashTable values; - HashTable factories; - HashTable protected; -} pimple_object; - -typedef struct _pimple_closure_object { - zend_object zobj; - zval *callable; - zval *factory; -} pimple_closure_object; - -static const char sensiolabs_logo[] = ""; - -static int pimple_zval_to_pimpleval(zval *_zval, pimple_bucket_value *_pimple_bucket_value TSRMLS_DC); -static int pimple_zval_is_valid_callback(zval *_zval, pimple_bucket_value *_pimple_bucket_value TSRMLS_DC); - -static void pimple_bucket_dtor(pimple_bucket_value *bucket); -static void pimple_free_bucket(pimple_bucket_value *bucket); - -static zval *pimple_object_read_dimension(zval *object, zval *offset, int type TSRMLS_DC); -static void pimple_object_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC); -static int pimple_object_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC); -static void pimple_object_unset_dimension(zval *object, zval *offset TSRMLS_DC); -static zend_object_value pimple_object_create(zend_class_entry *ce TSRMLS_DC); -static void pimple_free_object_storage(pimple_object *obj TSRMLS_DC); - -static void pimple_closure_free_object_storage(pimple_closure_object *obj TSRMLS_DC); -static zend_object_value pimple_closure_object_create(zend_class_entry *ce TSRMLS_DC); -static zend_function *pimple_closure_get_constructor(zval * TSRMLS_DC); -static int pimple_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, union _zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC); - -#ifdef ZTS -#define PIMPLE_G(v) TSRMG(pimple_globals_id, zend_pimple_globals *, v) -#else -#define PIMPLE_G(v) (pimple_globals.v) -#endif - -#endif /* PHP_PIMPLE_H */ - diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/pimple.c b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/pimple.c deleted file mode 100644 index 821365bf127..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/pimple.c +++ /dev/null @@ -1,922 +0,0 @@ - -/* - * This file is part of Pimple. - * - * Copyright (c) 2014 Fabien Potencier - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished - * to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_pimple.h" -#include "pimple_compat.h" -#include "zend_interfaces.h" -#include "zend.h" -#include "Zend/zend_closures.h" -#include "ext/spl/spl_exceptions.h" -#include "Zend/zend_exceptions.h" -#include "main/php_output.h" -#include "SAPI.h" - -static zend_class_entry *pimple_ce; -static zend_object_handlers pimple_object_handlers; -static zend_class_entry *pimple_closure_ce; -static zend_class_entry *pimple_serviceprovider_ce; -static zend_object_handlers pimple_closure_object_handlers; -static zend_internal_function pimple_closure_invoker_function; - -#define FETCH_DIM_HANDLERS_VARS pimple_object *pimple_obj = NULL; \ - ulong index; \ - pimple_obj = (pimple_object *)zend_object_store_get_object(object TSRMLS_CC); \ - -#define PIMPLE_OBJECT_HANDLE_INHERITANCE_OBJECT_HANDLERS do { \ - if (ce != pimple_ce) { \ - zend_hash_find(&ce->function_table, ZEND_STRS("offsetget"), (void **)&function); \ - if (function->common.scope != ce) { /* if the function is not defined in this actual class */ \ - pimple_object_handlers.read_dimension = pimple_object_read_dimension; /* then overwrite the handler to use custom one */ \ - } \ - zend_hash_find(&ce->function_table, ZEND_STRS("offsetset"), (void **)&function); \ - if (function->common.scope != ce) { \ - pimple_object_handlers.write_dimension = pimple_object_write_dimension; \ - } \ - zend_hash_find(&ce->function_table, ZEND_STRS("offsetexists"), (void **)&function); \ - if (function->common.scope != ce) { \ - pimple_object_handlers.has_dimension = pimple_object_has_dimension; \ - } \ - zend_hash_find(&ce->function_table, ZEND_STRS("offsetunset"), (void **)&function); \ - if (function->common.scope != ce) { \ - pimple_object_handlers.unset_dimension = pimple_object_unset_dimension; \ - } \ - } else { \ - pimple_object_handlers.read_dimension = pimple_object_read_dimension; \ - pimple_object_handlers.write_dimension = pimple_object_write_dimension; \ - pimple_object_handlers.has_dimension = pimple_object_has_dimension; \ - pimple_object_handlers.unset_dimension = pimple_object_unset_dimension; \ - }\ - } while(0); - -#define PIMPLE_CALL_CB do { \ - zend_fcall_info_argn(&fci TSRMLS_CC, 1, &object); \ - fci.size = sizeof(fci); \ - fci.object_ptr = retval->fcc.object_ptr; \ - fci.function_name = retval->value; \ - fci.no_separation = 1; \ - fci.retval_ptr_ptr = &retval_ptr_ptr; \ -\ - zend_call_function(&fci, &retval->fcc TSRMLS_CC); \ - efree(fci.params); \ - if (EG(exception)) { \ - return EG(uninitialized_zval_ptr); \ - } \ - } while(0); - -ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, 0, 0, 0) -ZEND_ARG_ARRAY_INFO(0, value, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetset, 0, 0, 2) -ZEND_ARG_INFO(0, offset) -ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetget, 0, 0, 1) -ZEND_ARG_INFO(0, offset) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetexists, 0, 0, 1) -ZEND_ARG_INFO(0, offset) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetunset, 0, 0, 1) -ZEND_ARG_INFO(0, offset) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_factory, 0, 0, 1) -ZEND_ARG_INFO(0, callable) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_protect, 0, 0, 1) -ZEND_ARG_INFO(0, callable) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_raw, 0, 0, 1) -ZEND_ARG_INFO(0, id) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_extend, 0, 0, 2) -ZEND_ARG_INFO(0, id) -ZEND_ARG_INFO(0, callable) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_keys, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_register, 0, 0, 1) -ZEND_ARG_OBJ_INFO(0, provider, Pimple\\ServiceProviderInterface, 0) -ZEND_ARG_ARRAY_INFO(0, values, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_serviceprovider_register, 0, 0, 1) -ZEND_ARG_OBJ_INFO(0, pimple, Pimple\\Container, 0) -ZEND_END_ARG_INFO() - -static const zend_function_entry pimple_ce_functions[] = { - PHP_ME(Pimple, __construct, arginfo___construct, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, factory, arginfo_factory, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, protect, arginfo_protect, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, raw, arginfo_raw, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, extend, arginfo_extend, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, keys, arginfo_keys, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, register, arginfo_register, ZEND_ACC_PUBLIC) - - PHP_ME(Pimple, offsetSet, arginfo_offsetset, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, offsetGet, arginfo_offsetget, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, offsetExists, arginfo_offsetexists, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, offsetUnset, arginfo_offsetunset, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - -static const zend_function_entry pimple_serviceprovider_iface_ce_functions[] = { - PHP_ABSTRACT_ME(ServiceProviderInterface, register, arginfo_serviceprovider_register) - PHP_FE_END -}; - -static void pimple_closure_free_object_storage(pimple_closure_object *obj TSRMLS_DC) -{ - zend_object_std_dtor(&obj->zobj TSRMLS_CC); - if (obj->factory) { - zval_ptr_dtor(&obj->factory); - } - if (obj->callable) { - zval_ptr_dtor(&obj->callable); - } - efree(obj); -} - -static void pimple_free_object_storage(pimple_object *obj TSRMLS_DC) -{ - zend_hash_destroy(&obj->factories); - zend_hash_destroy(&obj->protected); - zend_hash_destroy(&obj->values); - zend_object_std_dtor(&obj->zobj TSRMLS_CC); - efree(obj); -} - -static void pimple_free_bucket(pimple_bucket_value *bucket) -{ - if (bucket->raw) { - zval_ptr_dtor(&bucket->raw); - } -} - -static zend_object_value pimple_closure_object_create(zend_class_entry *ce TSRMLS_DC) -{ - zend_object_value retval; - pimple_closure_object *pimple_closure_obj = NULL; - - pimple_closure_obj = ecalloc(1, sizeof(pimple_closure_object)); - ZEND_OBJ_INIT(&pimple_closure_obj->zobj, ce); - - pimple_closure_object_handlers.get_constructor = pimple_closure_get_constructor; - retval.handlers = &pimple_closure_object_handlers; - retval.handle = zend_objects_store_put(pimple_closure_obj, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) pimple_closure_free_object_storage, NULL TSRMLS_CC); - - return retval; -} - -static zend_function *pimple_closure_get_constructor(zval *obj TSRMLS_DC) -{ - zend_error(E_ERROR, "Pimple\\ContainerClosure is an internal class and cannot be instantiated"); - - return NULL; -} - -static int pimple_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, union _zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC) -{ - *zobj_ptr = obj; - *ce_ptr = Z_OBJCE_P(obj); - *fptr_ptr = (zend_function *)&pimple_closure_invoker_function; - - return SUCCESS; -} - -static zend_object_value pimple_object_create(zend_class_entry *ce TSRMLS_DC) -{ - zend_object_value retval; - pimple_object *pimple_obj = NULL; - zend_function *function = NULL; - - pimple_obj = emalloc(sizeof(pimple_object)); - ZEND_OBJ_INIT(&pimple_obj->zobj, ce); - - PIMPLE_OBJECT_HANDLE_INHERITANCE_OBJECT_HANDLERS - - retval.handlers = &pimple_object_handlers; - retval.handle = zend_objects_store_put(pimple_obj, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) pimple_free_object_storage, NULL TSRMLS_CC); - - zend_hash_init(&pimple_obj->factories, PIMPLE_DEFAULT_ZVAL_CACHE_NUM, NULL, (dtor_func_t)pimple_bucket_dtor, 0); - zend_hash_init(&pimple_obj->protected, PIMPLE_DEFAULT_ZVAL_CACHE_NUM, NULL, (dtor_func_t)pimple_bucket_dtor, 0); - zend_hash_init(&pimple_obj->values, PIMPLE_DEFAULT_ZVAL_VALUES_NUM, NULL, (dtor_func_t)pimple_bucket_dtor, 0); - - return retval; -} - -static void pimple_object_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) -{ - FETCH_DIM_HANDLERS_VARS - - pimple_bucket_value pimple_value = {0}, *found_value = NULL; - ulong hash; - - pimple_zval_to_pimpleval(value, &pimple_value TSRMLS_CC); - - if (!offset) {/* $p[] = 'foo' when not overloaded */ - zend_hash_next_index_insert(&pimple_obj->values, (void *)&pimple_value, sizeof(pimple_bucket_value), NULL); - Z_ADDREF_P(value); - return; - } - - switch (Z_TYPE_P(offset)) { - case IS_STRING: - hash = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - zend_hash_quick_find(&pimple_obj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hash, (void **)&found_value); - if (found_value && found_value->type == PIMPLE_IS_SERVICE && found_value->initialized == 1) { - pimple_free_bucket(&pimple_value); - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot override frozen service \"%s\".", Z_STRVAL_P(offset)); - return; - } - if (zend_hash_quick_update(&pimple_obj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hash, (void *)&pimple_value, sizeof(pimple_bucket_value), NULL) == FAILURE) { - pimple_free_bucket(&pimple_value); - return; - } - Z_ADDREF_P(value); - break; - case IS_DOUBLE: - case IS_BOOL: - case IS_LONG: - if (Z_TYPE_P(offset) == IS_DOUBLE) { - index = (ulong)Z_DVAL_P(offset); - } else { - index = Z_LVAL_P(offset); - } - zend_hash_index_find(&pimple_obj->values, index, (void **)&found_value); - if (found_value && found_value->type == PIMPLE_IS_SERVICE && found_value->initialized == 1) { - pimple_free_bucket(&pimple_value); - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot override frozen service \"%ld\".", index); - return; - } - if (zend_hash_index_update(&pimple_obj->values, index, (void *)&pimple_value, sizeof(pimple_bucket_value), NULL) == FAILURE) { - pimple_free_bucket(&pimple_value); - return; - } - Z_ADDREF_P(value); - break; - case IS_NULL: /* $p[] = 'foo' when overloaded */ - zend_hash_next_index_insert(&pimple_obj->values, (void *)&pimple_value, sizeof(pimple_bucket_value), NULL); - Z_ADDREF_P(value); - break; - default: - pimple_free_bucket(&pimple_value); - zend_error(E_WARNING, "Unsupported offset type"); - } -} - -static void pimple_object_unset_dimension(zval *object, zval *offset TSRMLS_DC) -{ - FETCH_DIM_HANDLERS_VARS - - switch (Z_TYPE_P(offset)) { - case IS_STRING: - zend_symtable_del(&pimple_obj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - zend_symtable_del(&pimple_obj->factories, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - zend_symtable_del(&pimple_obj->protected, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - break; - case IS_DOUBLE: - case IS_BOOL: - case IS_LONG: - if (Z_TYPE_P(offset) == IS_DOUBLE) { - index = (ulong)Z_DVAL_P(offset); - } else { - index = Z_LVAL_P(offset); - } - zend_hash_index_del(&pimple_obj->values, index); - zend_hash_index_del(&pimple_obj->factories, index); - zend_hash_index_del(&pimple_obj->protected, index); - break; - default: - zend_error(E_WARNING, "Unsupported offset type"); - } -} - -static int pimple_object_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC) -{ - FETCH_DIM_HANDLERS_VARS - - pimple_bucket_value *retval = NULL; - - switch (Z_TYPE_P(offset)) { - case IS_STRING: - if (zend_symtable_find(&pimple_obj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **)&retval) == SUCCESS) { - switch (check_empty) { - case 0: /* isset */ - return 1; /* Differs from PHP behavior (Z_TYPE_P(retval->value) != IS_NULL;) */ - case 1: /* empty */ - default: - return zend_is_true(retval->value); - } - } - return 0; - break; - case IS_DOUBLE: - case IS_BOOL: - case IS_LONG: - if (Z_TYPE_P(offset) == IS_DOUBLE) { - index = (ulong)Z_DVAL_P(offset); - } else { - index = Z_LVAL_P(offset); - } - if (zend_hash_index_find(&pimple_obj->values, index, (void **)&retval) == SUCCESS) { - switch (check_empty) { - case 0: /* isset */ - return 1; /* Differs from PHP behavior (Z_TYPE_P(retval->value) != IS_NULL;)*/ - case 1: /* empty */ - default: - return zend_is_true(retval->value); - } - } - return 0; - break; - default: - zend_error(E_WARNING, "Unsupported offset type"); - return 0; - } -} - -static zval *pimple_object_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) -{ - FETCH_DIM_HANDLERS_VARS - - pimple_bucket_value *retval = NULL; - zend_fcall_info fci = {0}; - zval *retval_ptr_ptr = NULL; - - switch (Z_TYPE_P(offset)) { - case IS_STRING: - if (zend_symtable_find(&pimple_obj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **)&retval) == FAILURE) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Identifier \"%s\" is not defined.", Z_STRVAL_P(offset)); - return EG(uninitialized_zval_ptr); - } - break; - case IS_DOUBLE: - case IS_BOOL: - case IS_LONG: - if (Z_TYPE_P(offset) == IS_DOUBLE) { - index = (ulong)Z_DVAL_P(offset); - } else { - index = Z_LVAL_P(offset); - } - if (zend_hash_index_find(&pimple_obj->values, index, (void **)&retval) == FAILURE) { - return EG(uninitialized_zval_ptr); - } - break; - case IS_NULL: /* $p[][3] = 'foo' first dim access */ - return EG(uninitialized_zval_ptr); - break; - default: - zend_error(E_WARNING, "Unsupported offset type"); - return EG(uninitialized_zval_ptr); - } - - if(retval->type == PIMPLE_IS_PARAM) { - return retval->value; - } - - if (zend_hash_index_exists(&pimple_obj->protected, retval->handle_num)) { - /* Service is protected, return the value every time */ - return retval->value; - } - - if (zend_hash_index_exists(&pimple_obj->factories, retval->handle_num)) { - /* Service is a factory, call it every time and never cache its result */ - PIMPLE_CALL_CB - Z_DELREF_P(retval_ptr_ptr); /* fetch dim addr will increment refcount */ - return retval_ptr_ptr; - } - - if (retval->initialized == 1) { - /* Service has already been called, return its cached value */ - return retval->value; - } - - ALLOC_INIT_ZVAL(retval->raw); - MAKE_COPY_ZVAL(&retval->value, retval->raw); - - PIMPLE_CALL_CB - - retval->initialized = 1; - zval_ptr_dtor(&retval->value); - retval->value = retval_ptr_ptr; - - return retval->value; -} - -static int pimple_zval_is_valid_callback(zval *_zval, pimple_bucket_value *_pimple_bucket_value TSRMLS_DC) -{ - if (Z_TYPE_P(_zval) != IS_OBJECT) { - return FAILURE; - } - - if (_pimple_bucket_value->fcc.called_scope) { - return SUCCESS; - } - - if (Z_OBJ_HANDLER_P(_zval, get_closure) && Z_OBJ_HANDLER_P(_zval, get_closure)(_zval, &_pimple_bucket_value->fcc.calling_scope, &_pimple_bucket_value->fcc.function_handler, &_pimple_bucket_value->fcc.object_ptr TSRMLS_CC) == SUCCESS) { - _pimple_bucket_value->fcc.called_scope = _pimple_bucket_value->fcc.calling_scope; - return SUCCESS; - } else { - return FAILURE; - } -} - -static int pimple_zval_to_pimpleval(zval *_zval, pimple_bucket_value *_pimple_bucket_value TSRMLS_DC) -{ - _pimple_bucket_value->value = _zval; - - if (Z_TYPE_P(_zval) != IS_OBJECT) { - return PIMPLE_IS_PARAM; - } - - if (pimple_zval_is_valid_callback(_zval, _pimple_bucket_value TSRMLS_CC) == SUCCESS) { - _pimple_bucket_value->type = PIMPLE_IS_SERVICE; - _pimple_bucket_value->handle_num = Z_OBJ_HANDLE_P(_zval); - } - - return PIMPLE_IS_SERVICE; -} - -static void pimple_bucket_dtor(pimple_bucket_value *bucket) -{ - zval_ptr_dtor(&bucket->value); - pimple_free_bucket(bucket); -} - -PHP_METHOD(Pimple, protect) -{ - zval *protected = NULL; - pimple_object *pobj = NULL; - pimple_bucket_value bucket = {0}; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &protected) == FAILURE) { - return; - } - - if (pimple_zval_is_valid_callback(protected, &bucket TSRMLS_CC) == FAILURE) { - pimple_free_bucket(&bucket); - zend_throw_exception(spl_ce_InvalidArgumentException, "Callable is not a Closure or invokable object.", 0 TSRMLS_CC); - return; - } - - pimple_zval_to_pimpleval(protected, &bucket TSRMLS_CC); - pobj = (pimple_object *)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_hash_index_update(&pobj->protected, bucket.handle_num, (void *)&bucket, sizeof(pimple_bucket_value), NULL) == SUCCESS) { - Z_ADDREF_P(protected); - RETURN_ZVAL(protected, 1 , 0); - } else { - pimple_free_bucket(&bucket); - } - RETURN_FALSE; -} - -PHP_METHOD(Pimple, raw) -{ - zval *offset = NULL; - pimple_object *pobj = NULL; - pimple_bucket_value *value = NULL; - ulong index; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &offset) == FAILURE) { - return; - } - - pobj = zend_object_store_get_object(getThis() TSRMLS_CC); - - switch (Z_TYPE_P(offset)) { - case IS_STRING: - if (zend_symtable_find(&pobj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void *)&value) == FAILURE) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Identifier \"%s\" is not defined.", Z_STRVAL_P(offset)); - RETURN_NULL(); - } - break; - case IS_DOUBLE: - case IS_BOOL: - case IS_LONG: - if (Z_TYPE_P(offset) == IS_DOUBLE) { - index = (ulong)Z_DVAL_P(offset); - } else { - index = Z_LVAL_P(offset); - } - if (zend_hash_index_find(&pobj->values, index, (void *)&value) == FAILURE) { - RETURN_NULL(); - } - break; - case IS_NULL: - default: - zend_error(E_WARNING, "Unsupported offset type"); - } - - if (value->raw) { - RETVAL_ZVAL(value->raw, 1, 0); - } else { - RETVAL_ZVAL(value->value, 1, 0); - } -} - -PHP_METHOD(Pimple, extend) -{ - zval *offset = NULL, *callable = NULL, *pimple_closure_obj = NULL; - pimple_bucket_value bucket = {0}, *value = NULL; - pimple_object *pobj = NULL; - pimple_closure_object *pcobj = NULL; - ulong index; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &offset, &callable) == FAILURE) { - return; - } - - pobj = zend_object_store_get_object(getThis() TSRMLS_CC); - - switch (Z_TYPE_P(offset)) { - case IS_STRING: - if (zend_symtable_find(&pobj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void *)&value) == FAILURE) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Identifier \"%s\" is not defined.", Z_STRVAL_P(offset)); - RETURN_NULL(); - } - if (value->type != PIMPLE_IS_SERVICE) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Identifier \"%s\" does not contain an object definition.", Z_STRVAL_P(offset)); - RETURN_NULL(); - } - break; - case IS_DOUBLE: - case IS_BOOL: - case IS_LONG: - if (Z_TYPE_P(offset) == IS_DOUBLE) { - index = (ulong)Z_DVAL_P(offset); - } else { - index = Z_LVAL_P(offset); - } - if (zend_hash_index_find(&pobj->values, index, (void *)&value) == FAILURE) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Identifier \"%ld\" is not defined.", index); - RETURN_NULL(); - } - if (value->type != PIMPLE_IS_SERVICE) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Identifier \"%ld\" does not contain an object definition.", index); - RETURN_NULL(); - } - break; - case IS_NULL: - default: - zend_error(E_WARNING, "Unsupported offset type"); - } - - if (pimple_zval_is_valid_callback(callable, &bucket TSRMLS_CC) == FAILURE) { - pimple_free_bucket(&bucket); - zend_throw_exception(spl_ce_InvalidArgumentException, "Extension service definition is not a Closure or invokable object.", 0 TSRMLS_CC); - RETURN_NULL(); - } - pimple_free_bucket(&bucket); - - ALLOC_INIT_ZVAL(pimple_closure_obj); - object_init_ex(pimple_closure_obj, pimple_closure_ce); - - pcobj = zend_object_store_get_object(pimple_closure_obj TSRMLS_CC); - pcobj->callable = callable; - pcobj->factory = value->value; - Z_ADDREF_P(callable); - Z_ADDREF_P(value->value); - - if (zend_hash_index_exists(&pobj->factories, value->handle_num)) { - pimple_zval_to_pimpleval(pimple_closure_obj, &bucket TSRMLS_CC); - zend_hash_index_del(&pobj->factories, value->handle_num); - zend_hash_index_update(&pobj->factories, bucket.handle_num, (void *)&bucket, sizeof(pimple_bucket_value), NULL); - Z_ADDREF_P(pimple_closure_obj); - } - - pimple_object_write_dimension(getThis(), offset, pimple_closure_obj TSRMLS_CC); - - RETVAL_ZVAL(pimple_closure_obj, 1, 1); -} - -PHP_METHOD(Pimple, keys) -{ - HashPosition pos; - pimple_object *pobj = NULL; - zval **value = NULL; - zval *endval = NULL; - char *str_index = NULL; - int str_len; - ulong num_index; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - pobj = zend_object_store_get_object(getThis() TSRMLS_CC); - array_init_size(return_value, zend_hash_num_elements(&pobj->values)); - - zend_hash_internal_pointer_reset_ex(&pobj->values, &pos); - - while(zend_hash_get_current_data_ex(&pobj->values, (void **)&value, &pos) == SUCCESS) { - MAKE_STD_ZVAL(endval); - switch (zend_hash_get_current_key_ex(&pobj->values, &str_index, (uint *)&str_len, &num_index, 0, &pos)) { - case HASH_KEY_IS_STRING: - ZVAL_STRINGL(endval, str_index, str_len - 1, 1); - zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &endval, sizeof(zval *), NULL); - break; - case HASH_KEY_IS_LONG: - ZVAL_LONG(endval, num_index); - zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &endval, sizeof(zval *), NULL); - break; - } - zend_hash_move_forward_ex(&pobj->values, &pos); - } -} - -PHP_METHOD(Pimple, factory) -{ - zval *factory = NULL; - pimple_object *pobj = NULL; - pimple_bucket_value bucket = {0}; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &factory) == FAILURE) { - return; - } - - if (pimple_zval_is_valid_callback(factory, &bucket TSRMLS_CC) == FAILURE) { - pimple_free_bucket(&bucket); - zend_throw_exception(spl_ce_InvalidArgumentException, "Service definition is not a Closure or invokable object.", 0 TSRMLS_CC); - return; - } - - pimple_zval_to_pimpleval(factory, &bucket TSRMLS_CC); - pobj = (pimple_object *)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_hash_index_update(&pobj->factories, bucket.handle_num, (void *)&bucket, sizeof(pimple_bucket_value), NULL) == SUCCESS) { - Z_ADDREF_P(factory); - RETURN_ZVAL(factory, 1 , 0); - } else { - pimple_free_bucket(&bucket); - } - - RETURN_FALSE; -} - -PHP_METHOD(Pimple, offsetSet) -{ - zval *offset = NULL, *value = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &offset, &value) == FAILURE) { - return; - } - - pimple_object_write_dimension(getThis(), offset, value TSRMLS_CC); -} - -PHP_METHOD(Pimple, offsetGet) -{ - zval *offset = NULL, *retval = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &offset) == FAILURE) { - return; - } - - retval = pimple_object_read_dimension(getThis(), offset, 0 TSRMLS_CC); - - RETVAL_ZVAL(retval, 1, 0); -} - -PHP_METHOD(Pimple, offsetUnset) -{ - zval *offset = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &offset) == FAILURE) { - return; - } - - pimple_object_unset_dimension(getThis(), offset TSRMLS_CC); -} - -PHP_METHOD(Pimple, offsetExists) -{ - zval *offset = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &offset) == FAILURE) { - return; - } - - RETVAL_BOOL(pimple_object_has_dimension(getThis(), offset, 1 TSRMLS_CC)); -} - -PHP_METHOD(Pimple, register) -{ - zval *provider; - zval **data; - zval *retval = NULL; - zval key; - - HashTable *array = NULL; - HashPosition pos; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|h", &provider, pimple_serviceprovider_ce, &array) == FAILURE) { - return; - } - - RETVAL_ZVAL(getThis(), 1, 0); - - zend_call_method_with_1_params(&provider, Z_OBJCE_P(provider), NULL, "register", &retval, getThis()); - - if (retval) { - zval_ptr_dtor(&retval); - } - - if (!array) { - return; - } - - zend_hash_internal_pointer_reset_ex(array, &pos); - - while(zend_hash_get_current_data_ex(array, (void **)&data, &pos) == SUCCESS) { - zend_hash_get_current_key_zval_ex(array, &key, &pos); - pimple_object_write_dimension(getThis(), &key, *data TSRMLS_CC); - zend_hash_move_forward_ex(array, &pos); - } -} - -PHP_METHOD(Pimple, __construct) -{ - zval *values = NULL, **pData = NULL, offset; - HashPosition pos; - char *str_index = NULL; - zend_uint str_length; - ulong num_index; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!", &values) == FAILURE || !values) { - return; - } - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(values), &pos); - while (zend_hash_has_more_elements_ex(Z_ARRVAL_P(values), &pos) == SUCCESS) { - zend_hash_get_current_data_ex(Z_ARRVAL_P(values), (void **)&pData, &pos); - zend_hash_get_current_key_ex(Z_ARRVAL_P(values), &str_index, &str_length, &num_index, 0, &pos); - INIT_ZVAL(offset); - if (zend_hash_get_current_key_type_ex(Z_ARRVAL_P(values), &pos) == HASH_KEY_IS_LONG) { - ZVAL_LONG(&offset, num_index); - } else { - ZVAL_STRINGL(&offset, str_index, (str_length - 1), 0); - } - pimple_object_write_dimension(getThis(), &offset, *pData TSRMLS_CC); - zend_hash_move_forward_ex(Z_ARRVAL_P(values), &pos); - } -} - -/* - * This is PHP code snippet handling extend()s calls : - - $extended = function ($c) use ($callable, $factory) { - return $callable($factory($c), $c); - }; - - */ -PHP_METHOD(PimpleClosure, invoker) -{ - pimple_closure_object *pcobj = NULL; - zval *arg = NULL, *retval = NULL, *newretval = NULL; - zend_fcall_info fci = {0}; - zval **args[2]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { - return; - } - - pcobj = zend_object_store_get_object(getThis() TSRMLS_CC); - - fci.function_name = pcobj->factory; - args[0] = &arg; - zend_fcall_info_argp(&fci TSRMLS_CC, 1, args); - fci.retval_ptr_ptr = &retval; - fci.size = sizeof(fci); - - if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE || EG(exception)) { - efree(fci.params); - return; /* Should here return default zval */ - } - - efree(fci.params); - memset(&fci, 0, sizeof(fci)); - fci.size = sizeof(fci); - - fci.function_name = pcobj->callable; - args[0] = &retval; - args[1] = &arg; - zend_fcall_info_argp(&fci TSRMLS_CC, 2, args); - fci.retval_ptr_ptr = &newretval; - - if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE || EG(exception)) { - efree(fci.params); - zval_ptr_dtor(&retval); - return; - } - - efree(fci.params); - zval_ptr_dtor(&retval); - - RETVAL_ZVAL(newretval, 1 ,1); -} - -PHP_MINIT_FUNCTION(pimple) -{ - zend_class_entry tmp_pimple_ce, tmp_pimple_closure_ce, tmp_pimple_serviceprovider_iface_ce; - INIT_NS_CLASS_ENTRY(tmp_pimple_ce, PIMPLE_NS, "Container", pimple_ce_functions); - INIT_NS_CLASS_ENTRY(tmp_pimple_closure_ce, PIMPLE_NS, "ContainerClosure", NULL); - INIT_NS_CLASS_ENTRY(tmp_pimple_serviceprovider_iface_ce, PIMPLE_NS, "ServiceProviderInterface", pimple_serviceprovider_iface_ce_functions); - - tmp_pimple_ce.create_object = pimple_object_create; - tmp_pimple_closure_ce.create_object = pimple_closure_object_create; - - pimple_ce = zend_register_internal_class(&tmp_pimple_ce TSRMLS_CC); - zend_class_implements(pimple_ce TSRMLS_CC, 1, zend_ce_arrayaccess); - - pimple_closure_ce = zend_register_internal_class(&tmp_pimple_closure_ce TSRMLS_CC); - pimple_closure_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; - - pimple_serviceprovider_ce = zend_register_internal_interface(&tmp_pimple_serviceprovider_iface_ce TSRMLS_CC); - - memcpy(&pimple_closure_object_handlers, zend_get_std_object_handlers(), sizeof(*zend_get_std_object_handlers())); - pimple_object_handlers = std_object_handlers; - pimple_closure_object_handlers.get_closure = pimple_closure_get_closure; - - pimple_closure_invoker_function.function_name = "Pimple closure internal invoker"; - pimple_closure_invoker_function.fn_flags |= ZEND_ACC_CLOSURE; - pimple_closure_invoker_function.handler = ZEND_MN(PimpleClosure_invoker); - pimple_closure_invoker_function.num_args = 1; - pimple_closure_invoker_function.required_num_args = 1; - pimple_closure_invoker_function.scope = pimple_closure_ce; - pimple_closure_invoker_function.type = ZEND_INTERNAL_FUNCTION; - pimple_closure_invoker_function.module = &pimple_module_entry; - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(pimple) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "SensioLabs Pimple C support", "enabled"); - php_info_print_table_row(2, "Pimple supported version", PIMPLE_VERSION); - php_info_print_table_end(); - - php_info_print_box_start(0); - php_write((void *)ZEND_STRL("SensioLabs Pimple C support developed by Julien Pauli") TSRMLS_CC); - if (!sapi_module.phpinfo_as_text) { - php_write((void *)ZEND_STRL(sensiolabs_logo) TSRMLS_CC); - } - php_info_print_box_end(); -} - -zend_module_entry pimple_module_entry = { - STANDARD_MODULE_HEADER, - "pimple", - NULL, - PHP_MINIT(pimple), - NULL, - NULL, - NULL, - PHP_MINFO(pimple), - PIMPLE_VERSION, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_PIMPLE -ZEND_GET_MODULE(pimple) -#endif diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/pimple_compat.h b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/pimple_compat.h deleted file mode 100644 index d234e174d0a..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/pimple_compat.h +++ /dev/null @@ -1,81 +0,0 @@ - -/* - * This file is part of Pimple. - * - * Copyright (c) 2014 Fabien Potencier - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished - * to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef PIMPLE_COMPAT_H_ -#define PIMPLE_COMPAT_H_ - -#include "Zend/zend_extensions.h" /* for ZEND_EXTENSION_API_NO */ - -#define PHP_5_0_X_API_NO 220040412 -#define PHP_5_1_X_API_NO 220051025 -#define PHP_5_2_X_API_NO 220060519 -#define PHP_5_3_X_API_NO 220090626 -#define PHP_5_4_X_API_NO 220100525 -#define PHP_5_5_X_API_NO 220121212 -#define PHP_5_6_X_API_NO 220131226 - -#define IS_PHP_56 ZEND_EXTENSION_API_NO == PHP_5_6_X_API_NO -#define IS_AT_LEAST_PHP_56 ZEND_EXTENSION_API_NO >= PHP_5_6_X_API_NO - -#define IS_PHP_55 ZEND_EXTENSION_API_NO == PHP_5_5_X_API_NO -#define IS_AT_LEAST_PHP_55 ZEND_EXTENSION_API_NO >= PHP_5_5_X_API_NO - -#define IS_PHP_54 ZEND_EXTENSION_API_NO == PHP_5_4_X_API_NO -#define IS_AT_LEAST_PHP_54 ZEND_EXTENSION_API_NO >= PHP_5_4_X_API_NO - -#define IS_PHP_53 ZEND_EXTENSION_API_NO == PHP_5_3_X_API_NO -#define IS_AT_LEAST_PHP_53 ZEND_EXTENSION_API_NO >= PHP_5_3_X_API_NO - -#if IS_PHP_53 -#define object_properties_init(obj, ce) do { \ - zend_hash_copy(obj->properties, &ce->default_properties, zval_copy_property_ctor(ce), NULL, sizeof(zval *)); \ - } while (0); -#endif - -#define ZEND_OBJ_INIT(obj, ce) do { \ - zend_object_std_init(obj, ce TSRMLS_CC); \ - object_properties_init((obj), (ce)); \ - } while(0); - -#if IS_PHP_53 || IS_PHP_54 -static void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos) { - Bucket *p; - - p = pos ? (*pos) : ht->pInternalPointer; - - if (!p) { - Z_TYPE_P(key) = IS_NULL; - } else if (p->nKeyLength) { - Z_TYPE_P(key) = IS_STRING; - Z_STRVAL_P(key) = estrndup(p->arKey, p->nKeyLength - 1); - Z_STRLEN_P(key) = p->nKeyLength - 1; - } else { - Z_TYPE_P(key) = IS_LONG; - Z_LVAL_P(key) = p->h; - } -} -#endif - -#endif /* PIMPLE_COMPAT_H_ */ diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/001.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/001.phpt deleted file mode 100644 index 0809ea232b6..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/001.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test for read_dim/write_dim handlers ---SKIPIF-- - ---FILE-- - - ---EXPECTF-- -foo -42 -foo2 -foo99 -baz -strstr \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/002.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/002.phpt deleted file mode 100644 index 7b56d2c1fe8..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/002.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Test for constructor ---SKIPIF-- - ---FILE-- -'foo')); -var_dump($p[42]); -?> ---EXPECT-- -NULL -string(3) "foo" diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/003.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/003.phpt deleted file mode 100644 index a22cfa352ea..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/003.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Test empty dimensions ---SKIPIF-- - ---FILE-- - ---EXPECT-- -int(42) -string(3) "bar" \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/004.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/004.phpt deleted file mode 100644 index 1e1d2513679..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/004.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Test has/unset dim handlers ---SKIPIF-- - ---FILE-- - ---EXPECT-- -int(42) -NULL -bool(true) -bool(false) -bool(true) -bool(true) \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/005.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/005.phpt deleted file mode 100644 index 0479ee055de..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/005.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test simple class inheritance ---SKIPIF-- - ---FILE-- -someAttr; -?> ---EXPECT-- -string(3) "hit" -foo -fooAttr \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/006.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/006.phpt deleted file mode 100644 index cfe8a119e63..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/006.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -Test complex class inheritance ---SKIPIF-- - ---FILE-- - 'bar', 88 => 'baz'); - -$p = new TestPimple($defaultValues); -$p[42] = 'foo'; -var_dump($p[42]); -var_dump($p[0]); -?> ---EXPECT-- -string(13) "hit offsetset" -string(27) "hit offsetget in TestPimple" -string(25) "hit offsetget in MyPimple" -string(3) "foo" -string(27) "hit offsetget in TestPimple" -string(25) "hit offsetget in MyPimple" -string(3) "baz" \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/007.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/007.phpt deleted file mode 100644 index 5aac6838064..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/007.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test for read_dim/write_dim handlers ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -foo -42 \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/008.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/008.phpt deleted file mode 100644 index db7eeec4a11..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/008.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test frozen services ---SKIPIF-- - ---FILE-- - ---EXPECTF-- diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/009.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/009.phpt deleted file mode 100644 index bb05ea29648..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/009.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Test service is called as callback, and only once ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/010.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/010.phpt deleted file mode 100644 index badce0146a9..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/010.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test service is called as callback for every callback type ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -callme -called -Foo::bar -array(2) { - [0]=> - string(3) "Foo" - [1]=> - string(3) "bar" -} \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/011.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/011.phpt deleted file mode 100644 index 6682ab8ebdb..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/011.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Test service callback throwing an exception ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -all right! \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/012.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/012.phpt deleted file mode 100644 index 4c6ac486dc7..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/012.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Test service factory ---SKIPIF-- - ---FILE-- -factory($f = function() { var_dump('called-1'); return 'ret-1';}); - -$p[] = $f; - -$p[] = function () { var_dump('called-2'); return 'ret-2'; }; - -var_dump($p[0]); -var_dump($p[0]); -var_dump($p[1]); -var_dump($p[1]); -?> ---EXPECTF-- -string(8) "called-1" -string(5) "ret-1" -string(8) "called-1" -string(5) "ret-1" -string(8) "called-2" -string(5) "ret-2" -string(5) "ret-2" \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/013.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/013.phpt deleted file mode 100644 index f419958c5fa..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/013.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Test keys() ---SKIPIF-- - ---FILE-- -keys()); - -$p['foo'] = 'bar'; -$p[] = 'foo'; - -var_dump($p->keys()); - -unset($p['foo']); - -var_dump($p->keys()); -?> ---EXPECTF-- -array(0) { -} -array(2) { - [0]=> - string(3) "foo" - [1]=> - int(0) -} -array(1) { - [0]=> - int(0) -} \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/014.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/014.phpt deleted file mode 100644 index ac937213ac0..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/014.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Test raw() ---SKIPIF-- - ---FILE-- -raw('foo')); -var_dump($p[42]); - -unset($p['foo']); - -try { - $p->raw('foo'); - echo "expected exception"; -} catch (InvalidArgumentException $e) { } ---EXPECTF-- -string(8) "called-2" -string(5) "ret-2" -object(Closure)#%i (0) { -} -string(8) "called-2" -string(5) "ret-2" \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/015.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/015.phpt deleted file mode 100644 index 314f008ac1b..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/015.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Test protect() ---SKIPIF-- - ---FILE-- -protect($f); - -var_dump($p['foo']); ---EXPECTF-- -object(Closure)#%i (0) { -} \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/016.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/016.phpt deleted file mode 100644 index e55edb0a7a1..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/016.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test extend() ---SKIPIF-- - ---FILE-- -extend(12, function ($w) { var_dump($w); return 'bar'; }); /* $callable in code above */ - -var_dump($c('param')); ---EXPECTF-- -string(5) "param" -string(3) "foo" -string(3) "bar" \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/017.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/017.phpt deleted file mode 100644 index bac23ce09a9..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/017.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Test extend() with exception in service extension ---SKIPIF-- - ---FILE-- -extend(12, function ($w) { throw new BadMethodCallException; }); - -try { - $p[12]; - echo "Exception expected"; -} catch (BadMethodCallException $e) { } ---EXPECTF-- diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/017_1.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/017_1.phpt deleted file mode 100644 index 8f881d6ebf8..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/017_1.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Test extend() with exception in service factory ---SKIPIF-- - ---FILE-- -extend(12, function ($w) { return 'foobar'; }); - -try { - $p[12]; - echo "Exception expected"; -} catch (BadMethodCallException $e) { } ---EXPECTF-- diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/018.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/018.phpt deleted file mode 100644 index 27c12a14e79..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/018.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Test register() ---SKIPIF-- - ---FILE-- -register(new Foo, array(42 => 'bar')); - -var_dump($p[42]); ---EXPECTF-- -object(Pimple\Container)#1 (0) { -} -string(3) "bar" \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/019.phpt b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/019.phpt deleted file mode 100644 index 28a9aecac7f..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/019.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Test register() returns static and is a fluent interface ---SKIPIF-- - ---FILE-- -register(new Foo)); ---EXPECTF-- -bool(true) diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/bench.phpb b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/bench.phpb deleted file mode 100644 index 8f983e656b5..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/bench.phpb +++ /dev/null @@ -1,51 +0,0 @@ -factory($factory); - -$p['factory'] = $factory; - -echo $p['factory']; -echo $p['factory']; -echo $p['factory']; - -} - -echo microtime(true) - $time; diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/bench_shared.phpb b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/bench_shared.phpb deleted file mode 100644 index aec541f0bc8..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/ext/pimple/tests/bench_shared.phpb +++ /dev/null @@ -1,25 +0,0 @@ - diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/phpunit.xml.dist b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/phpunit.xml.dist deleted file mode 100644 index 5c8d487fea9..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/phpunit.xml.dist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - ./src/Pimple/Tests - - - diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Container.php b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Container.php deleted file mode 100644 index c976431e99a..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Container.php +++ /dev/null @@ -1,282 +0,0 @@ -factories = new \SplObjectStorage(); - $this->protected = new \SplObjectStorage(); - - foreach ($values as $key => $value) { - $this->offsetSet($key, $value); - } - } - - /** - * Sets a parameter or an object. - * - * Objects must be defined as Closures. - * - * Allowing any PHP callable leads to difficult to debug problems - * as function names (strings) are callable (creating a function with - * the same name as an existing parameter would break your container). - * - * @param string $id The unique identifier for the parameter or object - * @param mixed $value The value of the parameter or a closure to define an object - * - * @throws \RuntimeException Prevent override of a frozen service - */ - public function offsetSet($id, $value) - { - if (isset($this->frozen[$id])) { - throw new \RuntimeException(sprintf('Cannot override frozen service "%s".', $id)); - } - - $this->values[$id] = $value; - $this->keys[$id] = true; - } - - /** - * Gets a parameter or an object. - * - * @param string $id The unique identifier for the parameter or object - * - * @return mixed The value of the parameter or an object - * - * @throws \InvalidArgumentException if the identifier is not defined - */ - public function offsetGet($id) - { - if (!isset($this->keys[$id])) { - throw new \InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $id)); - } - - if ( - isset($this->raw[$id]) - || !is_object($this->values[$id]) - || isset($this->protected[$this->values[$id]]) - || !method_exists($this->values[$id], '__invoke') - ) { - return $this->values[$id]; - } - - if (isset($this->factories[$this->values[$id]])) { - return $this->values[$id]($this); - } - - $raw = $this->values[$id]; - $val = $this->values[$id] = $raw($this); - $this->raw[$id] = $raw; - - $this->frozen[$id] = true; - - return $val; - } - - /** - * Checks if a parameter or an object is set. - * - * @param string $id The unique identifier for the parameter or object - * - * @return bool - */ - public function offsetExists($id) - { - return isset($this->keys[$id]); - } - - /** - * Unsets a parameter or an object. - * - * @param string $id The unique identifier for the parameter or object - */ - public function offsetUnset($id) - { - if (isset($this->keys[$id])) { - if (is_object($this->values[$id])) { - unset($this->factories[$this->values[$id]], $this->protected[$this->values[$id]]); - } - - unset($this->values[$id], $this->frozen[$id], $this->raw[$id], $this->keys[$id]); - } - } - - /** - * Marks a callable as being a factory service. - * - * @param callable $callable A service definition to be used as a factory - * - * @return callable The passed callable - * - * @throws \InvalidArgumentException Service definition has to be a closure of an invokable object - */ - public function factory($callable) - { - if (!method_exists($callable, '__invoke')) { - throw new \InvalidArgumentException('Service definition is not a Closure or invokable object.'); - } - - $this->factories->attach($callable); - - return $callable; - } - - /** - * Protects a callable from being interpreted as a service. - * - * This is useful when you want to store a callable as a parameter. - * - * @param callable $callable A callable to protect from being evaluated - * - * @return callable The passed callable - * - * @throws \InvalidArgumentException Service definition has to be a closure of an invokable object - */ - public function protect($callable) - { - if (!method_exists($callable, '__invoke')) { - throw new \InvalidArgumentException('Callable is not a Closure or invokable object.'); - } - - $this->protected->attach($callable); - - return $callable; - } - - /** - * Gets a parameter or the closure defining an object. - * - * @param string $id The unique identifier for the parameter or object - * - * @return mixed The value of the parameter or the closure defining an object - * - * @throws \InvalidArgumentException if the identifier is not defined - */ - public function raw($id) - { - if (!isset($this->keys[$id])) { - throw new \InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $id)); - } - - if (isset($this->raw[$id])) { - return $this->raw[$id]; - } - - return $this->values[$id]; - } - - /** - * Extends an object definition. - * - * Useful when you want to extend an existing object definition, - * without necessarily loading that object. - * - * @param string $id The unique identifier for the object - * @param callable $callable A service definition to extend the original - * - * @return callable The wrapped callable - * - * @throws \InvalidArgumentException if the identifier is not defined or not a service definition - */ - public function extend($id, $callable) - { - if (!isset($this->keys[$id])) { - throw new \InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $id)); - } - - if (!is_object($this->values[$id]) || !method_exists($this->values[$id], '__invoke')) { - throw new \InvalidArgumentException(sprintf('Identifier "%s" does not contain an object definition.', $id)); - } - - if (!is_object($callable) || !method_exists($callable, '__invoke')) { - throw new \InvalidArgumentException('Extension service definition is not a Closure or invokable object.'); - } - - $factory = $this->values[$id]; - - $extended = function ($c) use ($callable, $factory) { - return $callable($factory($c), $c); - }; - - if (isset($this->factories[$factory])) { - $this->factories->detach($factory); - $this->factories->attach($extended); - } - - return $this[$id] = $extended; - } - - /** - * Returns all defined value names. - * - * @return array An array of value names - */ - public function keys() - { - return array_keys($this->values); - } - - /** - * Registers a service provider. - * - * @param ServiceProviderInterface $provider A ServiceProviderInterface instance - * @param array $values An array of values that customizes the provider - * - * @return static - */ - public function register(ServiceProviderInterface $provider, array $values = array()) - { - $provider->register($this); - - foreach ($values as $key => $value) { - $this[$key] = $value; - } - - return $this; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/ServiceProviderInterface.php b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/ServiceProviderInterface.php deleted file mode 100644 index c004594baf0..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/ServiceProviderInterface.php +++ /dev/null @@ -1,46 +0,0 @@ -value = $value; - - return $service; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php deleted file mode 100644 index 33cd4e54864..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php +++ /dev/null @@ -1,34 +0,0 @@ -factory(function () { - return new Service(); - }); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php deleted file mode 100644 index d71b184ddf7..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ -class Service -{ - public $value; -} diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php deleted file mode 100644 index 8e5c4c73deb..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php +++ /dev/null @@ -1,76 +0,0 @@ - - */ -class PimpleServiceProviderInterfaceTest extends \PHPUnit_Framework_TestCase -{ - public function testProvider() - { - $pimple = new Container(); - - $pimpleServiceProvider = new Fixtures\PimpleServiceProvider(); - $pimpleServiceProvider->register($pimple); - - $this->assertEquals('value', $pimple['param']); - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['service']); - - $serviceOne = $pimple['factory']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - - $serviceTwo = $pimple['factory']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - - $this->assertNotSame($serviceOne, $serviceTwo); - } - - public function testProviderWithRegisterMethod() - { - $pimple = new Container(); - - $pimple->register(new Fixtures\PimpleServiceProvider(), array( - 'anotherParameter' => 'anotherValue', - )); - - $this->assertEquals('value', $pimple['param']); - $this->assertEquals('anotherValue', $pimple['anotherParameter']); - - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['service']); - - $serviceOne = $pimple['factory']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - - $serviceTwo = $pimple['factory']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - - $this->assertNotSame($serviceOne, $serviceTwo); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php b/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php deleted file mode 100644 index 918f620d884..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php +++ /dev/null @@ -1,440 +0,0 @@ - - */ -class PimpleTest extends \PHPUnit_Framework_TestCase -{ - public function testWithString() - { - $pimple = new Container(); - $pimple['param'] = 'value'; - - $this->assertEquals('value', $pimple['param']); - } - - public function testWithClosure() - { - $pimple = new Container(); - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['service']); - } - - public function testServicesShouldBeDifferent() - { - $pimple = new Container(); - $pimple['service'] = $pimple->factory(function () { - return new Fixtures\Service(); - }); - - $serviceOne = $pimple['service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - - $serviceTwo = $pimple['service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - - $this->assertNotSame($serviceOne, $serviceTwo); - } - - public function testShouldPassContainerAsParameter() - { - $pimple = new Container(); - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - $pimple['container'] = function ($container) { - return $container; - }; - - $this->assertNotSame($pimple, $pimple['service']); - $this->assertSame($pimple, $pimple['container']); - } - - public function testIsset() - { - $pimple = new Container(); - $pimple['param'] = 'value'; - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - - $pimple['null'] = null; - - $this->assertTrue(isset($pimple['param'])); - $this->assertTrue(isset($pimple['service'])); - $this->assertTrue(isset($pimple['null'])); - $this->assertFalse(isset($pimple['non_existent'])); - } - - public function testConstructorInjection() - { - $params = array('param' => 'value'); - $pimple = new Container($params); - - $this->assertSame($params['param'], $pimple['param']); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Identifier "foo" is not defined. - */ - public function testOffsetGetValidatesKeyIsPresent() - { - $pimple = new Container(); - echo $pimple['foo']; - } - - public function testOffsetGetHonorsNullValues() - { - $pimple = new Container(); - $pimple['foo'] = null; - $this->assertNull($pimple['foo']); - } - - public function testUnset() - { - $pimple = new Container(); - $pimple['param'] = 'value'; - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - - unset($pimple['param'], $pimple['service']); - $this->assertFalse(isset($pimple['param'])); - $this->assertFalse(isset($pimple['service'])); - } - - /** - * @dataProvider serviceDefinitionProvider - */ - public function testShare($service) - { - $pimple = new Container(); - $pimple['shared_service'] = $service; - - $serviceOne = $pimple['shared_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - - $serviceTwo = $pimple['shared_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - - $this->assertSame($serviceOne, $serviceTwo); - } - - /** - * @dataProvider serviceDefinitionProvider - */ - public function testProtect($service) - { - $pimple = new Container(); - $pimple['protected'] = $pimple->protect($service); - - $this->assertSame($service, $pimple['protected']); - } - - public function testGlobalFunctionNameAsParameterValue() - { - $pimple = new Container(); - $pimple['global_function'] = 'strlen'; - $this->assertSame('strlen', $pimple['global_function']); - } - - public function testRaw() - { - $pimple = new Container(); - $pimple['service'] = $definition = $pimple->factory(function () { return 'foo'; }); - $this->assertSame($definition, $pimple->raw('service')); - } - - public function testRawHonorsNullValues() - { - $pimple = new Container(); - $pimple['foo'] = null; - $this->assertNull($pimple->raw('foo')); - } - - public function testFluentRegister() - { - $pimple = new Container(); - $this->assertSame($pimple, $pimple->register($this->getMock('Pimple\ServiceProviderInterface'))); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Identifier "foo" is not defined. - */ - public function testRawValidatesKeyIsPresent() - { - $pimple = new Container(); - $pimple->raw('foo'); - } - - /** - * @dataProvider serviceDefinitionProvider - */ - public function testExtend($service) - { - $pimple = new Container(); - $pimple['shared_service'] = function () { - return new Fixtures\Service(); - }; - $pimple['factory_service'] = $pimple->factory(function () { - return new Fixtures\Service(); - }); - - $pimple->extend('shared_service', $service); - $serviceOne = $pimple['shared_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - $serviceTwo = $pimple['shared_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - $this->assertSame($serviceOne, $serviceTwo); - $this->assertSame($serviceOne->value, $serviceTwo->value); - - $pimple->extend('factory_service', $service); - $serviceOne = $pimple['factory_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - $serviceTwo = $pimple['factory_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - $this->assertNotSame($serviceOne, $serviceTwo); - $this->assertNotSame($serviceOne->value, $serviceTwo->value); - } - - public function testExtendDoesNotLeakWithFactories() - { - if (extension_loaded('pimple')) { - $this->markTestSkipped('Pimple extension does not support this test'); - } - $pimple = new Container(); - - $pimple['foo'] = $pimple->factory(function () { return; }); - $pimple['foo'] = $pimple->extend('foo', function ($foo, $pimple) { return; }); - unset($pimple['foo']); - - $p = new \ReflectionProperty($pimple, 'values'); - $p->setAccessible(true); - $this->assertEmpty($p->getValue($pimple)); - - $p = new \ReflectionProperty($pimple, 'factories'); - $p->setAccessible(true); - $this->assertCount(0, $p->getValue($pimple)); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Identifier "foo" is not defined. - */ - public function testExtendValidatesKeyIsPresent() - { - $pimple = new Container(); - $pimple->extend('foo', function () {}); - } - - public function testKeys() - { - $pimple = new Container(); - $pimple['foo'] = 123; - $pimple['bar'] = 123; - - $this->assertEquals(array('foo', 'bar'), $pimple->keys()); - } - - /** @test */ - public function settingAnInvokableObjectShouldTreatItAsFactory() - { - $pimple = new Container(); - $pimple['invokable'] = new Fixtures\Invokable(); - - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['invokable']); - } - - /** @test */ - public function settingNonInvokableObjectShouldTreatItAsParameter() - { - $pimple = new Container(); - $pimple['non_invokable'] = new Fixtures\NonInvokable(); - - $this->assertInstanceOf('Pimple\Tests\Fixtures\NonInvokable', $pimple['non_invokable']); - } - - /** - * @dataProvider badServiceDefinitionProvider - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Service definition is not a Closure or invokable object. - */ - public function testFactoryFailsForInvalidServiceDefinitions($service) - { - $pimple = new Container(); - $pimple->factory($service); - } - - /** - * @dataProvider badServiceDefinitionProvider - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Callable is not a Closure or invokable object. - */ - public function testProtectFailsForInvalidServiceDefinitions($service) - { - $pimple = new Container(); - $pimple->protect($service); - } - - /** - * @dataProvider badServiceDefinitionProvider - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Identifier "foo" does not contain an object definition. - */ - public function testExtendFailsForKeysNotContainingServiceDefinitions($service) - { - $pimple = new Container(); - $pimple['foo'] = $service; - $pimple->extend('foo', function () {}); - } - - /** - * @dataProvider badServiceDefinitionProvider - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Extension service definition is not a Closure or invokable object. - */ - public function testExtendFailsForInvalidServiceDefinitions($service) - { - $pimple = new Container(); - $pimple['foo'] = function () {}; - $pimple->extend('foo', $service); - } - - /** - * Provider for invalid service definitions. - */ - public function badServiceDefinitionProvider() - { - return array( - array(123), - array(new Fixtures\NonInvokable()), - ); - } - - /** - * Provider for service definitions. - */ - public function serviceDefinitionProvider() - { - return array( - array(function ($value) { - $service = new Fixtures\Service(); - $service->value = $value; - - return $service; - }), - array(new Fixtures\Invokable()), - ); - } - - public function testDefiningNewServiceAfterFreeze() - { - $pimple = new Container(); - $pimple['foo'] = function () { - return 'foo'; - }; - $foo = $pimple['foo']; - - $pimple['bar'] = function () { - return 'bar'; - }; - $this->assertSame('bar', $pimple['bar']); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Cannot override frozen service "foo". - */ - public function testOverridingServiceAfterFreeze() - { - $pimple = new Container(); - $pimple['foo'] = function () { - return 'foo'; - }; - $foo = $pimple['foo']; - - $pimple['foo'] = function () { - return 'bar'; - }; - } - - public function testRemovingServiceAfterFreeze() - { - $pimple = new Container(); - $pimple['foo'] = function () { - return 'foo'; - }; - $foo = $pimple['foo']; - - unset($pimple['foo']); - $pimple['foo'] = function () { - return 'bar'; - }; - $this->assertSame('bar', $pimple['foo']); - } - - public function testExtendingService() - { - $pimple = new Container(); - $pimple['foo'] = function () { - return 'foo'; - }; - $pimple['foo'] = $pimple->extend('foo', function ($foo, $app) { - return "$foo.bar"; - }); - $pimple['foo'] = $pimple->extend('foo', function ($foo, $app) { - return "$foo.baz"; - }); - $this->assertSame('foo.bar.baz', $pimple['foo']); - } - - public function testExtendingServiceAfterOtherServiceFreeze() - { - $pimple = new Container(); - $pimple['foo'] = function () { - return 'foo'; - }; - $pimple['bar'] = function () { - return 'bar'; - }; - $foo = $pimple['foo']; - - $pimple['bar'] = $pimple->extend('bar', function ($bar, $app) { - return "$bar.baz"; - }); - $this->assertSame('bar.baz', $pimple['bar']); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/psr/http-message/LICENSE b/samples/server/petstore-security-test/slim/vendor/psr/http-message/LICENSE deleted file mode 100644 index c2d8e452de1..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/psr/http-message/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014 PHP Framework Interoperability Group - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/samples/server/petstore-security-test/slim/vendor/psr/http-message/README.md b/samples/server/petstore-security-test/slim/vendor/psr/http-message/README.md deleted file mode 100644 index 28185338f72..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/psr/http-message/README.md +++ /dev/null @@ -1,13 +0,0 @@ -PSR Http Message -================ - -This repository holds all interfaces/classes/traits related to -[PSR-7](http://www.php-fig.org/psr/psr-7/). - -Note that this is not a HTTP message implementation of its own. It is merely an -interface that describes a HTTP message. See the specification for more details. - -Usage ------ - -We'll certainly need some stuff in here. \ No newline at end of file diff --git a/samples/server/petstore-security-test/slim/vendor/psr/http-message/composer.json b/samples/server/petstore-security-test/slim/vendor/psr/http-message/composer.json deleted file mode 100644 index 4774b612627..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/psr/http-message/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "psr/http-message", - "description": "Common interface for HTTP messages", - "keywords": ["psr", "psr-7", "http", "http-message", "request", "response"], - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "require": { - "php": ">=5.3.0" - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/psr/http-message/src/MessageInterface.php b/samples/server/petstore-security-test/slim/vendor/psr/http-message/src/MessageInterface.php deleted file mode 100644 index 8f67a050e8c..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/psr/http-message/src/MessageInterface.php +++ /dev/null @@ -1,187 +0,0 @@ -getHeaders() as $name => $values) { - * echo $name . ": " . implode(", ", $values); - * } - * - * // Emit headers iteratively: - * foreach ($message->getHeaders() as $name => $values) { - * foreach ($values as $value) { - * header(sprintf('%s: %s', $name, $value), false); - * } - * } - * - * While header names are not case-sensitive, getHeaders() will preserve the - * exact case in which headers were originally specified. - * - * @return array Returns an associative array of the message's headers. Each - * key MUST be a header name, and each value MUST be an array of strings - * for that header. - */ - public function getHeaders(); - - /** - * Checks if a header exists by the given case-insensitive name. - * - * @param string $name Case-insensitive header field name. - * @return bool Returns true if any header names match the given header - * name using a case-insensitive string comparison. Returns false if - * no matching header name is found in the message. - */ - public function hasHeader($name); - - /** - * Retrieves a message header value by the given case-insensitive name. - * - * This method returns an array of all the header values of the given - * case-insensitive header name. - * - * If the header does not appear in the message, this method MUST return an - * empty array. - * - * @param string $name Case-insensitive header field name. - * @return string[] An array of string values as provided for the given - * header. If the header does not appear in the message, this method MUST - * return an empty array. - */ - public function getHeader($name); - - /** - * Retrieves a comma-separated string of the values for a single header. - * - * This method returns all of the header values of the given - * case-insensitive header name as a string concatenated together using - * a comma. - * - * NOTE: Not all header values may be appropriately represented using - * comma concatenation. For such headers, use getHeader() instead - * and supply your own delimiter when concatenating. - * - * If the header does not appear in the message, this method MUST return - * an empty string. - * - * @param string $name Case-insensitive header field name. - * @return string A string of values as provided for the given header - * concatenated together using a comma. If the header does not appear in - * the message, this method MUST return an empty string. - */ - public function getHeaderLine($name); - - /** - * Return an instance with the provided value replacing the specified header. - * - * While header names are case-insensitive, the casing of the header will - * be preserved by this function, and returned from getHeaders(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new and/or updated header and value. - * - * @param string $name Case-insensitive header field name. - * @param string|string[] $value Header value(s). - * @return self - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withHeader($name, $value); - - /** - * Return an instance with the specified header appended with the given value. - * - * Existing values for the specified header will be maintained. The new - * value(s) will be appended to the existing list. If the header did not - * exist previously, it will be added. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new header and/or value. - * - * @param string $name Case-insensitive header field name to add. - * @param string|string[] $value Header value(s). - * @return self - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withAddedHeader($name, $value); - - /** - * Return an instance without the specified header. - * - * Header resolution MUST be done without case-sensitivity. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the named header. - * - * @param string $name Case-insensitive header field name to remove. - * @return self - */ - public function withoutHeader($name); - - /** - * Gets the body of the message. - * - * @return StreamInterface Returns the body as a stream. - */ - public function getBody(); - - /** - * Return an instance with the specified message body. - * - * The body MUST be a StreamInterface object. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return a new instance that has the - * new body stream. - * - * @param StreamInterface $body Body. - * @return self - * @throws \InvalidArgumentException When the body is not valid. - */ - public function withBody(StreamInterface $body); -} diff --git a/samples/server/petstore-security-test/slim/vendor/psr/http-message/src/RequestInterface.php b/samples/server/petstore-security-test/slim/vendor/psr/http-message/src/RequestInterface.php deleted file mode 100644 index 75c802e2927..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/psr/http-message/src/RequestInterface.php +++ /dev/null @@ -1,129 +0,0 @@ -getQuery()` - * or from the `QUERY_STRING` server param. - * - * @return array - */ - public function getQueryParams(); - - /** - * Return an instance with the specified query string arguments. - * - * These values SHOULD remain immutable over the course of the incoming - * request. They MAY be injected during instantiation, such as from PHP's - * $_GET superglobal, or MAY be derived from some other value such as the - * URI. In cases where the arguments are parsed from the URI, the data - * MUST be compatible with what PHP's parse_str() would return for - * purposes of how duplicate query parameters are handled, and how nested - * sets are handled. - * - * Setting query string arguments MUST NOT change the URI stored by the - * request, nor the values in the server params. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated query string arguments. - * - * @param array $query Array of query string arguments, typically from - * $_GET. - * @return self - */ - public function withQueryParams(array $query); - - /** - * Retrieve normalized file upload data. - * - * This method returns upload metadata in a normalized tree, with each leaf - * an instance of Psr\Http\Message\UploadedFileInterface. - * - * These values MAY be prepared from $_FILES or the message body during - * instantiation, or MAY be injected via withUploadedFiles(). - * - * @return array An array tree of UploadedFileInterface instances; an empty - * array MUST be returned if no data is present. - */ - public function getUploadedFiles(); - - /** - * Create a new instance with the specified uploaded files. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param array An array tree of UploadedFileInterface instances. - * @return self - * @throws \InvalidArgumentException if an invalid structure is provided. - */ - public function withUploadedFiles(array $uploadedFiles); - - /** - * Retrieve any parameters provided in the request body. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, this method MUST - * return the contents of $_POST. - * - * Otherwise, this method may return any results of deserializing - * the request body content; as parsing returns structured content, the - * potential types MUST be arrays or objects only. A null value indicates - * the absence of body content. - * - * @return null|array|object The deserialized body parameters, if any. - * These will typically be an array or object. - */ - public function getParsedBody(); - - /** - * Return an instance with the specified body parameters. - * - * These MAY be injected during instantiation. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, use this method - * ONLY to inject the contents of $_POST. - * - * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of - * deserializing the request body content. Deserialization/parsing returns - * structured data, and, as such, this method ONLY accepts arrays or objects, - * or a null value if nothing was available to parse. - * - * As an example, if content negotiation determines that the request data - * is a JSON payload, this method could be used to create a request - * instance with the deserialized parameters. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param null|array|object $data The deserialized body data. This will - * typically be in an array or object. - * @return self - * @throws \InvalidArgumentException if an unsupported argument type is - * provided. - */ - public function withParsedBody($data); - - /** - * Retrieve attributes derived from the request. - * - * The request "attributes" may be used to allow injection of any - * parameters derived from the request: e.g., the results of path - * match operations; the results of decrypting cookies; the results of - * deserializing non-form-encoded message bodies; etc. Attributes - * will be application and request specific, and CAN be mutable. - * - * @return array Attributes derived from the request. - */ - public function getAttributes(); - - /** - * Retrieve a single derived request attribute. - * - * Retrieves a single derived request attribute as described in - * getAttributes(). If the attribute has not been previously set, returns - * the default value as provided. - * - * This method obviates the need for a hasAttribute() method, as it allows - * specifying a default value to return if the attribute is not found. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $default Default value to return if the attribute does not exist. - * @return mixed - */ - public function getAttribute($name, $default = null); - - /** - * Return an instance with the specified derived request attribute. - * - * This method allows setting a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $value The value of the attribute. - * @return self - */ - public function withAttribute($name, $value); - - /** - * Return an instance that removes the specified derived request attribute. - * - * This method allows removing a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @return self - */ - public function withoutAttribute($name); -} diff --git a/samples/server/petstore-security-test/slim/vendor/psr/http-message/src/StreamInterface.php b/samples/server/petstore-security-test/slim/vendor/psr/http-message/src/StreamInterface.php deleted file mode 100644 index f68f391269b..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/psr/http-message/src/StreamInterface.php +++ /dev/null @@ -1,158 +0,0 @@ - - * [user-info@]host[:port] - * - * - * If the port component is not set or is the standard port for the current - * scheme, it SHOULD NOT be included. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.2 - * @return string The URI authority, in "[user-info@]host[:port]" format. - */ - public function getAuthority(); - - /** - * Retrieve the user information component of the URI. - * - * If no user information is present, this method MUST return an empty - * string. - * - * If a user is present in the URI, this will return that value; - * additionally, if the password is also present, it will be appended to the - * user value, with a colon (":") separating the values. - * - * The trailing "@" character is not part of the user information and MUST - * NOT be added. - * - * @return string The URI user information, in "username[:password]" format. - */ - public function getUserInfo(); - - /** - * Retrieve the host component of the URI. - * - * If no host is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.2.2. - * - * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 - * @return string The URI host. - */ - public function getHost(); - - /** - * Retrieve the port component of the URI. - * - * If a port is present, and it is non-standard for the current scheme, - * this method MUST return it as an integer. If the port is the standard port - * used with the current scheme, this method SHOULD return null. - * - * If no port is present, and no scheme is present, this method MUST return - * a null value. - * - * If no port is present, but a scheme is present, this method MAY return - * the standard port for that scheme, but SHOULD return null. - * - * @return null|int The URI port. - */ - public function getPort(); - - /** - * Retrieve the path component of the URI. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * Normally, the empty path "" and absolute path "/" are considered equal as - * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically - * do this normalization because in contexts with a trimmed base path, e.g. - * the front controller, this difference becomes significant. It's the task - * of the user to handle both "" and "/". - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.3. - * - * As an example, if the value should include a slash ("/") not intended as - * delimiter between path segments, that value MUST be passed in encoded - * form (e.g., "%2F") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.3 - * @return string The URI path. - */ - public function getPath(); - - /** - * Retrieve the query string of the URI. - * - * If no query string is present, this method MUST return an empty string. - * - * The leading "?" character is not part of the query and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.4. - * - * As an example, if a value in a key/value pair of the query string should - * include an ampersand ("&") not intended as a delimiter between values, - * that value MUST be passed in encoded form (e.g., "%26") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.4 - * @return string The URI query string. - */ - public function getQuery(); - - /** - * Retrieve the fragment component of the URI. - * - * If no fragment is present, this method MUST return an empty string. - * - * The leading "#" character is not part of the fragment and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.5. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.5 - * @return string The URI fragment. - */ - public function getFragment(); - - /** - * Return an instance with the specified scheme. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified scheme. - * - * Implementations MUST support the schemes "http" and "https" case - * insensitively, and MAY accommodate other schemes if required. - * - * An empty scheme is equivalent to removing the scheme. - * - * @param string $scheme The scheme to use with the new instance. - * @return self A new instance with the specified scheme. - * @throws \InvalidArgumentException for invalid or unsupported schemes. - */ - public function withScheme($scheme); - - /** - * Return an instance with the specified user information. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified user information. - * - * Password is optional, but the user information MUST include the - * user; an empty string for the user is equivalent to removing user - * information. - * - * @param string $user The user name to use for authority. - * @param null|string $password The password associated with $user. - * @return self A new instance with the specified user information. - */ - public function withUserInfo($user, $password = null); - - /** - * Return an instance with the specified host. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified host. - * - * An empty host value is equivalent to removing the host. - * - * @param string $host The hostname to use with the new instance. - * @return self A new instance with the specified host. - * @throws \InvalidArgumentException for invalid hostnames. - */ - public function withHost($host); - - /** - * Return an instance with the specified port. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified port. - * - * Implementations MUST raise an exception for ports outside the - * established TCP and UDP port ranges. - * - * A null value provided for the port is equivalent to removing the port - * information. - * - * @param null|int $port The port to use with the new instance; a null value - * removes the port information. - * @return self A new instance with the specified port. - * @throws \InvalidArgumentException for invalid ports. - */ - public function withPort($port); - - /** - * Return an instance with the specified path. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified path. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * If the path is intended to be domain-relative rather than path relative then - * it must begin with a slash ("/"). Paths not starting with a slash ("/") - * are assumed to be relative to some base path known to the application or - * consumer. - * - * Users can provide both encoded and decoded path characters. - * Implementations ensure the correct encoding as outlined in getPath(). - * - * @param string $path The path to use with the new instance. - * @return self A new instance with the specified path. - * @throws \InvalidArgumentException for invalid paths. - */ - public function withPath($path); - - /** - * Return an instance with the specified query string. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified query string. - * - * Users can provide both encoded and decoded query characters. - * Implementations ensure the correct encoding as outlined in getQuery(). - * - * An empty query string value is equivalent to removing the query string. - * - * @param string $query The query string to use with the new instance. - * @return self A new instance with the specified query string. - * @throws \InvalidArgumentException for invalid query strings. - */ - public function withQuery($query); - - /** - * Return an instance with the specified URI fragment. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified URI fragment. - * - * Users can provide both encoded and decoded fragment characters. - * Implementations ensure the correct encoding as outlined in getFragment(). - * - * An empty fragment value is equivalent to removing the fragment. - * - * @param string $fragment The fragment to use with the new instance. - * @return self A new instance with the specified fragment. - */ - public function withFragment($fragment); - - /** - * Return the string representation as a URI reference. - * - * Depending on which components of the URI are present, the resulting - * string is either a full URI or relative reference according to RFC 3986, - * Section 4.1. The method concatenates the various components of the URI, - * using the appropriate delimiters: - * - * - If a scheme is present, it MUST be suffixed by ":". - * - If an authority is present, it MUST be prefixed by "//". - * - The path can be concatenated without delimiters. But there are two - * cases where the path has to be adjusted to make the URI reference - * valid as PHP does not allow to throw an exception in __toString(): - * - If the path is rootless and an authority is present, the path MUST - * be prefixed by "/". - * - If the path is starting with more than one "/" and no authority is - * present, the starting slashes MUST be reduced to one. - * - If a query is present, it MUST be prefixed by "?". - * - If a fragment is present, it MUST be prefixed by "#". - * - * @see http://tools.ietf.org/html/rfc3986#section-4.1 - * @return string - */ - public function __toString(); -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/CONTRIBUTING.md b/samples/server/petstore-security-test/slim/vendor/slim/slim/CONTRIBUTING.md deleted file mode 100644 index 9bbb6b17ca2..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/CONTRIBUTING.md +++ /dev/null @@ -1,20 +0,0 @@ -# How to Contribute - -## Pull Requests - -1. Fork the Slim Framework repository -2. Create a new branch for each feature or improvement -3. Send a pull request from each feature branch to the **develop** branch - -It is very important to separate new features or improvements into separate feature branches, and to send a -pull request for each branch. This allows me to review and pull in new features or improvements individually. - -## Style Guide - -All pull requests must adhere to the [PSR-2 standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md). - -## Unit Testing - -All pull requests must be accompanied by passing unit tests and complete code coverage. The Slim Framework uses phpunit for testing. - -[Learn about PHPUnit](https://github.com/sebastianbergmann/phpunit/) diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/LICENSE.md b/samples/server/petstore-security-test/slim/vendor/slim/slim/LICENSE.md deleted file mode 100644 index 0875f84f905..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/LICENSE.md +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011-2016 Josh Lockhart - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/README.md b/samples/server/petstore-security-test/slim/vendor/slim/slim/README.md deleted file mode 100644 index d20f3939d1c..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/README.md +++ /dev/null @@ -1,84 +0,0 @@ -# Slim Framework - -[![Build Status](https://travis-ci.org/slimphp/Slim.svg?branch=develop)](https://travis-ci.org/slimphp/Slim) -[![Coverage Status](https://coveralls.io/repos/slimphp/Slim/badge.svg)](https://coveralls.io/r/slimphp/Slim) -[![Total Downloads](https://poser.pugx.org/slim/slim/downloads)](https://packagist.org/packages/slim/slim) -[![License](https://poser.pugx.org/slim/slim/license)](https://packagist.org/packages/slim/slim) - -Slim is a PHP micro-framework that helps you quickly write simple yet powerful web applications and APIs. - -## Installation - -It's recommended that you use [Composer](https://getcomposer.org/) to install Slim. - -```bash -$ composer require slim/slim "^3.0" -``` - -This will install Slim and all required dependencies. Slim requires PHP 5.5.0 or newer. - -## Usage - -Create an index.php file with the following contents: - -```php -get('/hello/{name}', function ($request, $response, $args) { - $response->write("Hello, " . $args['name']); - return $response; -}); - -$app->run(); -``` - -You may quickly test this using the built-in PHP server: -```bash -$ php -S localhost:8000 -``` - -Going to http://localhost:8000/hello/world will now display "Hello, world". - -For more information on how to configure your web server, see the [Documentation](http://www.slimframework.com/docs/start/web-servers.html). - -## Tests - -To execute the test suite, you'll need phpunit. - -```bash -$ phpunit -``` - -## Contributing - -Please see [CONTRIBUTING](CONTRIBUTING.md) for details. - -## Learn More - -Learn more at these links: - -- [Website](http://www.slimframework.com) -- [Documentation](http://www.slimframework.com/docs/start/installation.html) -- [Support Forum](http://help.slimframework.com) -- [Twitter](https://twitter.com/slimphp) -- [Resources](https://github.com/xssc/awesome-slim) - -## Security - -If you discover security related issues, please email security@slimframework.com instead of using the issue tracker. - -## Credits - -- [Josh Lockhart](https://github.com/codeguy) -- [Andrew Smith](https://github.com/silentworks) -- [Rob Allen](https://github.com/akrabat) -- [Gabriel Manricks](https://github.com/gmanricks) -- [All Contributors](../../contributors) - -## License - -The Slim Framework is licensed under the MIT license. See [License File](LICENSE.md) for more information. diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/App.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/App.php deleted file mode 100644 index 639d9b9b470..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/App.php +++ /dev/null @@ -1,644 +0,0 @@ -container = $container; - } - - /** - * Enable access to the DI container by consumers of $app - * - * @return ContainerInterface - */ - public function getContainer() - { - return $this->container; - } - - /** - * Add middleware - * - * This method prepends new middleware to the app's middleware stack. - * - * @param callable|string $callable The callback routine - * - * @return static - */ - public function add($callable) - { - return $this->addMiddleware(new DeferredCallable($callable, $this->container)); - } - - /** - * Calling a non-existent method on App checks to see if there's an item - * in the container that is callable and if so, calls it. - * - * @param string $method - * @param array $args - * @return mixed - */ - public function __call($method, $args) - { - if ($this->container->has($method)) { - $obj = $this->container->get($method); - if (is_callable($obj)) { - return call_user_func_array($obj, $args); - } - } - - throw new \BadMethodCallException("Method $method is not a valid method"); - } - - /******************************************************************************** - * Router proxy methods - *******************************************************************************/ - - /** - * Add GET route - * - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * - * @return \Slim\Interfaces\RouteInterface - */ - public function get($pattern, $callable) - { - return $this->map(['GET'], $pattern, $callable); - } - - /** - * Add POST route - * - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * - * @return \Slim\Interfaces\RouteInterface - */ - public function post($pattern, $callable) - { - return $this->map(['POST'], $pattern, $callable); - } - - /** - * Add PUT route - * - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * - * @return \Slim\Interfaces\RouteInterface - */ - public function put($pattern, $callable) - { - return $this->map(['PUT'], $pattern, $callable); - } - - /** - * Add PATCH route - * - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * - * @return \Slim\Interfaces\RouteInterface - */ - public function patch($pattern, $callable) - { - return $this->map(['PATCH'], $pattern, $callable); - } - - /** - * Add DELETE route - * - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * - * @return \Slim\Interfaces\RouteInterface - */ - public function delete($pattern, $callable) - { - return $this->map(['DELETE'], $pattern, $callable); - } - - /** - * Add OPTIONS route - * - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * - * @return \Slim\Interfaces\RouteInterface - */ - public function options($pattern, $callable) - { - return $this->map(['OPTIONS'], $pattern, $callable); - } - - /** - * Add route for any HTTP method - * - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * - * @return \Slim\Interfaces\RouteInterface - */ - public function any($pattern, $callable) - { - return $this->map(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], $pattern, $callable); - } - - /** - * Add route with multiple methods - * - * @param string[] $methods Numeric array of HTTP method names - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * - * @return RouteInterface - */ - public function map(array $methods, $pattern, $callable) - { - if ($callable instanceof Closure) { - $callable = $callable->bindTo($this->container); - } - - $route = $this->container->get('router')->map($methods, $pattern, $callable); - if (is_callable([$route, 'setContainer'])) { - $route->setContainer($this->container); - } - - if (is_callable([$route, 'setOutputBuffering'])) { - $route->setOutputBuffering($this->container->get('settings')['outputBuffering']); - } - - return $route; - } - - /** - * Route Groups - * - * This method accepts a route pattern and a callback. All route - * declarations in the callback will be prepended by the group(s) - * that it is in. - * - * @param string $pattern - * @param callable $callable - * - * @return RouteGroupInterface - */ - public function group($pattern, $callable) - { - /** @var RouteGroup $group */ - $group = $this->container->get('router')->pushGroup($pattern, $callable); - $group->setContainer($this->container); - $group($this); - $this->container->get('router')->popGroup(); - return $group; - } - - /******************************************************************************** - * Runner - *******************************************************************************/ - - /** - * Run application - * - * This method traverses the application middleware stack and then sends the - * resultant Response object to the HTTP client. - * - * @param bool|false $silent - * @return ResponseInterface - * - * @throws Exception - * @throws MethodNotAllowedException - * @throws NotFoundException - */ - public function run($silent = false) - { - $request = $this->container->get('request'); - $response = $this->container->get('response'); - - $response = $this->process($request, $response); - - if (!$silent) { - $this->respond($response); - } - - return $response; - } - - /** - * Process a request - * - * This method traverses the application middleware stack and then returns the - * resultant Response object. - * - * @param ServerRequestInterface $request - * @param ResponseInterface $response - * @return ResponseInterface - * - * @throws Exception - * @throws MethodNotAllowedException - * @throws NotFoundException - */ - public function process(ServerRequestInterface $request, ResponseInterface $response) - { - // Ensure basePath is set - $router = $this->container->get('router'); - if (is_callable([$request->getUri(), 'getBasePath']) && is_callable([$router, 'setBasePath'])) { - $router->setBasePath($request->getUri()->getBasePath()); - } - - // Dispatch the Router first if the setting for this is on - if ($this->container->get('settings')['determineRouteBeforeAppMiddleware'] === true) { - // Dispatch router (note: you won't be able to alter routes after this) - $request = $this->dispatchRouterAndPrepareRoute($request, $router); - } - - // Traverse middleware stack - try { - $response = $this->callMiddlewareStack($request, $response); - } catch (Exception $e) { - $response = $this->handleException($e, $request, $response); - } catch (Throwable $e) { - $response = $this->handlePhpError($e, $request, $response); - } - - $response = $this->finalize($response); - - return $response; - } - - /** - * Send the response the client - * - * @param ResponseInterface $response - */ - public function respond(ResponseInterface $response) - { - // Send response - if (!headers_sent()) { - // Status - header(sprintf( - 'HTTP/%s %s %s', - $response->getProtocolVersion(), - $response->getStatusCode(), - $response->getReasonPhrase() - )); - - // Headers - foreach ($response->getHeaders() as $name => $values) { - foreach ($values as $value) { - header(sprintf('%s: %s', $name, $value), false); - } - } - } - - // Body - if (!$this->isEmptyResponse($response)) { - $body = $response->getBody(); - if ($body->isSeekable()) { - $body->rewind(); - } - $settings = $this->container->get('settings'); - $chunkSize = $settings['responseChunkSize']; - - $contentLength = $response->getHeaderLine('Content-Length'); - if (!$contentLength) { - $contentLength = $body->getSize(); - } - - - if (isset($contentLength)) { - $amountToRead = $contentLength; - while ($amountToRead > 0 && !$body->eof()) { - $data = $body->read(min($chunkSize, $amountToRead)); - echo $data; - - $amountToRead -= strlen($data); - - if (connection_status() != CONNECTION_NORMAL) { - break; - } - } - } else { - while (!$body->eof()) { - echo $body->read($chunkSize); - if (connection_status() != CONNECTION_NORMAL) { - break; - } - } - } - } - } - - /** - * Invoke application - * - * This method implements the middleware interface. It receives - * Request and Response objects, and it returns a Response object - * after compiling the routes registered in the Router and dispatching - * the Request object to the appropriate Route callback routine. - * - * @param ServerRequestInterface $request The most recent Request object - * @param ResponseInterface $response The most recent Response object - * - * @return ResponseInterface - * @throws MethodNotAllowedException - * @throws NotFoundException - */ - public function __invoke(ServerRequestInterface $request, ResponseInterface $response) - { - // Get the route info - $routeInfo = $request->getAttribute('routeInfo'); - - /** @var \Slim\Interfaces\RouterInterface $router */ - $router = $this->container->get('router'); - - // If router hasn't been dispatched or the URI changed then dispatch - if (null === $routeInfo || ($routeInfo['request'] !== [$request->getMethod(), (string) $request->getUri()])) { - $request = $this->dispatchRouterAndPrepareRoute($request, $router); - $routeInfo = $request->getAttribute('routeInfo'); - } - - if ($routeInfo[0] === Dispatcher::FOUND) { - $route = $router->lookupRoute($routeInfo[1]); - return $route->run($request, $response); - } elseif ($routeInfo[0] === Dispatcher::METHOD_NOT_ALLOWED) { - if (!$this->container->has('notAllowedHandler')) { - throw new MethodNotAllowedException($request, $response, $routeInfo[1]); - } - /** @var callable $notAllowedHandler */ - $notAllowedHandler = $this->container->get('notAllowedHandler'); - return $notAllowedHandler($request, $response, $routeInfo[1]); - } - - if (!$this->container->has('notFoundHandler')) { - throw new NotFoundException($request, $response); - } - /** @var callable $notFoundHandler */ - $notFoundHandler = $this->container->get('notFoundHandler'); - return $notFoundHandler($request, $response); - } - - /** - * Perform a sub-request from within an application route - * - * This method allows you to prepare and initiate a sub-request, run within - * the context of the current request. This WILL NOT issue a remote HTTP - * request. Instead, it will route the provided URL, method, headers, - * cookies, body, and server variables against the set of registered - * application routes. The result response object is returned. - * - * @param string $method The request method (e.g., GET, POST, PUT, etc.) - * @param string $path The request URI path - * @param string $query The request URI query string - * @param array $headers The request headers (key-value array) - * @param array $cookies The request cookies (key-value array) - * @param string $bodyContent The request body - * @param ResponseInterface $response The response object (optional) - * @return ResponseInterface - */ - public function subRequest( - $method, - $path, - $query = '', - array $headers = [], - array $cookies = [], - $bodyContent = '', - ResponseInterface $response = null - ) { - $env = $this->container->get('environment'); - $uri = Uri::createFromEnvironment($env)->withPath($path)->withQuery($query); - $headers = new Headers($headers); - $serverParams = $env->all(); - $body = new Body(fopen('php://temp', 'r+')); - $body->write($bodyContent); - $body->rewind(); - $request = new Request($method, $uri, $headers, $cookies, $serverParams, $body); - - if (!$response) { - $response = $this->container->get('response'); - } - - return $this($request, $response); - } - - /** - * Dispatch the router to find the route. Prepare the route for use. - * - * @param ServerRequestInterface $request - * @param RouterInterface $router - * @return ServerRequestInterface - */ - protected function dispatchRouterAndPrepareRoute(ServerRequestInterface $request, RouterInterface $router) - { - $routeInfo = $router->dispatch($request); - - if ($routeInfo[0] === Dispatcher::FOUND) { - $routeArguments = []; - foreach ($routeInfo[2] as $k => $v) { - $routeArguments[$k] = urldecode($v); - } - - $route = $router->lookupRoute($routeInfo[1]); - $route->prepare($request, $routeArguments); - - // add route to the request's attributes in case a middleware or handler needs access to the route - $request = $request->withAttribute('route', $route); - } - - $routeInfo['request'] = [$request->getMethod(), (string) $request->getUri()]; - - return $request->withAttribute('routeInfo', $routeInfo); - } - - /** - * Finalize response - * - * @param ResponseInterface $response - * @return ResponseInterface - */ - protected function finalize(ResponseInterface $response) - { - // stop PHP sending a Content-Type automatically - ini_set('default_mimetype', ''); - - if ($this->isEmptyResponse($response)) { - return $response->withoutHeader('Content-Type')->withoutHeader('Content-Length'); - } - - // Add Content-Length header if `addContentLengthHeader` setting is set - if (isset($this->container->get('settings')['addContentLengthHeader']) && - $this->container->get('settings')['addContentLengthHeader'] == true) { - if (ob_get_length() > 0) { - throw new \RuntimeException("Unexpected data in output buffer. " . - "Maybe you have characters before an opening getBody()->getSize(); - if ($size !== null && !$response->hasHeader('Content-Length')) { - $response = $response->withHeader('Content-Length', (string) $size); - } - } - - return $response; - } - - /** - * Helper method, which returns true if the provided response must not output a body and false - * if the response could have a body. - * - * @see https://tools.ietf.org/html/rfc7231 - * - * @param ResponseInterface $response - * @return bool - */ - protected function isEmptyResponse(ResponseInterface $response) - { - if (method_exists($response, 'isEmpty')) { - return $response->isEmpty(); - } - - return in_array($response->getStatusCode(), [204, 205, 304]); - } - - /** - * Call relevant handler from the Container if needed. If it doesn't exist, - * then just re-throw. - * - * @param Exception $e - * @param ServerRequestInterface $request - * @param ResponseInterface $response - * - * @return ResponseInterface - * @throws Exception if a handler is needed and not found - */ - protected function handleException(Exception $e, ServerRequestInterface $request, ResponseInterface $response) - { - if ($e instanceof MethodNotAllowedException) { - $handler = 'notAllowedHandler'; - $params = [$e->getRequest(), $e->getResponse(), $e->getAllowedMethods()]; - } elseif ($e instanceof NotFoundException) { - $handler = 'notFoundHandler'; - $params = [$e->getRequest(), $e->getResponse()]; - } elseif ($e instanceof SlimException) { - // This is a Stop exception and contains the response - return $e->getResponse(); - } else { - // Other exception, use $request and $response params - $handler = 'errorHandler'; - $params = [$request, $response, $e]; - } - - if ($this->container->has($handler)) { - $callable = $this->container->get($handler); - // Call the registered handler - return call_user_func_array($callable, $params); - } - - // No handlers found, so just throw the exception - throw $e; - } - - /** - * Call relevant handler from the Container if needed. If it doesn't exist, - * then just re-throw. - * - * @param Throwable $e - * @param ServerRequestInterface $request - * @param ResponseInterface $response - * @return ResponseInterface - * @throws Throwable - */ - protected function handlePhpError(Throwable $e, ServerRequestInterface $request, ResponseInterface $response) - { - $handler = 'phpErrorHandler'; - $params = [$request, $response, $e]; - - if ($this->container->has($handler)) { - $callable = $this->container->get($handler); - // Call the registered handler - return call_user_func_array($callable, $params); - } - - // No handlers found, so just throw the exception - throw $e; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/CallableResolver.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/CallableResolver.php deleted file mode 100644 index 705a9f207fe..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/CallableResolver.php +++ /dev/null @@ -1,87 +0,0 @@ -container = $container; - } - - /** - * Resolve toResolve into a closure that that the router can dispatch. - * - * If toResolve is of the format 'class:method', then try to extract 'class' - * from the container otherwise instantiate it and then dispatch 'method'. - * - * @param mixed $toResolve - * - * @return callable - * - * @throws RuntimeException if the callable does not exist - * @throws RuntimeException if the callable is not resolvable - */ - public function resolve($toResolve) - { - $resolved = $toResolve; - - if (!is_callable($toResolve) && is_string($toResolve)) { - // check for slim callable as "class:method" - $callablePattern = '!^([^\:]+)\:([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$!'; - if (preg_match($callablePattern, $toResolve, $matches)) { - $class = $matches[1]; - $method = $matches[2]; - - if ($this->container->has($class)) { - $resolved = [$this->container->get($class), $method]; - } else { - if (!class_exists($class)) { - throw new RuntimeException(sprintf('Callable %s does not exist', $class)); - } - $resolved = [new $class($this->container), $method]; - } - } else { - // check if string is something in the DIC that's callable or is a class name which - // has an __invoke() method - $class = $toResolve; - if ($this->container->has($class)) { - $resolved = $this->container->get($class); - } else { - if (!class_exists($class)) { - throw new RuntimeException(sprintf('Callable %s does not exist', $class)); - } - $resolved = new $class($this->container); - } - } - } - - if (!is_callable($resolved)) { - throw new RuntimeException(sprintf('%s is not resolvable', $toResolve)); - } - - return $resolved; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/CallableResolverAwareTrait.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/CallableResolverAwareTrait.php deleted file mode 100644 index f7ff485282d..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/CallableResolverAwareTrait.php +++ /dev/null @@ -1,47 +0,0 @@ -container instanceof ContainerInterface) { - return $callable; - } - - /** @var CallableResolverInterface $resolver */ - $resolver = $this->container->get('callableResolver'); - - return $resolver->resolve($callable); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Collection.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Collection.php deleted file mode 100644 index d33acd9ce32..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Collection.php +++ /dev/null @@ -1,204 +0,0 @@ - $value) { - $this->set($key, $value); - } - } - - /******************************************************************************** - * Collection interface - *******************************************************************************/ - - /** - * Set collection item - * - * @param string $key The data key - * @param mixed $value The data value - */ - public function set($key, $value) - { - $this->data[$key] = $value; - } - - /** - * Get collection item for key - * - * @param string $key The data key - * @param mixed $default The default value to return if data key does not exist - * - * @return mixed The key's value, or the default value - */ - public function get($key, $default = null) - { - return $this->has($key) ? $this->data[$key] : $default; - } - - /** - * Add item to collection - * - * @param array $items Key-value array of data to append to this collection - */ - public function replace(array $items) - { - foreach ($items as $key => $value) { - $this->set($key, $value); - } - } - - /** - * Get all items in collection - * - * @return array The collection's source data - */ - public function all() - { - return $this->data; - } - - /** - * Get collection keys - * - * @return array The collection's source data keys - */ - public function keys() - { - return array_keys($this->data); - } - - /** - * Does this collection have a given key? - * - * @param string $key The data key - * - * @return bool - */ - public function has($key) - { - return array_key_exists($key, $this->data); - } - - /** - * Remove item from collection - * - * @param string $key The data key - */ - public function remove($key) - { - unset($this->data[$key]); - } - - /** - * Remove all items from collection - */ - public function clear() - { - $this->data = []; - } - - /******************************************************************************** - * ArrayAccess interface - *******************************************************************************/ - - /** - * Does this collection have a given key? - * - * @param string $key The data key - * - * @return bool - */ - public function offsetExists($key) - { - return $this->has($key); - } - - /** - * Get collection item for key - * - * @param string $key The data key - * - * @return mixed The key's value, or the default value - */ - public function offsetGet($key) - { - return $this->get($key); - } - - /** - * Set collection item - * - * @param string $key The data key - * @param mixed $value The data value - */ - public function offsetSet($key, $value) - { - $this->set($key, $value); - } - - /** - * Remove item from collection - * - * @param string $key The data key - */ - public function offsetUnset($key) - { - $this->remove($key); - } - - /** - * Get number of items in collection - * - * @return int - */ - public function count() - { - return count($this->data); - } - - /******************************************************************************** - * IteratorAggregate interface - *******************************************************************************/ - - /** - * Get collection iterator - * - * @return \ArrayIterator - */ - public function getIterator() - { - return new ArrayIterator($this->data); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Container.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Container.php deleted file mode 100644 index c97f2b3fdf4..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Container.php +++ /dev/null @@ -1,181 +0,0 @@ - '1.1', - 'responseChunkSize' => 4096, - 'outputBuffering' => 'append', - 'determineRouteBeforeAppMiddleware' => false, - 'displayErrorDetails' => false, - 'addContentLengthHeader' => true, - 'routerCacheFile' => false, - ]; - - /** - * Create new container - * - * @param array $values The parameters or objects. - */ - public function __construct(array $values = []) - { - parent::__construct($values); - - $userSettings = isset($values['settings']) ? $values['settings'] : []; - $this->registerDefaultServices($userSettings); - } - - /** - * This function registers the default services that Slim needs to work. - * - * All services are shared - that is, they are registered such that the - * same instance is returned on subsequent calls. - * - * @param array $userSettings Associative array of application settings - * - * @return void - */ - private function registerDefaultServices($userSettings) - { - $defaultSettings = $this->defaultSettings; - - /** - * This service MUST return an array or an - * instance of \ArrayAccess. - * - * @return array|\ArrayAccess - */ - $this['settings'] = function () use ($userSettings, $defaultSettings) { - return new Collection(array_merge($defaultSettings, $userSettings)); - }; - - $defaultProvider = new DefaultServicesProvider(); - $defaultProvider->register($this); - } - - /******************************************************************************** - * Methods to satisfy Interop\Container\ContainerInterface - *******************************************************************************/ - - /** - * Finds an entry of the container by its identifier and returns it. - * - * @param string $id Identifier of the entry to look for. - * - * @throws ContainerValueNotFoundException No entry was found for this identifier. - * @throws ContainerException Error while retrieving the entry. - * - * @return mixed Entry. - */ - public function get($id) - { - if (!$this->offsetExists($id)) { - throw new ContainerValueNotFoundException(sprintf('Identifier "%s" is not defined.', $id)); - } - try { - return $this->offsetGet($id); - } catch (\InvalidArgumentException $exception) { - if ($this->exceptionThrownByContainer($exception)) { - throw new SlimContainerException( - sprintf('Container error while retrieving "%s"', $id), - null, - $exception - ); - } else { - throw $exception; - } - } - } - - /** - * Tests whether an exception needs to be recast for compliance with Container-Interop. This will be if the - * exception was thrown by Pimple. - * - * @param \InvalidArgumentException $exception - * - * @return bool - */ - private function exceptionThrownByContainer(\InvalidArgumentException $exception) - { - $trace = $exception->getTrace()[0]; - - return $trace['class'] === PimpleContainer::class && $trace['function'] === 'offsetGet'; - } - - /** - * Returns true if the container can return an entry for the given identifier. - * Returns false otherwise. - * - * @param string $id Identifier of the entry to look for. - * - * @return boolean - */ - public function has($id) - { - return $this->offsetExists($id); - } - - - /******************************************************************************** - * Magic methods for convenience - *******************************************************************************/ - - public function __get($name) - { - return $this->get($name); - } - - public function __isset($name) - { - return $this->has($name); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/DefaultServicesProvider.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/DefaultServicesProvider.php deleted file mode 100644 index c18d8757204..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/DefaultServicesProvider.php +++ /dev/null @@ -1,204 +0,0 @@ -get('environment')); - }; - } - - if (!isset($container['response'])) { - /** - * PSR-7 Response object - * - * @param Container $container - * - * @return ResponseInterface - */ - $container['response'] = function ($container) { - $headers = new Headers(['Content-Type' => 'text/html; charset=UTF-8']); - $response = new Response(200, $headers); - - return $response->withProtocolVersion($container->get('settings')['httpVersion']); - }; - } - - if (!isset($container['router'])) { - /** - * This service MUST return a SHARED instance - * of \Slim\Interfaces\RouterInterface. - * - * @param Container $container - * - * @return RouterInterface - */ - $container['router'] = function ($container) { - $routerCacheFile = false; - if (isset($container->get('settings')['routerCacheFile'])) { - $routerCacheFile = $container->get('settings')['routerCacheFile']; - } - - return (new Router)->setCacheFile($routerCacheFile); - }; - } - - if (!isset($container['foundHandler'])) { - /** - * This service MUST return a SHARED instance - * of \Slim\Interfaces\InvocationStrategyInterface. - * - * @return InvocationStrategyInterface - */ - $container['foundHandler'] = function () { - return new RequestResponse; - }; - } - - if (!isset($container['phpErrorHandler'])) { - /** - * This service MUST return a callable - * that accepts three arguments: - * - * 1. Instance of \Psr\Http\Message\ServerRequestInterface - * 2. Instance of \Psr\Http\Message\ResponseInterface - * 3. Instance of \Error - * - * The callable MUST return an instance of - * \Psr\Http\Message\ResponseInterface. - * - * @param Container $container - * - * @return callable - */ - $container['phpErrorHandler'] = function ($container) { - return new PhpError($container->get('settings')['displayErrorDetails']); - }; - } - - if (!isset($container['errorHandler'])) { - /** - * This service MUST return a callable - * that accepts three arguments: - * - * 1. Instance of \Psr\Http\Message\ServerRequestInterface - * 2. Instance of \Psr\Http\Message\ResponseInterface - * 3. Instance of \Exception - * - * The callable MUST return an instance of - * \Psr\Http\Message\ResponseInterface. - * - * @param Container $container - * - * @return callable - */ - $container['errorHandler'] = function ($container) { - return new Error($container->get('settings')['displayErrorDetails']); - }; - } - - if (!isset($container['notFoundHandler'])) { - /** - * This service MUST return a callable - * that accepts two arguments: - * - * 1. Instance of \Psr\Http\Message\ServerRequestInterface - * 2. Instance of \Psr\Http\Message\ResponseInterface - * - * The callable MUST return an instance of - * \Psr\Http\Message\ResponseInterface. - * - * @return callable - */ - $container['notFoundHandler'] = function () { - return new NotFound; - }; - } - - if (!isset($container['notAllowedHandler'])) { - /** - * This service MUST return a callable - * that accepts three arguments: - * - * 1. Instance of \Psr\Http\Message\ServerRequestInterface - * 2. Instance of \Psr\Http\Message\ResponseInterface - * 3. Array of allowed HTTP methods - * - * The callable MUST return an instance of - * \Psr\Http\Message\ResponseInterface. - * - * @return callable - */ - $container['notAllowedHandler'] = function () { - return new NotAllowed; - }; - } - - if (!isset($container['callableResolver'])) { - /** - * Instance of \Slim\Interfaces\CallableResolverInterface - * - * @param Container $container - * - * @return CallableResolverInterface - */ - $container['callableResolver'] = function ($container) { - return new CallableResolver($container); - }; - } - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/DeferredCallable.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/DeferredCallable.php deleted file mode 100644 index def58ab23b3..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/DeferredCallable.php +++ /dev/null @@ -1,39 +0,0 @@ -callable = $callable; - $this->container = $container; - } - - public function __invoke() - { - $callable = $this->resolveCallable($this->callable); - if ($callable instanceof Closure) { - $callable = $callable->bindTo($this->container); - } - - $args = func_get_args(); - - return call_user_func_array($callable, $args); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Exception/ContainerException.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Exception/ContainerException.php deleted file mode 100644 index 0200e1a8611..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Exception/ContainerException.php +++ /dev/null @@ -1,20 +0,0 @@ -allowedMethods = $allowedMethods; - } - - /** - * Get allowed methods - * - * @return string[] - */ - public function getAllowedMethods() - { - return $this->allowedMethods; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Exception/NotFoundException.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Exception/NotFoundException.php deleted file mode 100644 index 65365eb99d6..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Exception/NotFoundException.php +++ /dev/null @@ -1,14 +0,0 @@ -request = $request; - $this->response = $response; - } - - /** - * Get request - * - * @return ServerRequestInterface - */ - public function getRequest() - { - return $this->request; - } - - /** - * Get response - * - * @return ResponseInterface - */ - public function getResponse() - { - return $this->response; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/AbstractError.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/AbstractError.php deleted file mode 100644 index 5a6cee30a94..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/AbstractError.php +++ /dev/null @@ -1,99 +0,0 @@ -displayErrorDetails = (bool) $displayErrorDetails; - } - - /** - * Write to the error log if displayErrorDetails is false - * - * @param \Exception|\Throwable $throwable - * - * @return void - */ - protected function writeToErrorLog($throwable) - { - if ($this->displayErrorDetails) { - return; - } - - $message = 'Slim Application Error:' . PHP_EOL; - $message .= $this->renderThrowableAsText($throwable); - while ($throwable = $throwable->getPrevious()) { - $message .= PHP_EOL . 'Previous error:' . PHP_EOL; - $message .= $this->renderThrowableAsText($throwable); - } - - $message .= PHP_EOL . 'View in rendered output by enabling the "displayErrorDetails" setting.' . PHP_EOL; - - $this->logError($message); - } - - /** - * Render error as Text. - * - * @param \Exception|\Throwable $throwable - * - * @return string - */ - protected function renderThrowableAsText($throwable) - { - $text = sprintf('Type: %s' . PHP_EOL, get_class($throwable)); - - if ($code = $throwable->getCode()) { - $text .= sprintf('Code: %s' . PHP_EOL, $code); - } - - if ($message = $throwable->getMessage()) { - $text .= sprintf('Message: %s' . PHP_EOL, htmlentities($message)); - } - - if ($file = $throwable->getFile()) { - $text .= sprintf('File: %s' . PHP_EOL, $file); - } - - if ($line = $throwable->getLine()) { - $text .= sprintf('Line: %s' . PHP_EOL, $line); - } - - if ($trace = $throwable->getTraceAsString()) { - $text .= sprintf('Trace: %s', $trace); - } - - return $text; - } - - /** - * Wraps the error_log function so that this can be easily tested - * - * @param $message - */ - protected function logError($message) - { - error_log($message); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/AbstractHandler.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/AbstractHandler.php deleted file mode 100644 index decdf725ce8..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/AbstractHandler.php +++ /dev/null @@ -1,59 +0,0 @@ -getHeaderLine('Accept'); - $selectedContentTypes = array_intersect(explode(',', $acceptHeader), $this->knownContentTypes); - - if (count($selectedContentTypes)) { - return current($selectedContentTypes); - } - - // handle +json and +xml specially - if (preg_match('/\+(json|xml)/', $acceptHeader, $matches)) { - $mediaType = 'application/' . $matches[1]; - if (in_array($mediaType, $this->knownContentTypes)) { - return $mediaType; - } - } - - return 'text/html'; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/Error.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/Error.php deleted file mode 100644 index b9951888efb..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/Error.php +++ /dev/null @@ -1,206 +0,0 @@ -determineContentType($request); - switch ($contentType) { - case 'application/json': - $output = $this->renderJsonErrorMessage($exception); - break; - - case 'text/xml': - case 'application/xml': - $output = $this->renderXmlErrorMessage($exception); - break; - - case 'text/html': - $output = $this->renderHtmlErrorMessage($exception); - break; - - default: - throw new UnexpectedValueException('Cannot render unknown content type ' . $contentType); - } - - $this->writeToErrorLog($exception); - - $body = new Body(fopen('php://temp', 'r+')); - $body->write($output); - - return $response - ->withStatus(500) - ->withHeader('Content-type', $contentType) - ->withBody($body); - } - - /** - * Render HTML error page - * - * @param \Exception $exception - * - * @return string - */ - protected function renderHtmlErrorMessage(\Exception $exception) - { - $title = 'Slim Application Error'; - - if ($this->displayErrorDetails) { - $html = '

The application could not run because of the following error:

'; - $html .= '

Details

'; - $html .= $this->renderHtmlException($exception); - - while ($exception = $exception->getPrevious()) { - $html .= '

Previous exception

'; - $html .= $this->renderHtmlException($exception); - } - } else { - $html = '

A website error has occurred. Sorry for the temporary inconvenience.

'; - } - - $output = sprintf( - "" . - "%s

%s

%s", - $title, - $title, - $html - ); - - return $output; - } - - /** - * Render exception as HTML. - * - * @param \Exception $exception - * - * @return string - */ - protected function renderHtmlException(\Exception $exception) - { - $html = sprintf('
Type: %s
', get_class($exception)); - - if (($code = $exception->getCode())) { - $html .= sprintf('
Code: %s
', $code); - } - - if (($message = $exception->getMessage())) { - $html .= sprintf('
Message: %s
', htmlentities($message)); - } - - if (($file = $exception->getFile())) { - $html .= sprintf('
File: %s
', $file); - } - - if (($line = $exception->getLine())) { - $html .= sprintf('
Line: %s
', $line); - } - - if (($trace = $exception->getTraceAsString())) { - $html .= '

Trace

'; - $html .= sprintf('
%s
', htmlentities($trace)); - } - - return $html; - } - - /** - * Render JSON error - * - * @param \Exception $exception - * - * @return string - */ - protected function renderJsonErrorMessage(\Exception $exception) - { - $error = [ - 'message' => 'Slim Application Error', - ]; - - if ($this->displayErrorDetails) { - $error['exception'] = []; - - do { - $error['exception'][] = [ - 'type' => get_class($exception), - 'code' => $exception->getCode(), - 'message' => $exception->getMessage(), - 'file' => $exception->getFile(), - 'line' => $exception->getLine(), - 'trace' => explode("\n", $exception->getTraceAsString()), - ]; - } while ($exception = $exception->getPrevious()); - } - - return json_encode($error, JSON_PRETTY_PRINT); - } - - /** - * Render XML error - * - * @param \Exception $exception - * - * @return string - */ - protected function renderXmlErrorMessage(\Exception $exception) - { - $xml = "\n Slim Application Error\n"; - if ($this->displayErrorDetails) { - do { - $xml .= " \n"; - $xml .= " " . get_class($exception) . "\n"; - $xml .= " " . $exception->getCode() . "\n"; - $xml .= " " . $this->createCdataSection($exception->getMessage()) . "\n"; - $xml .= " " . $exception->getFile() . "\n"; - $xml .= " " . $exception->getLine() . "\n"; - $xml .= " " . $this->createCdataSection($exception->getTraceAsString()) . "\n"; - $xml .= " \n"; - } while ($exception = $exception->getPrevious()); - } - $xml .= ""; - - return $xml; - } - - /** - * Returns a CDATA section with the given content. - * - * @param string $content - * @return string - */ - private function createCdataSection($content) - { - return sprintf('', str_replace(']]>', ']]]]>', $content)); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/NotAllowed.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/NotAllowed.php deleted file mode 100644 index 3442f20bc52..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/NotAllowed.php +++ /dev/null @@ -1,147 +0,0 @@ -getMethod() === 'OPTIONS') { - $status = 200; - $contentType = 'text/plain'; - $output = $this->renderPlainNotAllowedMessage($methods); - } else { - $status = 405; - $contentType = $this->determineContentType($request); - switch ($contentType) { - case 'application/json': - $output = $this->renderJsonNotAllowedMessage($methods); - break; - - case 'text/xml': - case 'application/xml': - $output = $this->renderXmlNotAllowedMessage($methods); - break; - - case 'text/html': - $output = $this->renderHtmlNotAllowedMessage($methods); - break; - default: - throw new UnexpectedValueException('Cannot render unknown content type ' . $contentType); - } - } - - $body = new Body(fopen('php://temp', 'r+')); - $body->write($output); - $allow = implode(', ', $methods); - - return $response - ->withStatus($status) - ->withHeader('Content-type', $contentType) - ->withHeader('Allow', $allow) - ->withBody($body); - } - - /** - * Render PLAIN not allowed message - * - * @param array $methods - * @return string - */ - protected function renderPlainNotAllowedMessage($methods) - { - $allow = implode(', ', $methods); - - return 'Allowed methods: ' . $allow; - } - - /** - * Render JSON not allowed message - * - * @param array $methods - * @return string - */ - protected function renderJsonNotAllowedMessage($methods) - { - $allow = implode(', ', $methods); - - return '{"message":"Method not allowed. Must be one of: ' . $allow . '"}'; - } - - /** - * Render XML not allowed message - * - * @param array $methods - * @return string - */ - protected function renderXmlNotAllowedMessage($methods) - { - $allow = implode(', ', $methods); - - return "Method not allowed. Must be one of: $allow"; - } - - /** - * Render HTML not allowed message - * - * @param array $methods - * @return string - */ - protected function renderHtmlNotAllowedMessage($methods) - { - $allow = implode(', ', $methods); - $output = << - - Method not allowed - - - -

Method not allowed

-

Method not allowed. Must be one of: $allow

- - -END; - - return $output; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/NotFound.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/NotFound.php deleted file mode 100644 index ab1d47a4575..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/NotFound.php +++ /dev/null @@ -1,126 +0,0 @@ -determineContentType($request); - switch ($contentType) { - case 'application/json': - $output = $this->renderJsonNotFoundOutput(); - break; - - case 'text/xml': - case 'application/xml': - $output = $this->renderXmlNotFoundOutput(); - break; - - case 'text/html': - $output = $this->renderHtmlNotFoundOutput($request); - break; - - default: - throw new UnexpectedValueException('Cannot render unknown content type ' . $contentType); - } - - $body = new Body(fopen('php://temp', 'r+')); - $body->write($output); - - return $response->withStatus(404) - ->withHeader('Content-Type', $contentType) - ->withBody($body); - } - - /** - * Return a response for application/json content not found - * - * @return ResponseInterface - */ - protected function renderJsonNotFoundOutput() - { - return '{"message":"Not found"}'; - } - - /** - * Return a response for xml content not found - * - * @return ResponseInterface - */ - protected function renderXmlNotFoundOutput() - { - return 'Not found'; - } - - /** - * Return a response for text/html content not found - * - * @param ServerRequestInterface $request The most recent Request object - * - * @return ResponseInterface - */ - protected function renderHtmlNotFoundOutput(ServerRequestInterface $request) - { - $homeUrl = (string)($request->getUri()->withPath('')->withQuery('')->withFragment('')); - return << - - Page Not Found - - - -

Page Not Found

-

- The page you are looking for could not be found. Check the address bar - to ensure your URL is spelled correctly. If all else fails, you can - visit our home page at the link below. -

- Visit the Home Page - - -END; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/PhpError.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/PhpError.php deleted file mode 100644 index 0122ddb0785..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/PhpError.php +++ /dev/null @@ -1,205 +0,0 @@ -determineContentType($request); - switch ($contentType) { - case 'application/json': - $output = $this->renderJsonErrorMessage($error); - break; - - case 'text/xml': - case 'application/xml': - $output = $this->renderXmlErrorMessage($error); - break; - - case 'text/html': - $output = $this->renderHtmlErrorMessage($error); - break; - default: - throw new UnexpectedValueException('Cannot render unknown content type ' . $contentType); - } - - $this->writeToErrorLog($error); - - $body = new Body(fopen('php://temp', 'r+')); - $body->write($output); - - return $response - ->withStatus(500) - ->withHeader('Content-type', $contentType) - ->withBody($body); - } - - /** - * Render HTML error page - * - * @param \Throwable $error - * - * @return string - */ - protected function renderHtmlErrorMessage(\Throwable $error) - { - $title = 'Slim Application Error'; - - if ($this->displayErrorDetails) { - $html = '

The application could not run because of the following error:

'; - $html .= '

Details

'; - $html .= $this->renderHtmlError($error); - - while ($error = $error->getPrevious()) { - $html .= '

Previous error

'; - $html .= $this->renderHtmlError($error); - } - } else { - $html = '

A website error has occurred. Sorry for the temporary inconvenience.

'; - } - - $output = sprintf( - "" . - "%s

%s

%s", - $title, - $title, - $html - ); - - return $output; - } - - /** - * Render error as HTML. - * - * @param \Throwable $error - * - * @return string - */ - protected function renderHtmlError(\Throwable $error) - { - $html = sprintf('
Type: %s
', get_class($error)); - - if (($code = $error->getCode())) { - $html .= sprintf('
Code: %s
', $code); - } - - if (($message = $error->getMessage())) { - $html .= sprintf('
Message: %s
', htmlentities($message)); - } - - if (($file = $error->getFile())) { - $html .= sprintf('
File: %s
', $file); - } - - if (($line = $error->getLine())) { - $html .= sprintf('
Line: %s
', $line); - } - - if (($trace = $error->getTraceAsString())) { - $html .= '

Trace

'; - $html .= sprintf('
%s
', htmlentities($trace)); - } - - return $html; - } - - /** - * Render JSON error - * - * @param \Throwable $error - * - * @return string - */ - protected function renderJsonErrorMessage(\Throwable $error) - { - $json = [ - 'message' => 'Slim Application Error', - ]; - - if ($this->displayErrorDetails) { - $json['error'] = []; - - do { - $json['error'][] = [ - 'type' => get_class($error), - 'code' => $error->getCode(), - 'message' => $error->getMessage(), - 'file' => $error->getFile(), - 'line' => $error->getLine(), - 'trace' => explode("\n", $error->getTraceAsString()), - ]; - } while ($error = $error->getPrevious()); - } - - return json_encode($json, JSON_PRETTY_PRINT); - } - - /** - * Render XML error - * - * @param \Throwable $error - * - * @return string - */ - protected function renderXmlErrorMessage(\Throwable $error) - { - $xml = "\n Slim Application Error\n"; - if ($this->displayErrorDetails) { - do { - $xml .= " \n"; - $xml .= " " . get_class($error) . "\n"; - $xml .= " " . $error->getCode() . "\n"; - $xml .= " " . $this->createCdataSection($error->getMessage()) . "\n"; - $xml .= " " . $error->getFile() . "\n"; - $xml .= " " . $error->getLine() . "\n"; - $xml .= " " . $this->createCdataSection($error->getTraceAsString()) . "\n"; - $xml .= " \n"; - } while ($error = $error->getPrevious()); - } - $xml .= ""; - - return $xml; - } - - /** - * Returns a CDATA section with the given content. - * - * @param string $content - * @return string - */ - private function createCdataSection($content) - { - return sprintf('', str_replace(']]>', ']]]]>', $content)); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php deleted file mode 100644 index 157bdebee94..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php +++ /dev/null @@ -1,43 +0,0 @@ - $v) { - $request = $request->withAttribute($k, $v); - } - - return call_user_func($callable, $request, $response, $routeArguments); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php deleted file mode 100644 index 11793d36e40..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php +++ /dev/null @@ -1,42 +0,0 @@ - '', - 'domain' => null, - 'hostonly' => null, - 'path' => null, - 'expires' => null, - 'secure' => false, - 'httponly' => false - ]; - - /** - * Create new cookies helper - * - * @param array $cookies - */ - public function __construct(array $cookies = []) - { - $this->requestCookies = $cookies; - } - - /** - * Set default cookie properties - * - * @param array $settings - */ - public function setDefaults(array $settings) - { - $this->defaults = array_replace($this->defaults, $settings); - } - - /** - * Get request cookie - * - * @param string $name Cookie name - * @param mixed $default Cookie default value - * - * @return mixed Cookie value if present, else default - */ - public function get($name, $default = null) - { - return isset($this->requestCookies[$name]) ? $this->requestCookies[$name] : $default; - } - - /** - * Set response cookie - * - * @param string $name Cookie name - * @param string|array $value Cookie value, or cookie properties - */ - public function set($name, $value) - { - if (!is_array($value)) { - $value = ['value' => (string)$value]; - } - $this->responseCookies[$name] = array_replace($this->defaults, $value); - } - - /** - * Convert to `Set-Cookie` headers - * - * @return string[] - */ - public function toHeaders() - { - $headers = []; - foreach ($this->responseCookies as $name => $properties) { - $headers[] = $this->toHeader($name, $properties); - } - - return $headers; - } - - /** - * Convert to `Set-Cookie` header - * - * @param string $name Cookie name - * @param array $properties Cookie properties - * - * @return string - */ - protected function toHeader($name, array $properties) - { - $result = urlencode($name) . '=' . urlencode($properties['value']); - - if (isset($properties['domain'])) { - $result .= '; domain=' . $properties['domain']; - } - - if (isset($properties['path'])) { - $result .= '; path=' . $properties['path']; - } - - if (isset($properties['expires'])) { - if (is_string($properties['expires'])) { - $timestamp = strtotime($properties['expires']); - } else { - $timestamp = (int)$properties['expires']; - } - if ($timestamp !== 0) { - $result .= '; expires=' . gmdate('D, d-M-Y H:i:s e', $timestamp); - } - } - - if (isset($properties['secure']) && $properties['secure']) { - $result .= '; secure'; - } - - if (isset($properties['hostonly']) && $properties['hostonly']) { - $result .= '; HostOnly'; - } - - if (isset($properties['httponly']) && $properties['httponly']) { - $result .= '; HttpOnly'; - } - - return $result; - } - - /** - * Parse HTTP request `Cookie:` header and extract - * into a PHP associative array. - * - * @param string $header The raw HTTP request `Cookie:` header - * - * @return array Associative array of cookie names and values - * - * @throws InvalidArgumentException if the cookie data cannot be parsed - */ - public static function parseHeader($header) - { - if (is_array($header) === true) { - $header = isset($header[0]) ? $header[0] : ''; - } - - if (is_string($header) === false) { - throw new InvalidArgumentException('Cannot parse Cookie data. Header value must be a string.'); - } - - $header = rtrim($header, "\r\n"); - $pieces = preg_split('@\s*[;,]\s*@', $header); - $cookies = []; - - foreach ($pieces as $cookie) { - $cookie = explode('=', $cookie, 2); - - if (count($cookie) === 2) { - $key = urldecode($cookie[0]); - $value = urldecode($cookie[1]); - - if (!isset($cookies[$key])) { - $cookies[$key] = $value; - } - } - } - - return $cookies; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Environment.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Environment.php deleted file mode 100644 index a106fa8b877..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Environment.php +++ /dev/null @@ -1,52 +0,0 @@ - 'HTTP/1.1', - 'REQUEST_METHOD' => 'GET', - 'SCRIPT_NAME' => '', - 'REQUEST_URI' => '', - 'QUERY_STRING' => '', - 'SERVER_NAME' => 'localhost', - 'SERVER_PORT' => 80, - 'HTTP_HOST' => 'localhost', - 'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', - 'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.8', - 'HTTP_ACCEPT_CHARSET' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', - 'HTTP_USER_AGENT' => 'Slim Framework', - 'REMOTE_ADDR' => '127.0.0.1', - 'REQUEST_TIME' => time(), - 'REQUEST_TIME_FLOAT' => microtime(true), - ], $userData); - - return new static($data); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Headers.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Headers.php deleted file mode 100644 index 4aa7a5e4de0..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Headers.php +++ /dev/null @@ -1,222 +0,0 @@ - 1, - 'CONTENT_LENGTH' => 1, - 'PHP_AUTH_USER' => 1, - 'PHP_AUTH_PW' => 1, - 'PHP_AUTH_DIGEST' => 1, - 'AUTH_TYPE' => 1, - ]; - - /** - * Create new headers collection with data extracted from - * the application Environment object - * - * @param Environment $environment The Slim application Environment - * - * @return self - */ - public static function createFromEnvironment(Environment $environment) - { - $data = []; - $environment = self::determineAuthorization($environment); - foreach ($environment as $key => $value) { - $key = strtoupper($key); - if (isset(static::$special[$key]) || strpos($key, 'HTTP_') === 0) { - if ($key !== 'HTTP_CONTENT_LENGTH') { - $data[$key] = $value; - } - } - } - - return new static($data); - } - - /** - * If HTTP_AUTHORIZATION does not exist tries to get it from - * getallheaders() when available. - * - * @param Environment $environment The Slim application Environment - * - * @return Environment - */ - - public static function determineAuthorization(Environment $environment) - { - $authorization = $environment->get('HTTP_AUTHORIZATION'); - - if (null === $authorization && is_callable('getallheaders')) { - $headers = getallheaders(); - $headers = array_change_key_case($headers, CASE_LOWER); - if (isset($headers['authorization'])) { - $environment->set('HTTP_AUTHORIZATION', $headers['authorization']); - } - } - - return $environment; - } - - /** - * Return array of HTTP header names and values. - * This method returns the _original_ header name - * as specified by the end user. - * - * @return array - */ - public function all() - { - $all = parent::all(); - $out = []; - foreach ($all as $key => $props) { - $out[$props['originalKey']] = $props['value']; - } - - return $out; - } - - /** - * Set HTTP header value - * - * This method sets a header value. It replaces - * any values that may already exist for the header name. - * - * @param string $key The case-insensitive header name - * @param string $value The header value - */ - public function set($key, $value) - { - if (!is_array($value)) { - $value = [$value]; - } - parent::set($this->normalizeKey($key), [ - 'value' => $value, - 'originalKey' => $key - ]); - } - - /** - * Get HTTP header value - * - * @param string $key The case-insensitive header name - * @param mixed $default The default value if key does not exist - * - * @return string[] - */ - public function get($key, $default = null) - { - if ($this->has($key)) { - return parent::get($this->normalizeKey($key))['value']; - } - - return $default; - } - - /** - * Get HTTP header key as originally specified - * - * @param string $key The case-insensitive header name - * @param mixed $default The default value if key does not exist - * - * @return string - */ - public function getOriginalKey($key, $default = null) - { - if ($this->has($key)) { - return parent::get($this->normalizeKey($key))['originalKey']; - } - - return $default; - } - - /** - * Add HTTP header value - * - * This method appends a header value. Unlike the set() method, - * this method _appends_ this new value to any values - * that already exist for this header name. - * - * @param string $key The case-insensitive header name - * @param array|string $value The new header value(s) - */ - public function add($key, $value) - { - $oldValues = $this->get($key, []); - $newValues = is_array($value) ? $value : [$value]; - $this->set($key, array_merge($oldValues, array_values($newValues))); - } - - /** - * Does this collection have a given header? - * - * @param string $key The case-insensitive header name - * - * @return bool - */ - public function has($key) - { - return parent::has($this->normalizeKey($key)); - } - - /** - * Remove header from collection - * - * @param string $key The case-insensitive header name - */ - public function remove($key) - { - parent::remove($this->normalizeKey($key)); - } - - /** - * Normalize header name - * - * This method transforms header names into a - * normalized form. This is how we enable case-insensitive - * header names in the other methods in this class. - * - * @param string $key The case-insensitive header name - * - * @return string Normalized header name - */ - public function normalizeKey($key) - { - $key = strtr(strtolower($key), '_', '-'); - if (strpos($key, 'http-') === 0) { - $key = substr($key, 5); - } - - return $key; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Message.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Message.php deleted file mode 100644 index d0e832d695f..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Message.php +++ /dev/null @@ -1,295 +0,0 @@ -protocolVersion; - } - - /** - * Return an instance with the specified HTTP protocol version. - * - * The version string MUST contain only the HTTP version number (e.g., - * "1.1", "1.0"). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new protocol version. - * - * @param string $version HTTP protocol version - * @return static - * @throws InvalidArgumentException if the http version is an invalid number - */ - public function withProtocolVersion($version) - { - static $valid = [ - '1.0' => true, - '1.1' => true, - '2.0' => true, - ]; - if (!isset($valid[$version])) { - throw new InvalidArgumentException('Invalid HTTP version. Must be one of: 1.0, 1.1, 2.0'); - } - $clone = clone $this; - $clone->protocolVersion = $version; - - return $clone; - } - - /******************************************************************************* - * Headers - ******************************************************************************/ - - /** - * Retrieves all message header values. - * - * The keys represent the header name as it will be sent over the wire, and - * each value is an array of strings associated with the header. - * - * // Represent the headers as a string - * foreach ($message->getHeaders() as $name => $values) { - * echo $name . ": " . implode(", ", $values); - * } - * - * // Emit headers iteratively: - * foreach ($message->getHeaders() as $name => $values) { - * foreach ($values as $value) { - * header(sprintf('%s: %s', $name, $value), false); - * } - * } - * - * While header names are not case-sensitive, getHeaders() will preserve the - * exact case in which headers were originally specified. - * - * @return array Returns an associative array of the message's headers. Each - * key MUST be a header name, and each value MUST be an array of strings - * for that header. - */ - public function getHeaders() - { - return $this->headers->all(); - } - - /** - * Checks if a header exists by the given case-insensitive name. - * - * @param string $name Case-insensitive header field name. - * @return bool Returns true if any header names match the given header - * name using a case-insensitive string comparison. Returns false if - * no matching header name is found in the message. - */ - public function hasHeader($name) - { - return $this->headers->has($name); - } - - /** - * Retrieves a message header value by the given case-insensitive name. - * - * This method returns an array of all the header values of the given - * case-insensitive header name. - * - * If the header does not appear in the message, this method MUST return an - * empty array. - * - * @param string $name Case-insensitive header field name. - * @return string[] An array of string values as provided for the given - * header. If the header does not appear in the message, this method MUST - * return an empty array. - */ - public function getHeader($name) - { - return $this->headers->get($name, []); - } - - /** - * Retrieves a comma-separated string of the values for a single header. - * - * This method returns all of the header values of the given - * case-insensitive header name as a string concatenated together using - * a comma. - * - * NOTE: Not all header values may be appropriately represented using - * comma concatenation. For such headers, use getHeader() instead - * and supply your own delimiter when concatenating. - * - * If the header does not appear in the message, this method MUST return - * an empty string. - * - * @param string $name Case-insensitive header field name. - * @return string A string of values as provided for the given header - * concatenated together using a comma. If the header does not appear in - * the message, this method MUST return an empty string. - */ - public function getHeaderLine($name) - { - return implode(',', $this->headers->get($name, [])); - } - - /** - * Return an instance with the provided value replacing the specified header. - * - * While header names are case-insensitive, the casing of the header will - * be preserved by this function, and returned from getHeaders(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new and/or updated header and value. - * - * @param string $name Case-insensitive header field name. - * @param string|string[] $value Header value(s). - * @return static - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withHeader($name, $value) - { - $clone = clone $this; - $clone->headers->set($name, $value); - - return $clone; - } - - /** - * Return an instance with the specified header appended with the given value. - * - * Existing values for the specified header will be maintained. The new - * value(s) will be appended to the existing list. If the header did not - * exist previously, it will be added. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new header and/or value. - * - * @param string $name Case-insensitive header field name to add. - * @param string|string[] $value Header value(s). - * @return static - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withAddedHeader($name, $value) - { - $clone = clone $this; - $clone->headers->add($name, $value); - - return $clone; - } - - /** - * Return an instance without the specified header. - * - * Header resolution MUST be done without case-sensitivity. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the named header. - * - * @param string $name Case-insensitive header field name to remove. - * @return static - */ - public function withoutHeader($name) - { - $clone = clone $this; - $clone->headers->remove($name); - - return $clone; - } - - /******************************************************************************* - * Body - ******************************************************************************/ - - /** - * Gets the body of the message. - * - * @return StreamInterface Returns the body as a stream. - */ - public function getBody() - { - return $this->body; - } - - /** - * Return an instance with the specified message body. - * - * The body MUST be a StreamInterface object. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return a new instance that has the - * new body stream. - * - * @param StreamInterface $body Body. - * @return static - * @throws \InvalidArgumentException When the body is not valid. - */ - public function withBody(StreamInterface $body) - { - // TODO: Test for invalid body? - $clone = clone $this; - $clone->body = $body; - - return $clone; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Request.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Request.php deleted file mode 100644 index 7d5b185dcd8..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Request.php +++ /dev/null @@ -1,1156 +0,0 @@ - 1, - 'DELETE' => 1, - 'GET' => 1, - 'HEAD' => 1, - 'OPTIONS' => 1, - 'PATCH' => 1, - 'POST' => 1, - 'PUT' => 1, - 'TRACE' => 1, - ]; - - /** - * Create new HTTP request with data extracted from the application - * Environment object - * - * @param Environment $environment The Slim application Environment - * - * @return self - */ - public static function createFromEnvironment(Environment $environment) - { - $method = $environment['REQUEST_METHOD']; - $uri = Uri::createFromEnvironment($environment); - $headers = Headers::createFromEnvironment($environment); - $cookies = Cookies::parseHeader($headers->get('Cookie', [])); - $serverParams = $environment->all(); - $body = new RequestBody(); - $uploadedFiles = UploadedFile::createFromEnvironment($environment); - - $request = new static($method, $uri, $headers, $cookies, $serverParams, $body, $uploadedFiles); - - if ($method === 'POST' && - in_array($request->getMediaType(), ['application/x-www-form-urlencoded', 'multipart/form-data']) - ) { - // parsed body must be $_POST - $request = $request->withParsedBody($_POST); - } - return $request; - } - - /** - * Create new HTTP request. - * - * Adds a host header when none was provided and a host is defined in uri. - * - * @param string $method The request method - * @param UriInterface $uri The request URI object - * @param HeadersInterface $headers The request headers collection - * @param array $cookies The request cookies collection - * @param array $serverParams The server environment variables - * @param StreamInterface $body The request body object - * @param array $uploadedFiles The request uploadedFiles collection - */ - public function __construct( - $method, - UriInterface $uri, - HeadersInterface $headers, - array $cookies, - array $serverParams, - StreamInterface $body, - array $uploadedFiles = [] - ) { - $this->originalMethod = $this->filterMethod($method); - $this->uri = $uri; - $this->headers = $headers; - $this->cookies = $cookies; - $this->serverParams = $serverParams; - $this->attributes = new Collection(); - $this->body = $body; - $this->uploadedFiles = $uploadedFiles; - - if (isset($serverParams['SERVER_PROTOCOL'])) { - $this->protocolVersion = str_replace('HTTP/', '', $serverParams['SERVER_PROTOCOL']); - } - - if (!$this->headers->has('Host') || $this->uri->getHost() !== '') { - $this->headers->set('Host', $this->uri->getHost()); - } - - $this->registerMediaTypeParser('application/json', function ($input) { - return json_decode($input, true); - }); - - $this->registerMediaTypeParser('application/xml', function ($input) { - $backup = libxml_disable_entity_loader(true); - $result = simplexml_load_string($input); - libxml_disable_entity_loader($backup); - return $result; - }); - - $this->registerMediaTypeParser('text/xml', function ($input) { - $backup = libxml_disable_entity_loader(true); - $result = simplexml_load_string($input); - libxml_disable_entity_loader($backup); - return $result; - }); - - $this->registerMediaTypeParser('application/x-www-form-urlencoded', function ($input) { - parse_str($input, $data); - return $data; - }); - } - - /** - * This method is applied to the cloned object - * after PHP performs an initial shallow-copy. This - * method completes a deep-copy by creating new objects - * for the cloned object's internal reference pointers. - */ - public function __clone() - { - $this->headers = clone $this->headers; - $this->attributes = clone $this->attributes; - $this->body = clone $this->body; - } - - /******************************************************************************* - * Method - ******************************************************************************/ - - /** - * Retrieves the HTTP method of the request. - * - * @return string Returns the request method. - */ - public function getMethod() - { - if ($this->method === null) { - $this->method = $this->originalMethod; - $customMethod = $this->getHeaderLine('X-Http-Method-Override'); - - if ($customMethod) { - $this->method = $this->filterMethod($customMethod); - } elseif ($this->originalMethod === 'POST') { - $body = $this->getParsedBody(); - - if (is_object($body) && property_exists($body, '_METHOD')) { - $this->method = $this->filterMethod((string)$body->_METHOD); - } elseif (is_array($body) && isset($body['_METHOD'])) { - $this->method = $this->filterMethod((string)$body['_METHOD']); - } - - if ($this->getBody()->eof()) { - $this->getBody()->rewind(); - } - } - } - - return $this->method; - } - - /** - * Get the original HTTP method (ignore override). - * - * Note: This method is not part of the PSR-7 standard. - * - * @return string - */ - public function getOriginalMethod() - { - return $this->originalMethod; - } - - /** - * Return an instance with the provided HTTP method. - * - * While HTTP method names are typically all uppercase characters, HTTP - * method names are case-sensitive and thus implementations SHOULD NOT - * modify the given string. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * changed request method. - * - * @param string $method Case-sensitive method. - * @return self - * @throws \InvalidArgumentException for invalid HTTP methods. - */ - public function withMethod($method) - { - $method = $this->filterMethod($method); - $clone = clone $this; - $clone->originalMethod = $method; - $clone->method = $method; - - return $clone; - } - - /** - * Validate the HTTP method - * - * @param null|string $method - * @return null|string - * @throws \InvalidArgumentException on invalid HTTP method. - */ - protected function filterMethod($method) - { - if ($method === null) { - return $method; - } - - if (!is_string($method)) { - throw new InvalidArgumentException(sprintf( - 'Unsupported HTTP method; must be a string, received %s', - (is_object($method) ? get_class($method) : gettype($method)) - )); - } - - $method = strtoupper($method); - if (!isset($this->validMethods[$method])) { - throw new InvalidArgumentException(sprintf( - 'Unsupported HTTP method "%s" provided', - $method - )); - } - - return $method; - } - - /** - * Does this request use a given method? - * - * Note: This method is not part of the PSR-7 standard. - * - * @param string $method HTTP method - * @return bool - */ - public function isMethod($method) - { - return $this->getMethod() === $method; - } - - /** - * Is this a GET request? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isGet() - { - return $this->isMethod('GET'); - } - - /** - * Is this a POST request? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isPost() - { - return $this->isMethod('POST'); - } - - /** - * Is this a PUT request? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isPut() - { - return $this->isMethod('PUT'); - } - - /** - * Is this a PATCH request? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isPatch() - { - return $this->isMethod('PATCH'); - } - - /** - * Is this a DELETE request? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isDelete() - { - return $this->isMethod('DELETE'); - } - - /** - * Is this a HEAD request? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isHead() - { - return $this->isMethod('HEAD'); - } - - /** - * Is this a OPTIONS request? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isOptions() - { - return $this->isMethod('OPTIONS'); - } - - /** - * Is this an XHR request? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isXhr() - { - return $this->getHeaderLine('X-Requested-With') === 'XMLHttpRequest'; - } - - /******************************************************************************* - * URI - ******************************************************************************/ - - /** - * Retrieves the message's request target. - * - * Retrieves the message's request-target either as it will appear (for - * clients), as it appeared at request (for servers), or as it was - * specified for the instance (see withRequestTarget()). - * - * In most cases, this will be the origin-form of the composed URI, - * unless a value was provided to the concrete implementation (see - * withRequestTarget() below). - * - * If no URI is available, and no request-target has been specifically - * provided, this method MUST return the string "/". - * - * @return string - */ - public function getRequestTarget() - { - if ($this->requestTarget) { - return $this->requestTarget; - } - - if ($this->uri === null) { - return '/'; - } - - $basePath = $this->uri->getBasePath(); - $path = $this->uri->getPath(); - $path = $basePath . '/' . ltrim($path, '/'); - - $query = $this->uri->getQuery(); - if ($query) { - $path .= '?' . $query; - } - $this->requestTarget = $path; - - return $this->requestTarget; - } - - /** - * Return an instance with the specific request-target. - * - * If the request needs a non-origin-form request-target — e.g., for - * specifying an absolute-form, authority-form, or asterisk-form — - * this method may be used to create an instance with the specified - * request-target, verbatim. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * changed request target. - * - * @link http://tools.ietf.org/html/rfc7230#section-2.7 (for the various - * request-target forms allowed in request messages) - * @param mixed $requestTarget - * @return self - * @throws InvalidArgumentException if the request target is invalid - */ - public function withRequestTarget($requestTarget) - { - if (preg_match('#\s#', $requestTarget)) { - throw new InvalidArgumentException( - 'Invalid request target provided; must be a string and cannot contain whitespace' - ); - } - $clone = clone $this; - $clone->requestTarget = $requestTarget; - - return $clone; - } - - /** - * Retrieves the URI instance. - * - * This method MUST return a UriInterface instance. - * - * @link http://tools.ietf.org/html/rfc3986#section-4.3 - * @return UriInterface Returns a UriInterface instance - * representing the URI of the request. - */ - public function getUri() - { - return $this->uri; - } - - /** - * Returns an instance with the provided URI. - * - * This method MUST update the Host header of the returned request by - * default if the URI contains a host component. If the URI does not - * contain a host component, any pre-existing Host header MUST be carried - * over to the returned request. - * - * You can opt-in to preserving the original state of the Host header by - * setting `$preserveHost` to `true`. When `$preserveHost` is set to - * `true`, this method interacts with the Host header in the following ways: - * - * - If the the Host header is missing or empty, and the new URI contains - * a host component, this method MUST update the Host header in the returned - * request. - * - If the Host header is missing or empty, and the new URI does not contain a - * host component, this method MUST NOT update the Host header in the returned - * request. - * - If a Host header is present and non-empty, this method MUST NOT update - * the Host header in the returned request. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new UriInterface instance. - * - * @link http://tools.ietf.org/html/rfc3986#section-4.3 - * @param UriInterface $uri New request URI to use. - * @param bool $preserveHost Preserve the original state of the Host header. - * @return self - */ - public function withUri(UriInterface $uri, $preserveHost = false) - { - $clone = clone $this; - $clone->uri = $uri; - - if (!$preserveHost) { - if ($uri->getHost() !== '') { - $clone->headers->set('Host', $uri->getHost()); - } - } else { - if ($this->uri->getHost() !== '' && (!$this->hasHeader('Host') || $this->getHeader('Host') === null)) { - $clone->headers->set('Host', $uri->getHost()); - } - } - - return $clone; - } - - /** - * Get request content type. - * - * Note: This method is not part of the PSR-7 standard. - * - * @return string|null The request content type, if known - */ - public function getContentType() - { - $result = $this->getHeader('Content-Type'); - - return $result ? $result[0] : null; - } - - /** - * Get request media type, if known. - * - * Note: This method is not part of the PSR-7 standard. - * - * @return string|null The request media type, minus content-type params - */ - public function getMediaType() - { - $contentType = $this->getContentType(); - if ($contentType) { - $contentTypeParts = preg_split('/\s*[;,]\s*/', $contentType); - - return strtolower($contentTypeParts[0]); - } - - return null; - } - - /** - * Get request media type params, if known. - * - * Note: This method is not part of the PSR-7 standard. - * - * @return array - */ - public function getMediaTypeParams() - { - $contentType = $this->getContentType(); - $contentTypeParams = []; - if ($contentType) { - $contentTypeParts = preg_split('/\s*[;,]\s*/', $contentType); - $contentTypePartsLength = count($contentTypeParts); - for ($i = 1; $i < $contentTypePartsLength; $i++) { - $paramParts = explode('=', $contentTypeParts[$i]); - $contentTypeParams[strtolower($paramParts[0])] = $paramParts[1]; - } - } - - return $contentTypeParams; - } - - /** - * Get request content character set, if known. - * - * Note: This method is not part of the PSR-7 standard. - * - * @return string|null - */ - public function getContentCharset() - { - $mediaTypeParams = $this->getMediaTypeParams(); - if (isset($mediaTypeParams['charset'])) { - return $mediaTypeParams['charset']; - } - - return null; - } - - /** - * Get request content length, if known. - * - * Note: This method is not part of the PSR-7 standard. - * - * @return int|null - */ - public function getContentLength() - { - $result = $this->headers->get('Content-Length'); - - return $result ? (int)$result[0] : null; - } - - /******************************************************************************* - * Cookies - ******************************************************************************/ - - /** - * Retrieve cookies. - * - * Retrieves cookies sent by the client to the server. - * - * The data MUST be compatible with the structure of the $_COOKIE - * superglobal. - * - * @return array - */ - public function getCookieParams() - { - return $this->cookies; - } - - /** - * Return an instance with the specified cookies. - * - * The data IS NOT REQUIRED to come from the $_COOKIE superglobal, but MUST - * be compatible with the structure of $_COOKIE. Typically, this data will - * be injected at instantiation. - * - * This method MUST NOT update the related Cookie header of the request - * instance, nor related values in the server params. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated cookie values. - * - * @param array $cookies Array of key/value pairs representing cookies. - * @return self - */ - public function withCookieParams(array $cookies) - { - $clone = clone $this; - $clone->cookies = $cookies; - - return $clone; - } - - /******************************************************************************* - * Query Params - ******************************************************************************/ - - /** - * Retrieve query string arguments. - * - * Retrieves the deserialized query string arguments, if any. - * - * Note: the query params might not be in sync with the URI or server - * params. If you need to ensure you are only getting the original - * values, you may need to parse the query string from `getUri()->getQuery()` - * or from the `QUERY_STRING` server param. - * - * @return array - */ - public function getQueryParams() - { - if (is_array($this->queryParams)) { - return $this->queryParams; - } - - if ($this->uri === null) { - return []; - } - - parse_str($this->uri->getQuery(), $this->queryParams); // <-- URL decodes data - - return $this->queryParams; - } - - /** - * Return an instance with the specified query string arguments. - * - * These values SHOULD remain immutable over the course of the incoming - * request. They MAY be injected during instantiation, such as from PHP's - * $_GET superglobal, or MAY be derived from some other value such as the - * URI. In cases where the arguments are parsed from the URI, the data - * MUST be compatible with what PHP's parse_str() would return for - * purposes of how duplicate query parameters are handled, and how nested - * sets are handled. - * - * Setting query string arguments MUST NOT change the URI stored by the - * request, nor the values in the server params. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated query string arguments. - * - * @param array $query Array of query string arguments, typically from - * $_GET. - * @return self - */ - public function withQueryParams(array $query) - { - $clone = clone $this; - $clone->queryParams = $query; - - return $clone; - } - - /******************************************************************************* - * File Params - ******************************************************************************/ - - /** - * Retrieve normalized file upload data. - * - * This method returns upload metadata in a normalized tree, with each leaf - * an instance of Psr\Http\Message\UploadedFileInterface. - * - * These values MAY be prepared from $_FILES or the message body during - * instantiation, or MAY be injected via withUploadedFiles(). - * - * @return array An array tree of UploadedFileInterface instances; an empty - * array MUST be returned if no data is present. - */ - public function getUploadedFiles() - { - return $this->uploadedFiles; - } - - /** - * Create a new instance with the specified uploaded files. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param array $uploadedFiles An array tree of UploadedFileInterface instances. - * @return self - * @throws \InvalidArgumentException if an invalid structure is provided. - */ - public function withUploadedFiles(array $uploadedFiles) - { - $clone = clone $this; - $clone->uploadedFiles = $uploadedFiles; - - return $clone; - } - - /******************************************************************************* - * Server Params - ******************************************************************************/ - - /** - * Retrieve server parameters. - * - * Retrieves data related to the incoming request environment, - * typically derived from PHP's $_SERVER superglobal. The data IS NOT - * REQUIRED to originate from $_SERVER. - * - * @return array - */ - public function getServerParams() - { - return $this->serverParams; - } - - /******************************************************************************* - * Attributes - ******************************************************************************/ - - /** - * Retrieve attributes derived from the request. - * - * The request "attributes" may be used to allow injection of any - * parameters derived from the request: e.g., the results of path - * match operations; the results of decrypting cookies; the results of - * deserializing non-form-encoded message bodies; etc. Attributes - * will be application and request specific, and CAN be mutable. - * - * @return array Attributes derived from the request. - */ - public function getAttributes() - { - return $this->attributes->all(); - } - - /** - * Retrieve a single derived request attribute. - * - * Retrieves a single derived request attribute as described in - * getAttributes(). If the attribute has not been previously set, returns - * the default value as provided. - * - * This method obviates the need for a hasAttribute() method, as it allows - * specifying a default value to return if the attribute is not found. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $default Default value to return if the attribute does not exist. - * @return mixed - */ - public function getAttribute($name, $default = null) - { - return $this->attributes->get($name, $default); - } - - /** - * Return an instance with the specified derived request attribute. - * - * This method allows setting a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $value The value of the attribute. - * @return self - */ - public function withAttribute($name, $value) - { - $clone = clone $this; - $clone->attributes->set($name, $value); - - return $clone; - } - - /** - * Create a new instance with the specified derived request attributes. - * - * Note: This method is not part of the PSR-7 standard. - * - * This method allows setting all new derived request attributes as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return a new instance that has the - * updated attributes. - * - * @param array $attributes New attributes - * @return self - */ - public function withAttributes(array $attributes) - { - $clone = clone $this; - $clone->attributes = new Collection($attributes); - - return $clone; - } - - /** - * Return an instance that removes the specified derived request attribute. - * - * This method allows removing a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @return self - */ - public function withoutAttribute($name) - { - $clone = clone $this; - $clone->attributes->remove($name); - - return $clone; - } - - /******************************************************************************* - * Body - ******************************************************************************/ - - /** - * Retrieve any parameters provided in the request body. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, this method MUST - * return the contents of $_POST. - * - * Otherwise, this method may return any results of deserializing - * the request body content; as parsing returns structured content, the - * potential types MUST be arrays or objects only. A null value indicates - * the absence of body content. - * - * @return null|array|object The deserialized body parameters, if any. - * These will typically be an array or object. - * @throws RuntimeException if the request body media type parser returns an invalid value - */ - public function getParsedBody() - { - if ($this->bodyParsed !== false) { - return $this->bodyParsed; - } - - if (!$this->body) { - return null; - } - - $mediaType = $this->getMediaType(); - - // look for a media type with a structured syntax suffix (RFC 6839) - $parts = explode('+', $mediaType); - if (count($parts) >= 2) { - $mediaType = 'application/' . $parts[count($parts)-1]; - } - - if (isset($this->bodyParsers[$mediaType]) === true) { - $body = (string)$this->getBody(); - $parsed = $this->bodyParsers[$mediaType]($body); - - if (!is_null($parsed) && !is_object($parsed) && !is_array($parsed)) { - throw new RuntimeException( - 'Request body media type parser return value must be an array, an object, or null' - ); - } - $this->bodyParsed = $parsed; - return $this->bodyParsed; - } - - return null; - } - - /** - * Return an instance with the specified body parameters. - * - * These MAY be injected during instantiation. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, use this method - * ONLY to inject the contents of $_POST. - * - * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of - * deserializing the request body content. Deserialization/parsing returns - * structured data, and, as such, this method ONLY accepts arrays or objects, - * or a null value if nothing was available to parse. - * - * As an example, if content negotiation determines that the request data - * is a JSON payload, this method could be used to create a request - * instance with the deserialized parameters. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param null|array|object $data The deserialized body data. This will - * typically be in an array or object. - * @return self - * @throws \InvalidArgumentException if an unsupported argument type is - * provided. - */ - public function withParsedBody($data) - { - if (!is_null($data) && !is_object($data) && !is_array($data)) { - throw new InvalidArgumentException('Parsed body value must be an array, an object, or null'); - } - - $clone = clone $this; - $clone->bodyParsed = $data; - - return $clone; - } - - /** - * Force Body to be parsed again. - * - * Note: This method is not part of the PSR-7 standard. - * - * @return self - */ - public function reparseBody() - { - $this->bodyParsed = false; - - return $this; - } - - /** - * Register media type parser. - * - * Note: This method is not part of the PSR-7 standard. - * - * @param string $mediaType A HTTP media type (excluding content-type - * params). - * @param callable $callable A callable that returns parsed contents for - * media type. - */ - public function registerMediaTypeParser($mediaType, callable $callable) - { - if ($callable instanceof Closure) { - $callable = $callable->bindTo($this); - } - $this->bodyParsers[(string)$mediaType] = $callable; - } - - /******************************************************************************* - * Parameters (e.g., POST and GET data) - ******************************************************************************/ - - /** - * Fetch request parameter value from body or query string (in that order). - * - * Note: This method is not part of the PSR-7 standard. - * - * @param string $key The parameter key. - * @param string $default The default value. - * - * @return mixed The parameter value. - */ - public function getParam($key, $default = null) - { - $postParams = $this->getParsedBody(); - $getParams = $this->getQueryParams(); - $result = $default; - if (is_array($postParams) && isset($postParams[$key])) { - $result = $postParams[$key]; - } elseif (is_object($postParams) && property_exists($postParams, $key)) { - $result = $postParams->$key; - } elseif (isset($getParams[$key])) { - $result = $getParams[$key]; - } - - return $result; - } - - /** - * Fetch parameter value from request body. - * - * Note: This method is not part of the PSR-7 standard. - * - * @param $key - * @param null $default - * - * @return null - */ - public function getParsedBodyParam($key, $default = null) - { - $postParams = $this->getParsedBody(); - $result = $default; - if (is_array($postParams) && isset($postParams[$key])) { - $result = $postParams[$key]; - } elseif (is_object($postParams) && property_exists($postParams, $key)) { - $result = $postParams->$key; - } - - return $result; - } - - /** - * Fetch parameter value from query string. - * - * Note: This method is not part of the PSR-7 standard. - * - * @param $key - * @param null $default - * - * @return null - */ - public function getQueryParam($key, $default = null) - { - $getParams = $this->getQueryParams(); - $result = $default; - if (isset($getParams[$key])) { - $result = $getParams[$key]; - } - - return $result; - } - - /** - * Fetch assocative array of body and query string parameters. - * - * Note: This method is not part of the PSR-7 standard. - * - * @return array - */ - public function getParams() - { - $params = $this->getQueryParams(); - $postParams = $this->getParsedBody(); - if ($postParams) { - $params = array_merge($params, (array)$postParams); - } - - return $params; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/RequestBody.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/RequestBody.php deleted file mode 100644 index 2345fe4354c..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/RequestBody.php +++ /dev/null @@ -1,27 +0,0 @@ - 'Continue', - 101 => 'Switching Protocols', - 102 => 'Processing', - //Successful 2xx - 200 => 'OK', - 201 => 'Created', - 202 => 'Accepted', - 203 => 'Non-Authoritative Information', - 204 => 'No Content', - 205 => 'Reset Content', - 206 => 'Partial Content', - 207 => 'Multi-Status', - 208 => 'Already Reported', - 226 => 'IM Used', - //Redirection 3xx - 300 => 'Multiple Choices', - 301 => 'Moved Permanently', - 302 => 'Found', - 303 => 'See Other', - 304 => 'Not Modified', - 305 => 'Use Proxy', - 306 => '(Unused)', - 307 => 'Temporary Redirect', - 308 => 'Permanent Redirect', - //Client Error 4xx - 400 => 'Bad Request', - 401 => 'Unauthorized', - 402 => 'Payment Required', - 403 => 'Forbidden', - 404 => 'Not Found', - 405 => 'Method Not Allowed', - 406 => 'Not Acceptable', - 407 => 'Proxy Authentication Required', - 408 => 'Request Timeout', - 409 => 'Conflict', - 410 => 'Gone', - 411 => 'Length Required', - 412 => 'Precondition Failed', - 413 => 'Request Entity Too Large', - 414 => 'Request-URI Too Long', - 415 => 'Unsupported Media Type', - 416 => 'Requested Range Not Satisfiable', - 417 => 'Expectation Failed', - 418 => 'I\'m a teapot', - 422 => 'Unprocessable Entity', - 423 => 'Locked', - 424 => 'Failed Dependency', - 426 => 'Upgrade Required', - 428 => 'Precondition Required', - 429 => 'Too Many Requests', - 431 => 'Request Header Fields Too Large', - 451 => 'Unavailable For Legal Reasons', - //Server Error 5xx - 500 => 'Internal Server Error', - 501 => 'Not Implemented', - 502 => 'Bad Gateway', - 503 => 'Service Unavailable', - 504 => 'Gateway Timeout', - 505 => 'HTTP Version Not Supported', - 506 => 'Variant Also Negotiates', - 507 => 'Insufficient Storage', - 508 => 'Loop Detected', - 510 => 'Not Extended', - 511 => 'Network Authentication Required', - ]; - - /** - * Create new HTTP response. - * - * @param int $status The response status code. - * @param HeadersInterface|null $headers The response headers. - * @param StreamInterface|null $body The response body. - */ - public function __construct($status = 200, HeadersInterface $headers = null, StreamInterface $body = null) - { - $this->status = $this->filterStatus($status); - $this->headers = $headers ? $headers : new Headers(); - $this->body = $body ? $body : new Body(fopen('php://temp', 'r+')); - } - - /** - * This method is applied to the cloned object - * after PHP performs an initial shallow-copy. This - * method completes a deep-copy by creating new objects - * for the cloned object's internal reference pointers. - */ - public function __clone() - { - $this->headers = clone $this->headers; - } - - /******************************************************************************* - * Status - ******************************************************************************/ - - /** - * Gets the response status code. - * - * The status code is a 3-digit integer result code of the server's attempt - * to understand and satisfy the request. - * - * @return int Status code. - */ - public function getStatusCode() - { - return $this->status; - } - - /** - * Return an instance with the specified status code and, optionally, reason phrase. - * - * If no reason phrase is specified, implementations MAY choose to default - * to the RFC 7231 or IANA recommended reason phrase for the response's - * status code. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated status and reason phrase. - * - * @link http://tools.ietf.org/html/rfc7231#section-6 - * @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml - * @param int $code The 3-digit integer result code to set. - * @param string $reasonPhrase The reason phrase to use with the - * provided status code; if none is provided, implementations MAY - * use the defaults as suggested in the HTTP specification. - * @return self - * @throws \InvalidArgumentException For invalid status code arguments. - */ - public function withStatus($code, $reasonPhrase = '') - { - $code = $this->filterStatus($code); - - if (!is_string($reasonPhrase) && !method_exists($reasonPhrase, '__toString')) { - throw new InvalidArgumentException('ReasonPhrase must be a string'); - } - - $clone = clone $this; - $clone->status = $code; - if ($reasonPhrase === '' && isset(static::$messages[$code])) { - $reasonPhrase = static::$messages[$code]; - } - - if ($reasonPhrase === '') { - throw new InvalidArgumentException('ReasonPhrase must be supplied for this code'); - } - - $clone->reasonPhrase = $reasonPhrase; - - return $clone; - } - - /** - * Filter HTTP status code. - * - * @param int $status HTTP status code. - * @return int - * @throws \InvalidArgumentException If an invalid HTTP status code is provided. - */ - protected function filterStatus($status) - { - if (!is_integer($status) || $status<100 || $status>599) { - throw new InvalidArgumentException('Invalid HTTP status code'); - } - - return $status; - } - - /** - * Gets the response reason phrase associated with the status code. - * - * Because a reason phrase is not a required element in a response - * status line, the reason phrase value MAY be null. Implementations MAY - * choose to return the default RFC 7231 recommended reason phrase (or those - * listed in the IANA HTTP Status Code Registry) for the response's - * status code. - * - * @link http://tools.ietf.org/html/rfc7231#section-6 - * @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml - * @return string Reason phrase; must return an empty string if none present. - */ - public function getReasonPhrase() - { - if ($this->reasonPhrase) { - return $this->reasonPhrase; - } - if (isset(static::$messages[$this->status])) { - return static::$messages[$this->status]; - } - return ''; - } - - /******************************************************************************* - * Body - ******************************************************************************/ - - /** - * Write data to the response body. - * - * Note: This method is not part of the PSR-7 standard. - * - * Proxies to the underlying stream and writes the provided data to it. - * - * @param string $data - * @return self - */ - public function write($data) - { - $this->getBody()->write($data); - - return $this; - } - - /******************************************************************************* - * Response Helpers - ******************************************************************************/ - - /** - * Redirect. - * - * Note: This method is not part of the PSR-7 standard. - * - * This method prepares the response object to return an HTTP Redirect - * response to the client. - * - * @param string|UriInterface $url The redirect destination. - * @param int|null $status The redirect HTTP status code. - * @return self - */ - public function withRedirect($url, $status = null) - { - $responseWithRedirect = $this->withHeader('Location', (string)$url); - - if (is_null($status) && $this->getStatusCode() === 200) { - $status = 302; - } - - if (!is_null($status)) { - return $responseWithRedirect->withStatus($status); - } - - return $responseWithRedirect; - } - - /** - * Json. - * - * Note: This method is not part of the PSR-7 standard. - * - * This method prepares the response object to return an HTTP Json - * response to the client. - * - * @param mixed $data The data - * @param int $status The HTTP status code. - * @param int $encodingOptions Json encoding options - * @throws \RuntimeException - * @return self - */ - public function withJson($data, $status = null, $encodingOptions = 0) - { - $body = $this->getBody(); - $body->rewind(); - $body->write($json = json_encode($data, $encodingOptions)); - - // Ensure that the json encoding passed successfully - if ($json === false) { - throw new \RuntimeException(json_last_error_msg(), json_last_error()); - } - - $responseWithJson = $this->withHeader('Content-Type', 'application/json;charset=utf-8'); - if (isset($status)) { - return $responseWithJson->withStatus($status); - } - return $responseWithJson; - } - - /** - * Is this response empty? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isEmpty() - { - return in_array($this->getStatusCode(), [204, 205, 304]); - } - - /** - * Is this response informational? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isInformational() - { - return $this->getStatusCode() >= 100 && $this->getStatusCode() < 200; - } - - /** - * Is this response OK? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isOk() - { - return $this->getStatusCode() === 200; - } - - /** - * Is this response successful? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isSuccessful() - { - return $this->getStatusCode() >= 200 && $this->getStatusCode() < 300; - } - - /** - * Is this response a redirect? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isRedirect() - { - return in_array($this->getStatusCode(), [301, 302, 303, 307]); - } - - /** - * Is this response a redirection? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isRedirection() - { - return $this->getStatusCode() >= 300 && $this->getStatusCode() < 400; - } - - /** - * Is this response forbidden? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - * @api - */ - public function isForbidden() - { - return $this->getStatusCode() === 403; - } - - /** - * Is this response not Found? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isNotFound() - { - return $this->getStatusCode() === 404; - } - - /** - * Is this response a client error? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isClientError() - { - return $this->getStatusCode() >= 400 && $this->getStatusCode() < 500; - } - - /** - * Is this response a server error? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isServerError() - { - return $this->getStatusCode() >= 500 && $this->getStatusCode() < 600; - } - - /** - * Convert response to string. - * - * Note: This method is not part of the PSR-7 standard. - * - * @return string - */ - public function __toString() - { - $output = sprintf( - 'HTTP/%s %s %s', - $this->getProtocolVersion(), - $this->getStatusCode(), - $this->getReasonPhrase() - ); - $output .= PHP_EOL; - foreach ($this->getHeaders() as $name => $values) { - $output .= sprintf('%s: %s', $name, $this->getHeaderLine($name)) . PHP_EOL; - } - $output .= PHP_EOL; - $output .= (string)$this->getBody(); - - return $output; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Stream.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Stream.php deleted file mode 100644 index 97de9ac0090..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Stream.php +++ /dev/null @@ -1,409 +0,0 @@ - ['r', 'r+', 'w+', 'a+', 'x+', 'c+'], - 'writable' => ['r+', 'w', 'w+', 'a', 'a+', 'x', 'x+', 'c', 'c+'], - ]; - - /** - * The underlying stream resource - * - * @var resource - */ - protected $stream; - - /** - * Stream metadata - * - * @var array - */ - protected $meta; - - /** - * Is this stream readable? - * - * @var bool - */ - protected $readable; - - /** - * Is this stream writable? - * - * @var bool - */ - protected $writable; - - /** - * Is this stream seekable? - * - * @var bool - */ - protected $seekable; - - /** - * The size of the stream if known - * - * @var null|int - */ - protected $size; - - /** - * Create a new Stream. - * - * @param resource $stream A PHP resource handle. - * - * @throws InvalidArgumentException If argument is not a resource. - */ - public function __construct($stream) - { - $this->attach($stream); - } - - /** - * Get stream metadata as an associative array or retrieve a specific key. - * - * The keys returned are identical to the keys returned from PHP's - * stream_get_meta_data() function. - * - * @link http://php.net/manual/en/function.stream-get-meta-data.php - * - * @param string $key Specific metadata to retrieve. - * - * @return array|mixed|null Returns an associative array if no key is - * provided. Returns a specific key value if a key is provided and the - * value is found, or null if the key is not found. - */ - public function getMetadata($key = null) - { - $this->meta = stream_get_meta_data($this->stream); - if (is_null($key) === true) { - return $this->meta; - } - - return isset($this->meta[$key]) ? $this->meta[$key] : null; - } - - /** - * Is a resource attached to this stream? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - protected function isAttached() - { - return is_resource($this->stream); - } - - /** - * Attach new resource to this object. - * - * Note: This method is not part of the PSR-7 standard. - * - * @param resource $newStream A PHP resource handle. - * - * @throws InvalidArgumentException If argument is not a valid PHP resource. - */ - protected function attach($newStream) - { - if (is_resource($newStream) === false) { - throw new InvalidArgumentException(__METHOD__ . ' argument must be a valid PHP resource'); - } - - if ($this->isAttached() === true) { - $this->detach(); - } - - $this->stream = $newStream; - } - - /** - * Separates any underlying resources from the stream. - * - * After the stream has been detached, the stream is in an unusable state. - * - * @return resource|null Underlying PHP stream, if any - */ - public function detach() - { - $oldResource = $this->stream; - $this->stream = null; - $this->meta = null; - $this->readable = null; - $this->writable = null; - $this->seekable = null; - $this->size = null; - - return $oldResource; - } - - /** - * Reads all data from the stream into a string, from the beginning to end. - * - * This method MUST attempt to seek to the beginning of the stream before - * reading data and read the stream until the end is reached. - * - * Warning: This could attempt to load a large amount of data into memory. - * - * This method MUST NOT raise an exception in order to conform with PHP's - * string casting operations. - * - * @see http://php.net/manual/en/language.oop5.magic.php#object.tostring - * @return string - */ - public function __toString() - { - if (!$this->isAttached()) { - return ''; - } - - try { - $this->rewind(); - return $this->getContents(); - } catch (RuntimeException $e) { - return ''; - } - } - - /** - * Closes the stream and any underlying resources. - */ - public function close() - { - if ($this->isAttached() === true) { - fclose($this->stream); - } - - $this->detach(); - } - - /** - * Get the size of the stream if known. - * - * @return int|null Returns the size in bytes if known, or null if unknown. - */ - public function getSize() - { - if (!$this->size && $this->isAttached() === true) { - $stats = fstat($this->stream); - $this->size = isset($stats['size']) ? $stats['size'] : null; - } - - return $this->size; - } - - /** - * Returns the current position of the file read/write pointer - * - * @return int Position of the file pointer - * - * @throws RuntimeException on error. - */ - public function tell() - { - if (!$this->isAttached() || ($position = ftell($this->stream)) === false) { - throw new RuntimeException('Could not get the position of the pointer in stream'); - } - - return $position; - } - - /** - * Returns true if the stream is at the end of the stream. - * - * @return bool - */ - public function eof() - { - return $this->isAttached() ? feof($this->stream) : true; - } - - /** - * Returns whether or not the stream is readable. - * - * @return bool - */ - public function isReadable() - { - if ($this->readable === null) { - $this->readable = false; - if ($this->isAttached()) { - $meta = $this->getMetadata(); - foreach (self::$modes['readable'] as $mode) { - if (strpos($meta['mode'], $mode) === 0) { - $this->readable = true; - break; - } - } - } - } - - return $this->readable; - } - - /** - * Returns whether or not the stream is writable. - * - * @return bool - */ - public function isWritable() - { - if ($this->writable === null) { - $this->writable = false; - if ($this->isAttached()) { - $meta = $this->getMetadata(); - foreach (self::$modes['writable'] as $mode) { - if (strpos($meta['mode'], $mode) === 0) { - $this->writable = true; - break; - } - } - } - } - - return $this->writable; - } - - /** - * Returns whether or not the stream is seekable. - * - * @return bool - */ - public function isSeekable() - { - if ($this->seekable === null) { - $this->seekable = false; - if ($this->isAttached()) { - $meta = $this->getMetadata(); - $this->seekable = $meta['seekable']; - } - } - - return $this->seekable; - } - - /** - * Seek to a position in the stream. - * - * @link http://www.php.net/manual/en/function.fseek.php - * - * @param int $offset Stream offset - * @param int $whence Specifies how the cursor position will be calculated - * based on the seek offset. Valid values are identical to the built-in - * PHP $whence values for `fseek()`. SEEK_SET: Set position equal to - * offset bytes SEEK_CUR: Set position to current location plus offset - * SEEK_END: Set position to end-of-stream plus offset. - * - * @throws RuntimeException on failure. - */ - public function seek($offset, $whence = SEEK_SET) - { - // Note that fseek returns 0 on success! - if (!$this->isSeekable() || fseek($this->stream, $offset, $whence) === -1) { - throw new RuntimeException('Could not seek in stream'); - } - } - - /** - * Seek to the beginning of the stream. - * - * If the stream is not seekable, this method will raise an exception; - * otherwise, it will perform a seek(0). - * - * @see seek() - * - * @link http://www.php.net/manual/en/function.fseek.php - * - * @throws RuntimeException on failure. - */ - public function rewind() - { - if (!$this->isSeekable() || rewind($this->stream) === false) { - throw new RuntimeException('Could not rewind stream'); - } - } - - /** - * Read data from the stream. - * - * @param int $length Read up to $length bytes from the object and return - * them. Fewer than $length bytes may be returned if underlying stream - * call returns fewer bytes. - * - * @return string Returns the data read from the stream, or an empty string - * if no bytes are available. - * - * @throws RuntimeException if an error occurs. - */ - public function read($length) - { - if (!$this->isReadable() || ($data = fread($this->stream, $length)) === false) { - throw new RuntimeException('Could not read from stream'); - } - - return $data; - } - - /** - * Write data to the stream. - * - * @param string $string The string that is to be written. - * - * @return int Returns the number of bytes written to the stream. - * - * @throws RuntimeException on failure. - */ - public function write($string) - { - if (!$this->isWritable() || ($written = fwrite($this->stream, $string)) === false) { - throw new RuntimeException('Could not write to stream'); - } - - // reset size so that it will be recalculated on next call to getSize() - $this->size = null; - - return $written; - } - - /** - * Returns the remaining contents in a string - * - * @return string - * - * @throws RuntimeException if unable to read or an error occurs while - * reading. - */ - public function getContents() - { - if (!$this->isReadable() || ($contents = stream_get_contents($this->stream)) === false) { - throw new RuntimeException('Could not get contents of stream'); - } - - return $contents; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/UploadedFile.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/UploadedFile.php deleted file mode 100644 index ff970277c7c..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/UploadedFile.php +++ /dev/null @@ -1,327 +0,0 @@ -has('slim.files')) { - return $env['slim.files']; - } elseif (isset($_FILES)) { - return static::parseUploadedFiles($_FILES); - } - - return []; - } - - /** - * Parse a non-normalized, i.e. $_FILES superglobal, tree of uploaded file data. - * - * @param array $uploadedFiles The non-normalized tree of uploaded file data. - * - * @return array A normalized tree of UploadedFile instances. - */ - private static function parseUploadedFiles(array $uploadedFiles) - { - $parsed = []; - foreach ($uploadedFiles as $field => $uploadedFile) { - if (!isset($uploadedFile['error'])) { - if (is_array($uploadedFile)) { - $parsed[$field] = static::parseUploadedFiles($uploadedFile); - } - continue; - } - - $parsed[$field] = []; - if (!is_array($uploadedFile['error'])) { - $parsed[$field] = new static( - $uploadedFile['tmp_name'], - isset($uploadedFile['name']) ? $uploadedFile['name'] : null, - isset($uploadedFile['type']) ? $uploadedFile['type'] : null, - isset($uploadedFile['size']) ? $uploadedFile['size'] : null, - $uploadedFile['error'], - true - ); - } else { - $subArray = []; - foreach ($uploadedFile['error'] as $fileIdx => $error) { - // normalise subarray and re-parse to move the input's keyname up a level - $subArray[$fileIdx]['name'] = $uploadedFile['name'][$fileIdx]; - $subArray[$fileIdx]['type'] = $uploadedFile['type'][$fileIdx]; - $subArray[$fileIdx]['tmp_name'] = $uploadedFile['tmp_name'][$fileIdx]; - $subArray[$fileIdx]['error'] = $uploadedFile['error'][$fileIdx]; - $subArray[$fileIdx]['size'] = $uploadedFile['size'][$fileIdx]; - - $parsed[$field] = static::parseUploadedFiles($subArray); - } - } - } - - return $parsed; - } - - /** - * Construct a new UploadedFile instance. - * - * @param string $file The full path to the uploaded file provided by the client. - * @param string|null $name The file name. - * @param string|null $type The file media type. - * @param int|null $size The file size in bytes. - * @param int $error The UPLOAD_ERR_XXX code representing the status of the upload. - * @param bool $sapi Indicates if the upload is in a SAPI environment. - */ - public function __construct($file, $name = null, $type = null, $size = null, $error = UPLOAD_ERR_OK, $sapi = false) - { - $this->file = $file; - $this->name = $name; - $this->type = $type; - $this->size = $size; - $this->error = $error; - $this->sapi = $sapi; - } - - /** - * Retrieve a stream representing the uploaded file. - * - * This method MUST return a StreamInterface instance, representing the - * uploaded file. The purpose of this method is to allow utilizing native PHP - * stream functionality to manipulate the file upload, such as - * stream_copy_to_stream() (though the result will need to be decorated in a - * native PHP stream wrapper to work with such functions). - * - * If the moveTo() method has been called previously, this method MUST raise - * an exception. - * - * @return StreamInterface Stream representation of the uploaded file. - * @throws \RuntimeException in cases when no stream is available or can be - * created. - */ - public function getStream() - { - if ($this->moved) { - throw new \RuntimeException(sprintf('Uploaded file %1s has already been moved', $this->name)); - } - if ($this->stream === null) { - $this->stream = new Stream(fopen($this->file, 'r')); - } - - return $this->stream; - } - - /** - * Move the uploaded file to a new location. - * - * Use this method as an alternative to move_uploaded_file(). This method is - * guaranteed to work in both SAPI and non-SAPI environments. - * Implementations must determine which environment they are in, and use the - * appropriate method (move_uploaded_file(), rename(), or a stream - * operation) to perform the operation. - * - * $targetPath may be an absolute path, or a relative path. If it is a - * relative path, resolution should be the same as used by PHP's rename() - * function. - * - * The original file or stream MUST be removed on completion. - * - * If this method is called more than once, any subsequent calls MUST raise - * an exception. - * - * When used in an SAPI environment where $_FILES is populated, when writing - * files via moveTo(), is_uploaded_file() and move_uploaded_file() SHOULD be - * used to ensure permissions and upload status are verified correctly. - * - * If you wish to move to a stream, use getStream(), as SAPI operations - * cannot guarantee writing to stream destinations. - * - * @see http://php.net/is_uploaded_file - * @see http://php.net/move_uploaded_file - * - * @param string $targetPath Path to which to move the uploaded file. - * - * @throws InvalidArgumentException if the $path specified is invalid. - * @throws RuntimeException on any error during the move operation, or on - * the second or subsequent call to the method. - */ - public function moveTo($targetPath) - { - if ($this->moved) { - throw new RuntimeException('Uploaded file already moved'); - } - - if (!is_writable(dirname($targetPath))) { - throw new InvalidArgumentException('Upload target path is not writable'); - } - - $targetIsStream = strpos($targetPath, '://') > 0; - if ($targetIsStream) { - if (!copy($this->file, $targetPath)) { - throw new RuntimeException(sprintf('Error moving uploaded file %1s to %2s', $this->name, $targetPath)); - } - if (!unlink($this->file)) { - throw new RuntimeException(sprintf('Error removing uploaded file %1s', $this->name)); - } - } elseif ($this->sapi) { - if (!is_uploaded_file($this->file)) { - throw new RuntimeException(sprintf('%1s is not a valid uploaded file', $this->file)); - } - - if (!move_uploaded_file($this->file, $targetPath)) { - throw new RuntimeException(sprintf('Error moving uploaded file %1s to %2s', $this->name, $targetPath)); - } - } else { - if (!rename($this->file, $targetPath)) { - throw new RuntimeException(sprintf('Error moving uploaded file %1s to %2s', $this->name, $targetPath)); - } - } - - $this->moved = true; - } - - /** - * Retrieve the error associated with the uploaded file. - * - * The return value MUST be one of PHP's UPLOAD_ERR_XXX constants. - * - * If the file was uploaded successfully, this method MUST return - * UPLOAD_ERR_OK. - * - * Implementations SHOULD return the value stored in the "error" key of - * the file in the $_FILES array. - * - * @see http://php.net/manual/en/features.file-upload.errors.php - * - * @return int One of PHP's UPLOAD_ERR_XXX constants. - */ - public function getError() - { - return $this->error; - } - - /** - * Retrieve the filename sent by the client. - * - * Do not trust the value returned by this method. A client could send - * a malicious filename with the intention to corrupt or hack your - * application. - * - * Implementations SHOULD return the value stored in the "name" key of - * the file in the $_FILES array. - * - * @return string|null The filename sent by the client or null if none - * was provided. - */ - public function getClientFilename() - { - return $this->name; - } - - /** - * Retrieve the media type sent by the client. - * - * Do not trust the value returned by this method. A client could send - * a malicious media type with the intention to corrupt or hack your - * application. - * - * Implementations SHOULD return the value stored in the "type" key of - * the file in the $_FILES array. - * - * @return string|null The media type sent by the client or null if none - * was provided. - */ - public function getClientMediaType() - { - return $this->type; - } - - /** - * Retrieve the file size. - * - * Implementations SHOULD return the value stored in the "size" key of - * the file in the $_FILES array if available, as PHP calculates this based - * on the actual size transmitted. - * - * @return int|null The file size in bytes or null if unknown. - */ - public function getSize() - { - return $this->size; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Uri.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Uri.php deleted file mode 100644 index 27b1d0d5938..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Http/Uri.php +++ /dev/null @@ -1,821 +0,0 @@ -scheme = $this->filterScheme($scheme); - $this->host = $host; - $this->port = $this->filterPort($port); - $this->path = empty($path) ? '/' : $this->filterPath($path); - $this->query = $this->filterQuery($query); - $this->fragment = $this->filterQuery($fragment); - $this->user = $user; - $this->password = $password; - } - - /** - * Create new Uri from string. - * - * @param string $uri Complete Uri string - * (i.e., https://user:pass@host:443/path?query). - * - * @return self - */ - public static function createFromString($uri) - { - if (!is_string($uri) && !method_exists($uri, '__toString')) { - throw new InvalidArgumentException('Uri must be a string'); - } - - $parts = parse_url($uri); - $scheme = isset($parts['scheme']) ? $parts['scheme'] : ''; - $user = isset($parts['user']) ? $parts['user'] : ''; - $pass = isset($parts['pass']) ? $parts['pass'] : ''; - $host = isset($parts['host']) ? $parts['host'] : ''; - $port = isset($parts['port']) ? $parts['port'] : null; - $path = isset($parts['path']) ? $parts['path'] : ''; - $query = isset($parts['query']) ? $parts['query'] : ''; - $fragment = isset($parts['fragment']) ? $parts['fragment'] : ''; - - return new static($scheme, $host, $port, $path, $query, $fragment, $user, $pass); - } - - /** - * Create new Uri from environment. - * - * @param Environment $env - * - * @return self - */ - public static function createFromEnvironment(Environment $env) - { - // Scheme - $isSecure = $env->get('HTTPS'); - $scheme = (empty($isSecure) || $isSecure === 'off') ? 'http' : 'https'; - - // Authority: Username and password - $username = $env->get('PHP_AUTH_USER', ''); - $password = $env->get('PHP_AUTH_PW', ''); - - // Authority: Host - if ($env->has('HTTP_HOST')) { - $host = $env->get('HTTP_HOST'); - } else { - $host = $env->get('SERVER_NAME'); - } - - // Authority: Port - $port = (int)$env->get('SERVER_PORT', 80); - if (preg_match('/^(\[[a-fA-F0-9:.]+\])(:\d+)?\z/', $host, $matches)) { - $host = $matches[1]; - - if ($matches[2]) { - $port = (int) substr($matches[2], 1); - } - } else { - $pos = strpos($host, ':'); - if ($pos !== false) { - $port = (int) substr($host, $pos + 1); - $host = strstr($host, ':', true); - } - } - - // Path - $requestScriptName = parse_url($env->get('SCRIPT_NAME'), PHP_URL_PATH); - $requestScriptDir = dirname($requestScriptName); - - // parse_url() requires a full URL. As we don't extract the domain name or scheme, - // we use a stand-in. - $requestUri = parse_url('http://example.com' . $env->get('REQUEST_URI'), PHP_URL_PATH); - - $basePath = ''; - $virtualPath = $requestUri; - if (stripos($requestUri, $requestScriptName) === 0) { - $basePath = $requestScriptName; - } elseif ($requestScriptDir !== '/' && stripos($requestUri, $requestScriptDir) === 0) { - $basePath = $requestScriptDir; - } - - if ($basePath) { - $virtualPath = ltrim(substr($requestUri, strlen($basePath)), '/'); - } - - // Query string - $queryString = $env->get('QUERY_STRING', ''); - - // Fragment - $fragment = ''; - - // Build Uri - $uri = new static($scheme, $host, $port, $virtualPath, $queryString, $fragment, $username, $password); - if ($basePath) { - $uri = $uri->withBasePath($basePath); - } - - return $uri; - } - - /******************************************************************************** - * Scheme - *******************************************************************************/ - - /** - * Retrieve the scheme component of the URI. - * - * If no scheme is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.1. - * - * The trailing ":" character is not part of the scheme and MUST NOT be - * added. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.1 - * @return string The URI scheme. - */ - public function getScheme() - { - return $this->scheme; - } - - /** - * Return an instance with the specified scheme. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified scheme. - * - * Implementations MUST support the schemes "http" and "https" case - * insensitively, and MAY accommodate other schemes if required. - * - * An empty scheme is equivalent to removing the scheme. - * - * @param string $scheme The scheme to use with the new instance. - * @return self A new instance with the specified scheme. - * @throws \InvalidArgumentException for invalid or unsupported schemes. - */ - public function withScheme($scheme) - { - $scheme = $this->filterScheme($scheme); - $clone = clone $this; - $clone->scheme = $scheme; - - return $clone; - } - - /** - * Filter Uri scheme. - * - * @param string $scheme Raw Uri scheme. - * @return string - * - * @throws InvalidArgumentException If the Uri scheme is not a string. - * @throws InvalidArgumentException If Uri scheme is not "", "https", or "http". - */ - protected function filterScheme($scheme) - { - static $valid = [ - '' => true, - 'https' => true, - 'http' => true, - ]; - - if (!is_string($scheme) && !method_exists($scheme, '__toString')) { - throw new InvalidArgumentException('Uri scheme must be a string'); - } - - $scheme = str_replace('://', '', strtolower((string)$scheme)); - if (!isset($valid[$scheme])) { - throw new InvalidArgumentException('Uri scheme must be one of: "", "https", "http"'); - } - - return $scheme; - } - - /******************************************************************************** - * Authority - *******************************************************************************/ - - /** - * Retrieve the authority component of the URI. - * - * If no authority information is present, this method MUST return an empty - * string. - * - * The authority syntax of the URI is: - * - *
-     * [user-info@]host[:port]
-     * 
- * - * If the port component is not set or is the standard port for the current - * scheme, it SHOULD NOT be included. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.2 - * @return string The URI authority, in "[user-info@]host[:port]" format. - */ - public function getAuthority() - { - $userInfo = $this->getUserInfo(); - $host = $this->getHost(); - $port = $this->getPort(); - - return ($userInfo ? $userInfo . '@' : '') . $host . ($port !== null ? ':' . $port : ''); - } - - /** - * Retrieve the user information component of the URI. - * - * If no user information is present, this method MUST return an empty - * string. - * - * If a user is present in the URI, this will return that value; - * additionally, if the password is also present, it will be appended to the - * user value, with a colon (":") separating the values. - * - * The trailing "@" character is not part of the user information and MUST - * NOT be added. - * - * @return string The URI user information, in "username[:password]" format. - */ - public function getUserInfo() - { - return $this->user . ($this->password ? ':' . $this->password : ''); - } - - /** - * Return an instance with the specified user information. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified user information. - * - * Password is optional, but the user information MUST include the - * user; an empty string for the user is equivalent to removing user - * information. - * - * @param string $user The user name to use for authority. - * @param null|string $password The password associated with $user. - * @return self A new instance with the specified user information. - */ - public function withUserInfo($user, $password = null) - { - $clone = clone $this; - $clone->user = $user; - $clone->password = $password ? $password : ''; - - return $clone; - } - - /** - * Retrieve the host component of the URI. - * - * If no host is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.2.2. - * - * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 - * @return string The URI host. - */ - public function getHost() - { - return $this->host; - } - - /** - * Return an instance with the specified host. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified host. - * - * An empty host value is equivalent to removing the host. - * - * @param string $host The hostname to use with the new instance. - * @return self A new instance with the specified host. - * @throws \InvalidArgumentException for invalid hostnames. - */ - public function withHost($host) - { - $clone = clone $this; - $clone->host = $host; - - return $clone; - } - - /** - * Retrieve the port component of the URI. - * - * If a port is present, and it is non-standard for the current scheme, - * this method MUST return it as an integer. If the port is the standard port - * used with the current scheme, this method SHOULD return null. - * - * If no port is present, and no scheme is present, this method MUST return - * a null value. - * - * If no port is present, but a scheme is present, this method MAY return - * the standard port for that scheme, but SHOULD return null. - * - * @return null|int The URI port. - */ - public function getPort() - { - return $this->port && !$this->hasStandardPort() ? $this->port : null; - } - - /** - * Return an instance with the specified port. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified port. - * - * Implementations MUST raise an exception for ports outside the - * established TCP and UDP port ranges. - * - * A null value provided for the port is equivalent to removing the port - * information. - * - * @param null|int $port The port to use with the new instance; a null value - * removes the port information. - * @return self A new instance with the specified port. - * @throws \InvalidArgumentException for invalid ports. - */ - public function withPort($port) - { - $port = $this->filterPort($port); - $clone = clone $this; - $clone->port = $port; - - return $clone; - } - - /** - * Does this Uri use a standard port? - * - * @return bool - */ - protected function hasStandardPort() - { - return ($this->scheme === 'http' && $this->port === 80) || ($this->scheme === 'https' && $this->port === 443); - } - - /** - * Filter Uri port. - * - * @param null|int $port The Uri port number. - * @return null|int - * - * @throws InvalidArgumentException If the port is invalid. - */ - protected function filterPort($port) - { - if (is_null($port) || (is_integer($port) && ($port >= 1 && $port <= 65535))) { - return $port; - } - - throw new InvalidArgumentException('Uri port must be null or an integer between 1 and 65535 (inclusive)'); - } - - /******************************************************************************** - * Path - *******************************************************************************/ - - /** - * Retrieve the path component of the URI. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * Normally, the empty path "" and absolute path "/" are considered equal as - * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically - * do this normalization because in contexts with a trimmed base path, e.g. - * the front controller, this difference becomes significant. It's the task - * of the user to handle both "" and "/". - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.3. - * - * As an example, if the value should include a slash ("/") not intended as - * delimiter between path segments, that value MUST be passed in encoded - * form (e.g., "%2F") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.3 - * @return string The URI path. - */ - public function getPath() - { - return $this->path; - } - - /** - * Return an instance with the specified path. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified path. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * If the path is intended to be domain-relative rather than path relative then - * it must begin with a slash ("/"). Paths not starting with a slash ("/") - * are assumed to be relative to some base path known to the application or - * consumer. - * - * Users can provide both encoded and decoded path characters. - * Implementations ensure the correct encoding as outlined in getPath(). - * - * @param string $path The path to use with the new instance. - * @return self A new instance with the specified path. - * @throws \InvalidArgumentException for invalid paths. - */ - public function withPath($path) - { - if (!is_string($path)) { - throw new InvalidArgumentException('Uri path must be a string'); - } - - $clone = clone $this; - $clone->path = $this->filterPath($path); - - // if the path is absolute, then clear basePath - if (substr($path, 0, 1) == '/') { - $clone->basePath = ''; - } - - return $clone; - } - - /** - * Retrieve the base path segment of the URI. - * - * Note: This method is not part of the PSR-7 standard. - * - * This method MUST return a string; if no path is present it MUST return - * an empty string. - * - * @return string The base path segment of the URI. - */ - public function getBasePath() - { - return $this->basePath; - } - - /** - * Set base path. - * - * Note: This method is not part of the PSR-7 standard. - * - * @param string $basePath - * @return self - */ - public function withBasePath($basePath) - { - if (!is_string($basePath)) { - throw new InvalidArgumentException('Uri path must be a string'); - } - if (!empty($basePath)) { - $basePath = '/' . trim($basePath, '/'); // <-- Trim on both sides - } - $clone = clone $this; - - if ($basePath !== '/') { - $clone->basePath = $this->filterPath($basePath); - } - - return $clone; - } - - /** - * Filter Uri path. - * - * This method percent-encodes all reserved - * characters in the provided path string. This method - * will NOT double-encode characters that are already - * percent-encoded. - * - * @param string $path The raw uri path. - * @return string The RFC 3986 percent-encoded uri path. - * @link http://www.faqs.org/rfcs/rfc3986.html - */ - protected function filterPath($path) - { - return preg_replace_callback( - '/(?:[^a-zA-Z0-9_\-\.~:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/', - function ($match) { - return rawurlencode($match[0]); - }, - $path - ); - } - - /******************************************************************************** - * Query - *******************************************************************************/ - - /** - * Retrieve the query string of the URI. - * - * If no query string is present, this method MUST return an empty string. - * - * The leading "?" character is not part of the query and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.4. - * - * As an example, if a value in a key/value pair of the query string should - * include an ampersand ("&") not intended as a delimiter between values, - * that value MUST be passed in encoded form (e.g., "%26") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.4 - * @return string The URI query string. - */ - public function getQuery() - { - return $this->query; - } - - /** - * Return an instance with the specified query string. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified query string. - * - * Users can provide both encoded and decoded query characters. - * Implementations ensure the correct encoding as outlined in getQuery(). - * - * An empty query string value is equivalent to removing the query string. - * - * @param string $query The query string to use with the new instance. - * @return self A new instance with the specified query string. - * @throws \InvalidArgumentException for invalid query strings. - */ - public function withQuery($query) - { - if (!is_string($query) && !method_exists($query, '__toString')) { - throw new InvalidArgumentException('Uri query must be a string'); - } - $query = ltrim((string)$query, '?'); - $clone = clone $this; - $clone->query = $this->filterQuery($query); - - return $clone; - } - - /** - * Filters the query string or fragment of a URI. - * - * @param string $query The raw uri query string. - * @return string The percent-encoded query string. - */ - protected function filterQuery($query) - { - return preg_replace_callback( - '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/', - function ($match) { - return rawurlencode($match[0]); - }, - $query - ); - } - - /******************************************************************************** - * Fragment - *******************************************************************************/ - - /** - * Retrieve the fragment component of the URI. - * - * If no fragment is present, this method MUST return an empty string. - * - * The leading "#" character is not part of the fragment and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.5. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.5 - * @return string The URI fragment. - */ - public function getFragment() - { - return $this->fragment; - } - - /** - * Return an instance with the specified URI fragment. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified URI fragment. - * - * Users can provide both encoded and decoded fragment characters. - * Implementations ensure the correct encoding as outlined in getFragment(). - * - * An empty fragment value is equivalent to removing the fragment. - * - * @param string $fragment The fragment to use with the new instance. - * @return self A new instance with the specified fragment. - */ - public function withFragment($fragment) - { - if (!is_string($fragment) && !method_exists($fragment, '__toString')) { - throw new InvalidArgumentException('Uri fragment must be a string'); - } - $fragment = ltrim((string)$fragment, '#'); - $clone = clone $this; - $clone->fragment = $this->filterQuery($fragment); - - return $clone; - } - - /******************************************************************************** - * Helpers - *******************************************************************************/ - - /** - * Return the string representation as a URI reference. - * - * Depending on which components of the URI are present, the resulting - * string is either a full URI or relative reference according to RFC 3986, - * Section 4.1. The method concatenates the various components of the URI, - * using the appropriate delimiters: - * - * - If a scheme is present, it MUST be suffixed by ":". - * - If an authority is present, it MUST be prefixed by "//". - * - The path can be concatenated without delimiters. But there are two - * cases where the path has to be adjusted to make the URI reference - * valid as PHP does not allow to throw an exception in __toString(): - * - If the path is rootless and an authority is present, the path MUST - * be prefixed by "/". - * - If the path is starting with more than one "/" and no authority is - * present, the starting slashes MUST be reduced to one. - * - If a query is present, it MUST be prefixed by "?". - * - If a fragment is present, it MUST be prefixed by "#". - * - * @see http://tools.ietf.org/html/rfc3986#section-4.1 - * @return string - */ - public function __toString() - { - $scheme = $this->getScheme(); - $authority = $this->getAuthority(); - $basePath = $this->getBasePath(); - $path = $this->getPath(); - $query = $this->getQuery(); - $fragment = $this->getFragment(); - - $path = $basePath . '/' . ltrim($path, '/'); - - return ($scheme ? $scheme . ':' : '') - . ($authority ? '//' . $authority : '') - . $path - . ($query ? '?' . $query : '') - . ($fragment ? '#' . $fragment : ''); - } - - /** - * Return the fully qualified base URL. - * - * Note that this method never includes a trailing / - * - * This method is not part of PSR-7. - * - * @return string - */ - public function getBaseUrl() - { - $scheme = $this->getScheme(); - $authority = $this->getAuthority(); - $basePath = $this->getBasePath(); - - if ($authority && substr($basePath, 0, 1) !== '/') { - $basePath = $basePath . '/' . $basePath; - } - - return ($scheme ? $scheme . ':' : '') - . ($authority ? '//' . $authority : '') - . rtrim($basePath, '/'); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Interfaces/CallableResolverInterface.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Interfaces/CallableResolverInterface.php deleted file mode 100644 index 9bde59ac97a..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Interfaces/CallableResolverInterface.php +++ /dev/null @@ -1,27 +0,0 @@ -middlewareLock) { - throw new RuntimeException('Middleware can’t be added once the stack is dequeuing'); - } - - if (is_null($this->stack)) { - $this->seedMiddlewareStack(); - } - $next = $this->stack->top(); - $this->stack[] = function (ServerRequestInterface $req, ResponseInterface $res) use ($callable, $next) { - $result = call_user_func($callable, $req, $res, $next); - if ($result instanceof ResponseInterface === false) { - throw new UnexpectedValueException( - 'Middleware must return instance of \Psr\Http\Message\ResponseInterface' - ); - } - - return $result; - }; - - return $this; - } - - /** - * Seed middleware stack with first callable - * - * @param callable $kernel The last item to run as middleware - * - * @throws RuntimeException if the stack is seeded more than once - */ - protected function seedMiddlewareStack(callable $kernel = null) - { - if (!is_null($this->stack)) { - throw new RuntimeException('MiddlewareStack can only be seeded once.'); - } - if ($kernel === null) { - $kernel = $this; - } - $this->stack = new SplStack; - $this->stack->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO | SplDoublyLinkedList::IT_MODE_KEEP); - $this->stack[] = $kernel; - } - - /** - * Call middleware stack - * - * @param ServerRequestInterface $req A request object - * @param ResponseInterface $res A response object - * - * @return ResponseInterface - */ - public function callMiddlewareStack(ServerRequestInterface $req, ResponseInterface $res) - { - if (is_null($this->stack)) { - $this->seedMiddlewareStack(); - } - /** @var callable $start */ - $start = $this->stack->top(); - $this->middlewareLock = true; - $resp = $start($req, $res); - $this->middlewareLock = false; - return $resp; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Routable.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Routable.php deleted file mode 100644 index 4a6759fac46..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Routable.php +++ /dev/null @@ -1,106 +0,0 @@ -middleware; - } - - /** - * Get the route pattern - * - * @return string - */ - public function getPattern() - { - return $this->pattern; - } - - /** - * Set container for use with resolveCallable - * - * @param ContainerInterface $container - * - * @return self - */ - public function setContainer(ContainerInterface $container) - { - $this->container = $container; - return $this; - } - - /** - * Prepend middleware to the middleware collection - * - * @param callable|string $callable The callback routine - * - * @return static - */ - public function add($callable) - { - $this->middleware[] = new DeferredCallable($callable, $this->container); - return $this; - } - - /** - * Set the route pattern - * - * @set string - */ - public function setPattern($newPattern) - { - $this->pattern = $newPattern; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Route.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Route.php deleted file mode 100644 index 3cb4a0e28b4..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Route.php +++ /dev/null @@ -1,357 +0,0 @@ -methods = $methods; - $this->pattern = $pattern; - $this->callable = $callable; - $this->groups = $groups; - $this->identifier = 'route' . $identifier; - } - - /** - * Finalize the route in preparation for dispatching - */ - public function finalize() - { - if ($this->finalized) { - return; - } - - $groupMiddleware = []; - foreach ($this->getGroups() as $group) { - $groupMiddleware = array_merge($group->getMiddleware(), $groupMiddleware); - } - - $this->middleware = array_merge($this->middleware, $groupMiddleware); - - foreach ($this->getMiddleware() as $middleware) { - $this->addMiddleware($middleware); - } - - $this->finalized = true; - } - - /** - * Get route callable - * - * @return callable - */ - public function getCallable() - { - return $this->callable; - } - - /** - * Get route methods - * - * @return string[] - */ - public function getMethods() - { - return $this->methods; - } - - /** - * Get parent route groups - * - * @return RouteGroup[] - */ - public function getGroups() - { - return $this->groups; - } - - /** - * Get route name - * - * @return null|string - */ - public function getName() - { - return $this->name; - } - - /** - * Get route identifier - * - * @return string - */ - public function getIdentifier() - { - return $this->identifier; - } - - /** - * Get output buffering mode - * - * @return boolean|string - */ - public function getOutputBuffering() - { - return $this->outputBuffering; - } - - /** - * Set output buffering mode - * - * One of: false, 'prepend' or 'append' - * - * @param boolean|string $mode - * - * @throws InvalidArgumentException If an unknown buffering mode is specified - */ - public function setOutputBuffering($mode) - { - if (!in_array($mode, [false, 'prepend', 'append'], true)) { - throw new InvalidArgumentException('Unknown output buffering mode'); - } - $this->outputBuffering = $mode; - } - - /** - * Set route name - * - * @param string $name - * - * @return self - * - * @throws InvalidArgumentException if the route name is not a string - */ - public function setName($name) - { - if (!is_string($name)) { - throw new InvalidArgumentException('Route name must be a string'); - } - $this->name = $name; - return $this; - } - - /** - * Set a route argument - * - * @param string $name - * @param string $value - * - * @return self - */ - public function setArgument($name, $value) - { - $this->arguments[$name] = $value; - return $this; - } - - /** - * Replace route arguments - * - * @param array $arguments - * - * @return self - */ - public function setArguments(array $arguments) - { - $this->arguments = $arguments; - return $this; - } - - /** - * Retrieve route arguments - * - * @return array - */ - public function getArguments() - { - return $this->arguments; - } - - /** - * Retrieve a specific route argument - * - * @param string $name - * @param mixed $default - * - * @return mixed - */ - public function getArgument($name, $default = null) - { - if (array_key_exists($name, $this->arguments)) { - return $this->arguments[$name]; - } - return $default; - } - - /******************************************************************************** - * Route Runner - *******************************************************************************/ - - /** - * Prepare the route for use - * - * @param ServerRequestInterface $request - * @param array $arguments - */ - public function prepare(ServerRequestInterface $request, array $arguments) - { - // Add the arguments - foreach ($arguments as $k => $v) { - $this->setArgument($k, $v); - } - } - - /** - * Run route - * - * This method traverses the middleware stack, including the route's callable - * and captures the resultant HTTP response object. It then sends the response - * back to the Application. - * - * @param ServerRequestInterface $request - * @param ResponseInterface $response - * - * @return ResponseInterface - */ - public function run(ServerRequestInterface $request, ResponseInterface $response) - { - // Finalise route now that we are about to run it - $this->finalize(); - - // Traverse middleware stack and fetch updated response - return $this->callMiddlewareStack($request, $response); - } - - /** - * Dispatch route callable against current Request and Response objects - * - * This method invokes the route object's callable. If middleware is - * registered for the route, each callable middleware is invoked in - * the order specified. - * - * @param ServerRequestInterface $request The current Request object - * @param ResponseInterface $response The current Response object - * @return \Psr\Http\Message\ResponseInterface - * @throws \Exception if the route callable throws an exception - */ - public function __invoke(ServerRequestInterface $request, ResponseInterface $response) - { - $this->callable = $this->resolveCallable($this->callable); - - /** @var InvocationStrategyInterface $handler */ - $handler = isset($this->container) ? $this->container->get('foundHandler') : new RequestResponse(); - - // invoke route callable - if ($this->outputBuffering === false) { - $newResponse = $handler($this->callable, $request, $response, $this->arguments); - } else { - try { - ob_start(); - $newResponse = $handler($this->callable, $request, $response, $this->arguments); - $output = ob_get_clean(); - } catch (Exception $e) { - ob_end_clean(); - throw $e; - } - } - - if ($newResponse instanceof ResponseInterface) { - // if route callback returns a ResponseInterface, then use it - $response = $newResponse; - } elseif (is_string($newResponse)) { - // if route callback returns a string, then append it to the response - if ($response->getBody()->isWritable()) { - $response->getBody()->write($newResponse); - } - } - - if (!empty($output) && $response->getBody()->isWritable()) { - if ($this->outputBuffering === 'prepend') { - // prepend output buffer content - $body = new Http\Body(fopen('php://temp', 'r+')); - $body->write($output . $response->getBody()); - $response = $response->withBody($body); - } elseif ($this->outputBuffering === 'append') { - // append output buffer content - $response->getBody()->write($output); - } - } - - return $response; - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/RouteGroup.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/RouteGroup.php deleted file mode 100644 index a0cdf4d47d8..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/RouteGroup.php +++ /dev/null @@ -1,47 +0,0 @@ -pattern = $pattern; - $this->callable = $callable; - } - - /** - * Invoke the group to register any Routable objects within it. - * - * @param App $app The App to bind the callable to. - */ - public function __invoke(App $app = null) - { - $callable = $this->resolveCallable($this->callable); - if ($callable instanceof Closure && $app !== null) { - $callable = $callable->bindTo($app); - } - - $callable(); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Router.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Router.php deleted file mode 100644 index b9d5d132ab2..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/Slim/Router.php +++ /dev/null @@ -1,421 +0,0 @@ -routeParser = $parser ?: new StdParser; - } - - /** - * Set the base path used in pathFor() - * - * @param string $basePath - * - * @return self - */ - public function setBasePath($basePath) - { - if (!is_string($basePath)) { - throw new InvalidArgumentException('Router basePath must be a string'); - } - - $this->basePath = $basePath; - - return $this; - } - - /** - * Set path to fast route cache file. If this is false then route caching is disabled. - * - * @param string|false $cacheFile - * - * @return self - */ - public function setCacheFile($cacheFile) - { - if (!is_string($cacheFile) && $cacheFile !== false) { - throw new InvalidArgumentException('Router cacheFile must be a string or false'); - } - - $this->cacheFile = $cacheFile; - - if ($cacheFile !== false && !is_writable(dirname($cacheFile))) { - throw new RuntimeException('Router cacheFile directory must be writable'); - } - - - return $this; - } - - /** - * Add route - * - * @param string[] $methods Array of HTTP methods - * @param string $pattern The route pattern - * @param callable $handler The route callable - * - * @return RouteInterface - * - * @throws InvalidArgumentException if the route pattern isn't a string - */ - public function map($methods, $pattern, $handler) - { - if (!is_string($pattern)) { - throw new InvalidArgumentException('Route pattern must be a string'); - } - - // Prepend parent group pattern(s) - if ($this->routeGroups) { - $pattern = $this->processGroups() . $pattern; - } - - // According to RFC methods are defined in uppercase (See RFC 7231) - $methods = array_map("strtoupper", $methods); - - // Add route - $route = new Route($methods, $pattern, $handler, $this->routeGroups, $this->routeCounter); - $this->routes[$route->getIdentifier()] = $route; - $this->routeCounter++; - - return $route; - } - - /** - * Dispatch router for HTTP request - * - * @param ServerRequestInterface $request The current HTTP request object - * - * @return array - * - * @link https://github.com/nikic/FastRoute/blob/master/src/Dispatcher.php - */ - public function dispatch(ServerRequestInterface $request) - { - $uri = '/' . ltrim($request->getUri()->getPath(), '/'); - - return $this->createDispatcher()->dispatch( - $request->getMethod(), - $uri - ); - } - - /** - * @return \FastRoute\Dispatcher - */ - protected function createDispatcher() - { - if ($this->dispatcher) { - return $this->dispatcher; - } - - $routeDefinitionCallback = function (RouteCollector $r) { - foreach ($this->getRoutes() as $route) { - $r->addRoute($route->getMethods(), $route->getPattern(), $route->getIdentifier()); - } - }; - - if ($this->cacheFile) { - $this->dispatcher = \FastRoute\cachedDispatcher($routeDefinitionCallback, [ - 'routeParser' => $this->routeParser, - 'cacheFile' => $this->cacheFile, - ]); - } else { - $this->dispatcher = \FastRoute\simpleDispatcher($routeDefinitionCallback, [ - 'routeParser' => $this->routeParser, - ]); - } - - return $this->dispatcher; - } - - /** - * @param \FastRoute\Dispatcher $dispatcher - */ - public function setDispatcher(Dispatcher $dispatcher) - { - $this->dispatcher = $dispatcher; - } - - /** - * Get route objects - * - * @return Route[] - */ - public function getRoutes() - { - return $this->routes; - } - - /** - * Get named route object - * - * @param string $name Route name - * - * @return Route - * - * @throws RuntimeException If named route does not exist - */ - public function getNamedRoute($name) - { - foreach ($this->routes as $route) { - if ($name == $route->getName()) { - return $route; - } - } - throw new RuntimeException('Named route does not exist for name: ' . $name); - } - - /** - * Remove named route - * - * @param string $name Route name - * - * @throws RuntimeException If named route does not exist - */ - public function removeNamedRoute($name) - { - $route = $this->getNamedRoute($name); - - // no exception, route exists, now remove by id - unset($this->routes[$route->getIdentifier()]); - } - - /** - * Process route groups - * - * @return string A group pattern to prefix routes with - */ - protected function processGroups() - { - $pattern = ""; - foreach ($this->routeGroups as $group) { - $pattern .= $group->getPattern(); - } - return $pattern; - } - - /** - * Add a route group to the array - * - * @param string $pattern - * @param callable $callable - * - * @return RouteGroupInterface - */ - public function pushGroup($pattern, $callable) - { - $group = new RouteGroup($pattern, $callable); - array_push($this->routeGroups, $group); - return $group; - } - - /** - * Removes the last route group from the array - * - * @return RouteGroup|bool The RouteGroup if successful, else False - */ - public function popGroup() - { - $group = array_pop($this->routeGroups); - return $group instanceof RouteGroup ? $group : false; - } - - /** - * @param $identifier - * @return \Slim\Interfaces\RouteInterface - */ - public function lookupRoute($identifier) - { - if (!isset($this->routes[$identifier])) { - throw new RuntimeException('Route not found, looks like your route cache is stale.'); - } - return $this->routes[$identifier]; - } - - /** - * Build the path for a named route excluding the base path - * - * @param string $name Route name - * @param array $data Named argument replacement data - * @param array $queryParams Optional query string parameters - * - * @return string - * - * @throws RuntimeException If named route does not exist - * @throws InvalidArgumentException If required data not provided - */ - public function relativePathFor($name, array $data = [], array $queryParams = []) - { - $route = $this->getNamedRoute($name); - $pattern = $route->getPattern(); - - $routeDatas = $this->routeParser->parse($pattern); - // $routeDatas is an array of all possible routes that can be made. There is - // one routedata for each optional parameter plus one for no optional parameters. - // - // The most specific is last, so we look for that first. - $routeDatas = array_reverse($routeDatas); - - $segments = []; - foreach ($routeDatas as $routeData) { - foreach ($routeData as $item) { - if (is_string($item)) { - // this segment is a static string - $segments[] = $item; - continue; - } - - // This segment has a parameter: first element is the name - if (!array_key_exists($item[0], $data)) { - // we don't have a data element for this segment: cancel - // testing this routeData item, so that we can try a less - // specific routeData item. - $segments = []; - $segmentName = $item[0]; - break; - } - $segments[] = $data[$item[0]]; - } - if (!empty($segments)) { - // we found all the parameters for this route data, no need to check - // less specific ones - break; - } - } - - if (empty($segments)) { - throw new InvalidArgumentException('Missing data for URL segment: ' . $segmentName); - } - $url = implode('', $segments); - - if ($queryParams) { - $url .= '?' . http_build_query($queryParams); - } - - return $url; - } - - - /** - * Build the path for a named route including the base path - * - * @param string $name Route name - * @param array $data Named argument replacement data - * @param array $queryParams Optional query string parameters - * - * @return string - * - * @throws RuntimeException If named route does not exist - * @throws InvalidArgumentException If required data not provided - */ - public function pathFor($name, array $data = [], array $queryParams = []) - { - $url = $this->relativePathFor($name, $data, $queryParams); - - if ($this->basePath) { - $url = $this->basePath . $url; - } - - return $url; - } - - /** - * Build the path for a named route. - * - * This method is deprecated. Use pathFor() from now on. - * - * @param string $name Route name - * @param array $data Named argument replacement data - * @param array $queryParams Optional query string parameters - * - * @return string - * - * @throws RuntimeException If named route does not exist - * @throws InvalidArgumentException If required data not provided - */ - public function urlFor($name, array $data = [], array $queryParams = []) - { - trigger_error('urlFor() is deprecated. Use pathFor() instead.', E_USER_DEPRECATED); - return $this->pathFor($name, $data, $queryParams); - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/composer.json b/samples/server/petstore-security-test/slim/vendor/slim/slim/composer.json deleted file mode 100644 index 808eb9d3857..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/composer.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "slim/slim", - "type": "library", - "description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs", - "keywords": ["framework","micro","api","router"], - "homepage": "http://slimframework.com", - "license": "MIT", - "authors": [ - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "https://joshlockhart.com" - }, - { - "name": "Andrew Smith", - "email": "a.smith@silentworks.co.uk", - "homepage": "http://silentworks.co.uk" - }, - { - "name": "Rob Allen", - "email": "rob@akrabat.com", - "homepage": "http://akrabat.com" - }, - { - "name": "Gabriel Manricks", - "email": "gmanricks@me.com", - "homepage": "http://gabrielmanricks.com" - } - ], - "require": { - "php": ">=5.5.0", - "pimple/pimple": "^3.0", - "psr/http-message": "^1.0", - "nikic/fast-route": "^1.0", - "container-interop/container-interop": "^1.1" - }, - "require-dev": { - "squizlabs/php_codesniffer": "^2.5", - "phpunit/phpunit": "^4.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "autoload": { - "psr-4": { - "Slim\\": "Slim" - } - }, - "scripts": { - "test": [ - "@phpunit", - "@phpcs" - ], - "phpunit": "php vendor/bin/phpunit", - "phpcs": "php vendor/bin/phpcs" - } -} diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/example/.htaccess b/samples/server/petstore-security-test/slim/vendor/slim/slim/example/.htaccess deleted file mode 100644 index 0784bd22014..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/example/.htaccess +++ /dev/null @@ -1,12 +0,0 @@ -# Note: see https://httpd.apache.org/docs/current/howto/htaccess.html: -# -# "You should avoid using .htaccess files completely if you have access to -# httpd main server config file. Using .htaccess files slows down your Apache -# http server. Any directive that you can include in a .htaccess file is -# better set in a Directory block, as it will have the same effect with -# better performance." - -RewriteEngine On -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule ^ index.php [QSA,L] diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/example/README.md b/samples/server/petstore-security-test/slim/vendor/slim/slim/example/README.md deleted file mode 100644 index e4fb35982c2..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/example/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Slim example - -1. Install composer - - ```text - $ cd Slim - $ composer install - ``` - -2. Run php server - - ```text - $ cd Slim - $ php -S localhost:8888 -t example example/index.php - ``` - -3. Open browser - - Open http://localhost:8888 in your browser and you will see 'Welcome to Slim!' diff --git a/samples/server/petstore-security-test/slim/vendor/slim/slim/example/index.php b/samples/server/petstore-security-test/slim/vendor/slim/slim/example/index.php deleted file mode 100644 index ef895f83f93..00000000000 --- a/samples/server/petstore-security-test/slim/vendor/slim/slim/example/index.php +++ /dev/null @@ -1,45 +0,0 @@ -get('/', function ($request, $response, $args) { - $response->write("Welcome to Slim!"); - return $response; -}); - -$app->get('/hello[/{name}]', function ($request, $response, $args) { - $response->write("Hello, " . $args['name']); - return $response; -})->setArgument('name', 'World!'); - -/** - * Step 4: Run the Slim application - * - * This method should be called last. This executes the Slim application - * and returns the HTTP response to the HTTP client. - */ -$app->run(); diff --git a/samples/server/petstore/php-slim/.gitignore b/samples/server/petstore/php-slim/.gitignore new file mode 100644 index 00000000000..9ff0a17ae5c --- /dev/null +++ b/samples/server/petstore/php-slim/.gitignore @@ -0,0 +1,6 @@ +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +composer.lock \ No newline at end of file diff --git a/samples/server/petstore/php-slim/composer.lock b/samples/server/petstore/php-slim/composer.lock index 3007790bbeb..c31fb841c9b 100644 --- a/samples/server/petstore/php-slim/composer.lock +++ b/samples/server/petstore/php-slim/composer.lock @@ -4,23 +4,25 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "834a8ce57aaea28f119aedff36481779", "content-hash": "913417690829da41975a473b88f30f64", "packages": [ { "name": "container-interop/container-interop", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/container-interop/container-interop.git", - "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e" + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/container-interop/container-interop/zipball/fc08354828f8fd3245f77a66b9e23a6bca48297e", - "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", "shasum": "" }, + "require": { + "psr/container": "^1.0" + }, "type": "library", "autoload": { "psr-4": { @@ -32,25 +34,29 @@ "MIT" ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", - "time": "2014-12-30 15:22:37" + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" }, { "name": "nikic/fast-route", - "version": "v1.0.1", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/nikic/FastRoute.git", - "reference": "8ea928195fa9b907f0d6e48312d323c1a13cc2af" + "reference": "181d480e08d9476e61381e04a71b34dc0432e812" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/FastRoute/zipball/8ea928195fa9b907f0d6e48312d323c1a13cc2af", - "reference": "8ea928195fa9b907f0d6e48312d323c1a13cc2af", + "url": "https://api.github.com/repos/nikic/FastRoute/zipball/181d480e08d9476e61381e04a71b34dc0432e812", + "reference": "181d480e08d9476e61381e04a71b34dc0432e812", "shasum": "" }, "require": { "php": ">=5.4.0" }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|~5.7" + }, "type": "library", "autoload": { "psr-4": { @@ -75,29 +81,33 @@ "router", "routing" ], - "time": "2016-06-12 19:08:51" + "time": "2018-02-13T20:26:39+00:00" }, { "name": "pimple/pimple", - "version": "v3.0.2", + "version": "v3.2.3", "source": { "type": "git", "url": "https://github.com/silexphp/Pimple.git", - "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a" + "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/a30f7d6e57565a2e1a316e1baf2a483f788b258a", - "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32", + "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.3.0", + "psr/container": "^1.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "3.2.x-dev" } }, "autoload": { @@ -121,20 +131,69 @@ "container", "dependency injection" ], - "time": "2015-09-11 15:10:35" + "time": "2018-01-21T07:42:36+00:00" }, { - "name": "psr/http-message", - "version": "1.0", + "name": "psr/container", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", "shasum": "" }, "require": { @@ -162,6 +221,7 @@ } ], "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", "keywords": [ "http", "http-message", @@ -170,27 +230,28 @@ "request", "response" ], - "time": "2015-05-04 20:22:00" + "time": "2016-08-06T14:39:51+00:00" }, { "name": "slim/slim", - "version": "3.4.2", + "version": "3.10.0", "source": { "type": "git", "url": "https://github.com/slimphp/Slim.git", - "reference": "a132385f736063d00632b52b3f8a389fe66fe4fa" + "reference": "d8aabeacc3688b25e2f2dd2db91df91ec6fdd748" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim/zipball/a132385f736063d00632b52b3f8a389fe66fe4fa", - "reference": "a132385f736063d00632b52b3f8a389fe66fe4fa", + "url": "https://api.github.com/repos/slimphp/Slim/zipball/d8aabeacc3688b25e2f2dd2db91df91ec6fdd748", + "reference": "d8aabeacc3688b25e2f2dd2db91df91ec6fdd748", "shasum": "" }, "require": { - "container-interop/container-interop": "^1.1", + "container-interop/container-interop": "^1.2", "nikic/fast-route": "^1.0", "php": ">=5.5.0", "pimple/pimple": "^3.0", + "psr/container": "^1.0", "psr/http-message": "^1.0" }, "provide": { @@ -233,14 +294,14 @@ } ], "description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs", - "homepage": "http://slimframework.com", + "homepage": "https://slimframework.com", "keywords": [ "api", "framework", "micro", "router" ], - "time": "2016-05-25 11:23:38" + "time": "2018-04-19T19:29:08+00:00" } ], "packages-dev": [], diff --git a/samples/server/petstore/php-slim/index.php b/samples/server/petstore/php-slim/index.php index 4c748650105..0800a108774 100644 --- a/samples/server/petstore/php-slim/index.php +++ b/samples/server/petstore/php-slim/index.php @@ -10,35 +10,191 @@ $app = new Slim\App(); /** - * POST addPet - * Summary: Add a new pet to the store - * Notes: - + * PATCH testSpecialTags + * Summary: To test special tags + * Notes: To test special tags + * Output-Formats: [application/json] */ -$app->POST('/v2/pet', function($request, $response, $args) { - - - - $body = $request->getParsedBody(); - $response->write('How about implementing addPet as a POST method ?'); - return $response; - }); +$app->PATCH('/v2/another-fake/dummy', function($request, $response, $args) { + $body = $request->getParsedBody(); + $response->write('How about implementing testSpecialTags as a PATCH method ?'); + return $response; +}); /** - * DELETE deletePet - * Summary: Deletes a pet - * Notes: - + * POST fakeOuterBooleanSerialize + * Summary: + * Notes: Test serialization of outer boolean types + * Output-Formats: [*_/_*] */ -$app->DELETE('/v2/pet/{petId}', function($request, $response, $args) { - $headers = $request->getHeaders(); - - - - $response->write('How about implementing deletePet as a DELETE method ?'); - return $response; - }); +$app->POST('/v2/fake/outer/boolean', function($request, $response, $args) { + $body = $request->getParsedBody(); + $response->write('How about implementing fakeOuterBooleanSerialize as a POST method ?'); + return $response; +}); + + +/** + * POST fakeOuterCompositeSerialize + * Summary: + * Notes: Test serialization of object with outer number type + * Output-Formats: [*_/_*] + */ +$app->POST('/v2/fake/outer/composite', function($request, $response, $args) { + $body = $request->getParsedBody(); + $response->write('How about implementing fakeOuterCompositeSerialize as a POST method ?'); + return $response; +}); + + +/** + * POST fakeOuterNumberSerialize + * Summary: + * Notes: Test serialization of outer number types + * Output-Formats: [*_/_*] + */ +$app->POST('/v2/fake/outer/number', function($request, $response, $args) { + $body = $request->getParsedBody(); + $response->write('How about implementing fakeOuterNumberSerialize as a POST method ?'); + return $response; +}); + + +/** + * POST fakeOuterStringSerialize + * Summary: + * Notes: Test serialization of outer string types + * Output-Formats: [*_/_*] + */ +$app->POST('/v2/fake/outer/string', function($request, $response, $args) { + $body = $request->getParsedBody(); + $response->write('How about implementing fakeOuterStringSerialize as a POST method ?'); + return $response; +}); + + +/** + * PUT testBodyWithQueryParams + * Summary: + * Notes: + */ +$app->PUT('/v2/fake/body-with-query-params', function($request, $response, $args) { + $queryParams = $request->getQueryParams(); + $query = $request->getQueryParam('query'); + $body = $request->getParsedBody(); + $response->write('How about implementing testBodyWithQueryParams as a PUT method ?'); + return $response; +}); + + +/** + * PATCH testClientModel + * Summary: To test \"client\" model + * Notes: To test \"client\" model + * Output-Formats: [application/json] + */ +$app->PATCH('/v2/fake', function($request, $response, $args) { + $body = $request->getParsedBody(); + $response->write('How about implementing testClientModel as a PATCH method ?'); + return $response; +}); + + +/** + * POST testEndpointParameters + * Summary: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Notes: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + */ +$app->POST('/v2/fake', function($request, $response, $args) { + $integer = $request->getParsedBodyParam('integer'); + $int32 = $request->getParsedBodyParam('int32'); + $int64 = $request->getParsedBodyParam('int64'); + $number = $request->getParsedBodyParam('number'); + $float = $request->getParsedBodyParam('float'); + $double = $request->getParsedBodyParam('double'); + $string = $request->getParsedBodyParam('string'); + $patternWithoutDelimiter = $request->getParsedBodyParam('pattern_without_delimiter'); + $byte = $request->getParsedBodyParam('byte'); + $binary = (key_exists('binary', $request->getUploadedFiles())) ? $request->getUploadedFiles()['binary'] : null; + $date = $request->getParsedBodyParam('date'); + $dateTime = $request->getParsedBodyParam('dateTime'); + $password = $request->getParsedBodyParam('password'); + $callback = $request->getParsedBodyParam('callback'); + $response->write('How about implementing testEndpointParameters as a POST method ?'); + return $response; +}); + + +/** + * GET testEnumParameters + * Summary: To test enum parameters + * Notes: To test enum parameters + */ +$app->GET('/v2/fake', function($request, $response, $args) { + $headers = $request->getHeaders(); + $enumHeaderStringArray = $request->hasHeader('enum_header_string_array') ? $headers['enum_header_string_array'] : null; + $enumHeaderString = $request->hasHeader('enum_header_string') ? $headers['enum_header_string'] : null; + $queryParams = $request->getQueryParams(); + $enumQueryStringArray = $request->getQueryParam('enum_query_string_array'); + $enumQueryString = $request->getQueryParam('enum_query_string'); + $enumQueryInteger = $request->getQueryParam('enum_query_integer'); + $enumQueryDouble = $request->getQueryParam('enum_query_double'); + $enumFormStringArray = $request->getParsedBodyParam('enum_form_string_array'); + $enumFormString = $request->getParsedBodyParam('enum_form_string'); + $response->write('How about implementing testEnumParameters as a GET method ?'); + return $response; +}); + + +/** + * POST testInlineAdditionalProperties + * Summary: test inline additionalProperties + * Notes: + */ +$app->POST('/v2/fake/inline-additionalProperties', function($request, $response, $args) { + $body = $request->getParsedBody(); + $response->write('How about implementing testInlineAdditionalProperties as a POST method ?'); + return $response; +}); + + +/** + * GET testJsonFormData + * Summary: test json serialization of form data + * Notes: + */ +$app->GET('/v2/fake/jsonFormData', function($request, $response, $args) { + $param = $request->getParsedBodyParam('param'); + $param2 = $request->getParsedBodyParam('param2'); + $response->write('How about implementing testJsonFormData as a GET method ?'); + return $response; +}); + + +/** + * PATCH testClassname + * Summary: To test class name in snake case + * Notes: To test class name in snake case + * Output-Formats: [application/json] + */ +$app->PATCH('/v2/fake_classname_test', function($request, $response, $args) { + $body = $request->getParsedBody(); + $response->write('How about implementing testClassname as a PATCH method ?'); + return $response; +}); + + +/** + * POST addPet + * Summary: Add a new pet to the store + * Notes: + */ +$app->POST('/v2/pet', function($request, $response, $args) { + $body = $request->getParsedBody(); + $response->write('How about implementing addPet as a POST method ?'); + return $response; +}); /** @@ -48,14 +204,11 @@ $app->DELETE('/v2/pet/{petId}', function($request, $response, $args) { * Output-Formats: [application/xml, application/json] */ $app->GET('/v2/pet/findByStatus', function($request, $response, $args) { - - $queryParams = $request->getQueryParams(); - $status = $queryParams['status']; - - - $response->write('How about implementing findPetsByStatus as a GET method ?'); - return $response; - }); + $queryParams = $request->getQueryParams(); + $status = $request->getQueryParam('status'); + $response->write('How about implementing findPetsByStatus as a GET method ?'); + return $response; +}); /** @@ -65,14 +218,37 @@ $app->GET('/v2/pet/findByStatus', function($request, $response, $args) { * Output-Formats: [application/xml, application/json] */ $app->GET('/v2/pet/findByTags', function($request, $response, $args) { - - $queryParams = $request->getQueryParams(); - $tags = $queryParams['tags']; - - - $response->write('How about implementing findPetsByTags as a GET method ?'); - return $response; - }); + $queryParams = $request->getQueryParams(); + $tags = $request->getQueryParam('tags'); + $response->write('How about implementing findPetsByTags as a GET method ?'); + return $response; +}); + + +/** + * PUT updatePet + * Summary: Update an existing pet + * Notes: + */ +$app->PUT('/v2/pet', function($request, $response, $args) { + $body = $request->getParsedBody(); + $response->write('How about implementing updatePet as a PUT method ?'); + return $response; +}); + + +/** + * DELETE deletePet + * Summary: Deletes a pet + * Notes: + */ +$app->DELETE('/v2/pet/{petId}', function($request, $response, $args) { + $headers = $request->getHeaders(); + $apiKey = $request->hasHeader('api_key') ? $headers['api_key'] : null; + $petId = $args['petId']; + $response->write('How about implementing deletePet as a DELETE method ?'); + return $response; +}); /** @@ -82,45 +258,24 @@ $app->GET('/v2/pet/findByTags', function($request, $response, $args) { * Output-Formats: [application/xml, application/json] */ $app->GET('/v2/pet/{petId}', function($request, $response, $args) { - - - - - $response->write('How about implementing getPetById as a GET method ?'); - return $response; - }); - - -/** - * PUT updatePet - * Summary: Update an existing pet - * Notes: - - */ -$app->PUT('/v2/pet', function($request, $response, $args) { - - - - $body = $request->getParsedBody(); - $response->write('How about implementing updatePet as a PUT method ?'); - return $response; - }); + $petId = $args['petId']; + $response->write('How about implementing getPetById as a GET method ?'); + return $response; +}); /** * POST updatePetWithForm * Summary: Updates a pet in the store with form data * Notes: - */ $app->POST('/v2/pet/{petId}', function($request, $response, $args) { - - - $name = $args['name']; $status = $args['status']; - - $response->write('How about implementing updatePetWithForm as a POST method ?'); - return $response; - }); + $petId = $args['petId']; + $name = $request->getParsedBodyParam('name'); + $status = $request->getParsedBodyParam('status'); + $response->write('How about implementing updatePetWithForm as a POST method ?'); + return $response; +}); /** @@ -130,29 +285,12 @@ $app->POST('/v2/pet/{petId}', function($request, $response, $args) { * Output-Formats: [application/json] */ $app->POST('/v2/pet/{petId}/uploadImage', function($request, $response, $args) { - - - $additionalMetadata = $args['additionalMetadata']; $file = $args['file']; - - $response->write('How about implementing uploadFile as a POST method ?'); - return $response; - }); - - -/** - * DELETE deleteOrder - * Summary: Delete purchase order by ID - * Notes: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - - */ -$app->DELETE('/v2/store/order/{orderId}', function($request, $response, $args) { - - - - - $response->write('How about implementing deleteOrder as a DELETE method ?'); - return $response; - }); + $petId = $args['petId']; + $additionalMetadata = $request->getParsedBodyParam('additionalMetadata'); + $file = (key_exists('file', $request->getUploadedFiles())) ? $request->getUploadedFiles()['file'] : null; + $response->write('How about implementing uploadFile as a POST method ?'); + return $response; +}); /** @@ -162,29 +300,9 @@ $app->DELETE('/v2/store/order/{orderId}', function($request, $response, $args) { * Output-Formats: [application/json] */ $app->GET('/v2/store/inventory', function($request, $response, $args) { - - - - - $response->write('How about implementing getInventory as a GET method ?'); - return $response; - }); - - -/** - * GET getOrderById - * Summary: Find purchase order by ID - * Notes: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Output-Formats: [application/xml, application/json] - */ -$app->GET('/v2/store/order/{orderId}', function($request, $response, $args) { - - - - - $response->write('How about implementing getOrderById as a GET method ?'); - return $response; - }); + $response->write('How about implementing getInventory as a GET method ?'); + return $response; +}); /** @@ -194,93 +312,71 @@ $app->GET('/v2/store/order/{orderId}', function($request, $response, $args) { * Output-Formats: [application/xml, application/json] */ $app->POST('/v2/store/order', function($request, $response, $args) { - - - - $body = $request->getParsedBody(); - $response->write('How about implementing placeOrder as a POST method ?'); - return $response; - }); + $body = $request->getParsedBody(); + $response->write('How about implementing placeOrder as a POST method ?'); + return $response; +}); + + +/** + * DELETE deleteOrder + * Summary: Delete purchase order by ID + * Notes: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + */ +$app->DELETE('/v2/store/order/{order_id}', function($request, $response, $args) { + $orderId = $args['order_id']; + $response->write('How about implementing deleteOrder as a DELETE method ?'); + return $response; +}); + + +/** + * GET getOrderById + * Summary: Find purchase order by ID + * Notes: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Output-Formats: [application/xml, application/json] + */ +$app->GET('/v2/store/order/{order_id}', function($request, $response, $args) { + $orderId = $args['order_id']; + $response->write('How about implementing getOrderById as a GET method ?'); + return $response; +}); /** * POST createUser * Summary: Create user * Notes: This can only be done by the logged in user. - */ $app->POST('/v2/user', function($request, $response, $args) { - - - - $body = $request->getParsedBody(); - $response->write('How about implementing createUser as a POST method ?'); - return $response; - }); + $body = $request->getParsedBody(); + $response->write('How about implementing createUser as a POST method ?'); + return $response; +}); /** * POST createUsersWithArrayInput * Summary: Creates list of users with given input array * Notes: - */ $app->POST('/v2/user/createWithArray', function($request, $response, $args) { - - - - $body = $request->getParsedBody(); - $response->write('How about implementing createUsersWithArrayInput as a POST method ?'); - return $response; - }); + $body = $request->getParsedBody(); + $response->write('How about implementing createUsersWithArrayInput as a POST method ?'); + return $response; +}); /** * POST createUsersWithListInput * Summary: Creates list of users with given input array * Notes: - */ $app->POST('/v2/user/createWithList', function($request, $response, $args) { - - - - $body = $request->getParsedBody(); - $response->write('How about implementing createUsersWithListInput as a POST method ?'); - return $response; - }); - - -/** - * DELETE deleteUser - * Summary: Delete user - * Notes: This can only be done by the logged in user. - - */ -$app->DELETE('/v2/user/{username}', function($request, $response, $args) { - - - - - $response->write('How about implementing deleteUser as a DELETE method ?'); - return $response; - }); - - -/** - * GET getUserByName - * Summary: Get user by user name - * Notes: - * Output-Formats: [application/xml, application/json] - */ -$app->GET('/v2/user/{username}', function($request, $response, $args) { - - - - - $response->write('How about implementing getUserByName as a GET method ?'); - return $response; - }); + $body = $request->getParsedBody(); + $response->write('How about implementing createUsersWithListInput as a POST method ?'); + return $response; +}); /** @@ -290,46 +386,61 @@ $app->GET('/v2/user/{username}', function($request, $response, $args) { * Output-Formats: [application/xml, application/json] */ $app->GET('/v2/user/login', function($request, $response, $args) { - - $queryParams = $request->getQueryParams(); - $username = $queryParams['username']; $password = $queryParams['password']; - - - $response->write('How about implementing loginUser as a GET method ?'); - return $response; - }); + $queryParams = $request->getQueryParams(); + $username = $request->getQueryParam('username'); + $password = $request->getQueryParam('password'); + $response->write('How about implementing loginUser as a GET method ?'); + return $response; +}); /** * GET logoutUser * Summary: Logs out current logged in user session * Notes: - */ $app->GET('/v2/user/logout', function($request, $response, $args) { - - - - - $response->write('How about implementing logoutUser as a GET method ?'); - return $response; - }); + $response->write('How about implementing logoutUser as a GET method ?'); + return $response; +}); + + +/** + * DELETE deleteUser + * Summary: Delete user + * Notes: This can only be done by the logged in user. + */ +$app->DELETE('/v2/user/{username}', function($request, $response, $args) { + $username = $args['username']; + $response->write('How about implementing deleteUser as a DELETE method ?'); + return $response; +}); + + +/** + * GET getUserByName + * Summary: Get user by user name + * Notes: + * Output-Formats: [application/xml, application/json] + */ +$app->GET('/v2/user/{username}', function($request, $response, $args) { + $username = $args['username']; + $response->write('How about implementing getUserByName as a GET method ?'); + return $response; +}); /** * PUT updateUser * Summary: Updated user * Notes: This can only be done by the logged in user. - */ $app->PUT('/v2/user/{username}', function($request, $response, $args) { - - - - $body = $request->getParsedBody(); - $response->write('How about implementing updateUser as a PUT method ?'); - return $response; - }); + $username = $args['username']; + $body = $request->getParsedBody(); + $response->write('How about implementing updateUser as a PUT method ?'); + return $response; +}); diff --git a/samples/server/petstore/php-slim/lib/Models/$Special[modelName].php b/samples/server/petstore/php-slim/lib/Models/$Special[modelName].php new file mode 100644 index 00000000000..3a1a686dd11 --- /dev/null +++ b/samples/server/petstore/php-slim/lib/Models/$Special[modelName].php @@ -0,0 +1,13 @@ + - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - // PSR-4 - private $prefixLengthsPsr4 = array(); - private $prefixDirsPsr4 = array(); - private $fallbackDirsPsr4 = array(); - - // PSR-0 - private $prefixesPsr0 = array(); - private $fallbackDirsPsr0 = array(); - - private $useIncludePath = false; - private $classMap = array(); - - private $classMapAuthoritative = false; - - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); - } - - return array(); - } - - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731 - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative) { - return false; - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if ($file === null && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if ($file === null) { - // Remember that this class does not exist. - return $this->classMap[$class] = false; - } - - return $file; - } - - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { - if (0 === strpos($class, $prefix)) { - foreach ($this->prefixDirsPsr4[$prefix] as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; -} diff --git a/samples/server/petstore/php-slim/vendor/composer/autoload_classmap.php b/samples/server/petstore/php-slim/vendor/composer/autoload_classmap.php deleted file mode 100644 index 7a91153b0d8..00000000000 --- a/samples/server/petstore/php-slim/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,9 +0,0 @@ - $vendorDir . '/nikic/fast-route/src/functions.php', -); diff --git a/samples/server/petstore/php-slim/vendor/composer/autoload_namespaces.php b/samples/server/petstore/php-slim/vendor/composer/autoload_namespaces.php deleted file mode 100644 index c3cd02297de..00000000000 --- a/samples/server/petstore/php-slim/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,10 +0,0 @@ - array($vendorDir . '/pimple/pimple/src'), -); diff --git a/samples/server/petstore/php-slim/vendor/composer/autoload_psr4.php b/samples/server/petstore/php-slim/vendor/composer/autoload_psr4.php deleted file mode 100644 index 7e403d2e2d0..00000000000 --- a/samples/server/petstore/php-slim/vendor/composer/autoload_psr4.php +++ /dev/null @@ -1,13 +0,0 @@ - array($vendorDir . '/slim/slim/Slim'), - 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), - 'Interop\\Container\\' => array($vendorDir . '/container-interop/container-interop/src/Interop/Container'), - 'FastRoute\\' => array($vendorDir . '/nikic/fast-route/src'), -); diff --git a/samples/server/petstore/php-slim/vendor/composer/autoload_real.php b/samples/server/petstore/php-slim/vendor/composer/autoload_real.php deleted file mode 100644 index 8911c4b258f..00000000000 --- a/samples/server/petstore/php-slim/vendor/composer/autoload_real.php +++ /dev/null @@ -1,59 +0,0 @@ - $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - - $loader->register(true); - - $includeFiles = require __DIR__ . '/autoload_files.php'; - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire8ad75658dadd8f07df6a5456dd736c25($fileIdentifier, $file); - } - - return $loader; - } -} - -function composerRequire8ad75658dadd8f07df6a5456dd736c25($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - } -} diff --git a/samples/server/petstore/php-slim/vendor/composer/installed.json b/samples/server/petstore/php-slim/vendor/composer/installed.json deleted file mode 100644 index 9e041100fe2..00000000000 --- a/samples/server/petstore/php-slim/vendor/composer/installed.json +++ /dev/null @@ -1,247 +0,0 @@ -[ - { - "name": "container-interop/container-interop", - "version": "1.1.0", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/container-interop/container-interop.git", - "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/container-interop/container-interop/zipball/fc08354828f8fd3245f77a66b9e23a6bca48297e", - "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e", - "shasum": "" - }, - "time": "2014-12-30 15:22:37", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Interop\\Container\\": "src/Interop/Container/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Promoting the interoperability of container objects (DIC, SL, etc.)" - }, - { - "name": "nikic/fast-route", - "version": "v1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/nikic/FastRoute.git", - "reference": "8ea928195fa9b907f0d6e48312d323c1a13cc2af" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/FastRoute/zipball/8ea928195fa9b907f0d6e48312d323c1a13cc2af", - "reference": "8ea928195fa9b907f0d6e48312d323c1a13cc2af", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "time": "2016-06-12 19:08:51", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "FastRoute\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov", - "email": "nikic@php.net" - } - ], - "description": "Fast request router for PHP", - "keywords": [ - "router", - "routing" - ] - }, - { - "name": "psr/http-message", - "version": "1.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2015-05-04 20:22:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ] - }, - { - "name": "pimple/pimple", - "version": "v3.0.2", - "version_normalized": "3.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/silexphp/Pimple.git", - "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/a30f7d6e57565a2e1a316e1baf2a483f788b258a", - "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2015-09-11 15:10:35", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Pimple": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Pimple, a simple Dependency Injection Container", - "homepage": "http://pimple.sensiolabs.org", - "keywords": [ - "container", - "dependency injection" - ] - }, - { - "name": "slim/slim", - "version": "3.4.2", - "version_normalized": "3.4.2.0", - "source": { - "type": "git", - "url": "https://github.com/slimphp/Slim.git", - "reference": "a132385f736063d00632b52b3f8a389fe66fe4fa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim/zipball/a132385f736063d00632b52b3f8a389fe66fe4fa", - "reference": "a132385f736063d00632b52b3f8a389fe66fe4fa", - "shasum": "" - }, - "require": { - "container-interop/container-interop": "^1.1", - "nikic/fast-route": "^1.0", - "php": ">=5.5.0", - "pimple/pimple": "^3.0", - "psr/http-message": "^1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0", - "squizlabs/php_codesniffer": "^2.5" - }, - "time": "2016-05-25 11:23:38", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Slim\\": "Slim" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Rob Allen", - "email": "rob@akrabat.com", - "homepage": "http://akrabat.com" - }, - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "https://joshlockhart.com" - }, - { - "name": "Gabriel Manricks", - "email": "gmanricks@me.com", - "homepage": "http://gabrielmanricks.com" - }, - { - "name": "Andrew Smith", - "email": "a.smith@silentworks.co.uk", - "homepage": "http://silentworks.co.uk" - } - ], - "description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs", - "homepage": "http://slimframework.com", - "keywords": [ - "api", - "framework", - "micro", - "router" - ] - } -] diff --git a/samples/server/petstore/php-slim/vendor/container-interop/container-interop/.gitignore b/samples/server/petstore/php-slim/vendor/container-interop/container-interop/.gitignore deleted file mode 100644 index b2395aa0554..00000000000 --- a/samples/server/petstore/php-slim/vendor/container-interop/container-interop/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -composer.lock -composer.phar -/vendor/ diff --git a/samples/server/petstore/php-slim/vendor/container-interop/container-interop/README.md b/samples/server/petstore/php-slim/vendor/container-interop/container-interop/README.md deleted file mode 100644 index ec434d0f268..00000000000 --- a/samples/server/petstore/php-slim/vendor/container-interop/container-interop/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# Container Interoperability - -[![Latest Stable Version](https://poser.pugx.org/container-interop/container-interop/v/stable.png)](https://packagist.org/packages/container-interop/container-interop) - -*container-interop* tries to identify and standardize features in *container* objects (service locators, -dependency injection containers, etc.) to achieve interopererability. - -Through discussions and trials, we try to create a standard, made of common interfaces but also recommendations. - -If PHP projects that provide container implementations begin to adopt these common standards, then PHP -applications and projects that use containers can depend on the common interfaces instead of specific -implementations. This facilitates a high-level of interoperability and flexibility that allows users to consume -*any* container implementation that can be adapted to these interfaces. - -The work done in this project is not officially endorsed by the [PHP-FIG](http://www.php-fig.org/), but it is being -worked on by members of PHP-FIG and other good developers. We adhere to the spirit and ideals of PHP-FIG, and hope -this project will pave the way for one or more future PSRs. - - -## Installation - -You can install this package through Composer: - -```json -{ - "require": { - "container-interop/container-interop": "~1.0" - } -} -``` - -The packages adheres to the [SemVer](http://semver.org/) specification, and there will be full backward compatibility -between minor versions. - -## Standards - -### Available - -- [`ContainerInterface`](src/Interop/Container/ContainerInterface.php). -[Description](docs/ContainerInterface.md) [Meta Document](docs/ContainerInterface-meta.md). -Describes the interface of a container that exposes methods to read its entries. -- [*Delegate lookup feature*](docs/Delegate-lookup.md). -[Meta Document](docs/Delegate-lookup-meta.md). -Describes the ability for a container to delegate the lookup of its dependencies to a third-party container. This -feature lets several containers work together in a single application. - -### Proposed - -View open [request for comments](https://github.com/container-interop/container-interop/labels/RFC) - -## Compatible projects - -### Projects implementing `ContainerInterface` - -- [Acclimate](https://github.com/jeremeamia/acclimate-container) -- [dcp-di](https://github.com/estelsmith/dcp-di) -- [Mouf](http://mouf-php.com) -- [Njasm Container](https://github.com/njasm/container) -- [PHP-DI](http://php-di.org) -- [PimpleInterop](https://github.com/moufmouf/pimple-interop) -- [XStatic](https://github.com/jeremeamia/xstatic) - -### Projects implementing the *delegate lookup* feature - -- [Mouf](http://mouf-php.com) -- [PHP-DI](http://php-di.org) -- [PimpleInterop](https://github.com/moufmouf/pimple-interop) - -## Workflow - -Everyone is welcome to join and contribute. - -The general workflow looks like this: - -1. Someone opens a discussion (GitHub issue) to suggest an interface -1. Feedback is gathered -1. The interface is added to a development branch -1. We release alpha versions so that the interface can be experimented with -1. Discussions and edits ensue until the interface is deemed stable by a general consensus -1. A new minor version of the package is released - -We try to not break BC by creating new interfaces instead of editing existing ones. - -While we currently work on interfaces, we are open to anything that might help towards interoperability, may that -be code, best practices, etc. diff --git a/samples/server/petstore/php-slim/vendor/container-interop/container-interop/composer.json b/samples/server/petstore/php-slim/vendor/container-interop/container-interop/composer.json deleted file mode 100644 index 84f38752822..00000000000 --- a/samples/server/petstore/php-slim/vendor/container-interop/container-interop/composer.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "container-interop/container-interop", - "type": "library", - "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", - "license": "MIT", - "autoload": { - "psr-4": { - "Interop\\Container\\": "src/Interop/Container/" - } - } -} diff --git a/samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/ContainerInterface-meta.md b/samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/ContainerInterface-meta.md deleted file mode 100644 index 90711c9051d..00000000000 --- a/samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/ContainerInterface-meta.md +++ /dev/null @@ -1,114 +0,0 @@ -# ContainerInterface Meta Document - -## Introduction - -This document describes the process and discussions that lead to the `ContainerInterface`. -Its goal is to explain the reasons behind each decision. - -## Goal - -The goal set by `ContainerInterface` is to standardize how frameworks and libraries make use of a -container to obtain objects and parameters. - -By standardizing such a behavior, frameworks and libraries using the `ContainerInterface` -could work with any compatible container. -That would allow end users to choose their own container based on their own preferences. - -It is important to distinguish the two usages of a container: - -- configuring entries -- fetching entries - -Most of the time, those two sides are not used by the same party. -While it is often end users who tend to configure entries, it is generally the framework that fetch -entries to build the application. - -This is why this interface focuses only on how entries can be fetched from a container. - -## Interface name - -The interface name has been thoroughly discussed and was decided by a vote. - -The list of options considered with their respective votes are: - -- `ContainerInterface`: +8 -- `ProviderInterface`: +2 -- `LocatorInterface`: 0 -- `ReadableContainerInterface`: -5 -- `ServiceLocatorInterface`: -6 -- `ObjectFactory`: -6 -- `ObjectStore`: -8 -- `ConsumerInterface`: -9 - -[Full results of the vote](https://github.com/container-interop/container-interop/wiki/%231-interface-name:-Vote) - -The complete discussion can be read in [the issue #1](https://github.com/container-interop/container-interop/issues/1). - -## Interface methods - -The choice of which methods the interface would contain was made after a statistical analysis of existing containers. -The results of this analysis are available [in this document](https://gist.github.com/mnapoli/6159681). - -The summary of the analysis showed that: - -- all containers offer a method to get an entry by its id -- a large majority name such method `get()` -- for all containers, the `get()` method has 1 mandatory parameter of type string -- some containers have an optional additional argument for `get()`, but it doesn't same the same purpose between containers -- a large majority of the containers offer a method to test if it can return an entry by its id -- a majority name such method `has()` -- for all containers offering `has()`, the method has exactly 1 parameter of type string -- a large majority of the containers throw an exception rather than returning null when an entry is not found in `get()` -- a large majority of the containers don't implement `ArrayAccess` - -The question of whether to include methods to define entries has been discussed in -[issue #1](https://github.com/container-interop/container-interop/issues/1). -It has been judged that such methods do not belong in the interface described here because it is out of its scope -(see the "Goal" section). - -As a result, the `ContainerInterface` contains two methods: - -- `get()`, returning anything, with one mandatory string parameter. Should throw an exception if the entry is not found. -- `has()`, returning a boolean, with one mandatory string parameter. - -### Number of parameters in `get()` method - -While `ContainerInterface` only defines one mandatory parameter in `get()`, it is not incompatible with -existing containers that have additional optional parameters. PHP allows an implementation to offer more parameters -as long as they are optional, because the implementation *does* satisfy the interface. - -This issue has been discussed in [issue #6](https://github.com/container-interop/container-interop/issues/6). - -### Type of the `$id` parameter - -The type of the `$id` parameter in `get()` and `has()` has been discussed in -[issue #6](https://github.com/container-interop/container-interop/issues/6). -While `string` is used in all the containers that were analyzed, it was suggested that allowing -anything (such as objects) could allow containers to offer a more advanced query API. - -An example given was to use the container as an object builder. The `$id` parameter would then be an -object that would describe how to create an instance. - -The conclusion of the discussion was that this was beyond the scope of getting entries from a container without -knowing how the container provided them, and it was more fit for a factory. - -## Contributors - -Are listed here all people that contributed in the discussions or votes, by alphabetical order: - -- [Amy Stephen](https://github.com/AmyStephen) -- [David Négrier](https://github.com/moufmouf) -- [Don Gilbert](https://github.com/dongilbert) -- [Jason Judge](https://github.com/judgej) -- [Jeremy Lindblom](https://github.com/jeremeamia) -- [Marco Pivetta](https://github.com/Ocramius) -- [Matthieu Napoli](https://github.com/mnapoli) -- [Paul M. Jones](https://github.com/pmjones) -- [Stephan Hochdörfer](https://github.com/shochdoerfer) -- [Taylor Otwell](https://github.com/taylorotwell) - -## Relevant links - -- [`ContainerInterface.php`](https://github.com/container-interop/container-interop/blob/master/src/Interop/Container/ContainerInterface.php) -- [List of all issues](https://github.com/container-interop/container-interop/issues?labels=ContainerInterface&milestone=&page=1&state=closed) -- [Vote for the interface name](https://github.com/container-interop/container-interop/wiki/%231-interface-name:-Vote) diff --git a/samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/ContainerInterface.md b/samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/ContainerInterface.md deleted file mode 100644 index b670aa133b4..00000000000 --- a/samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/ContainerInterface.md +++ /dev/null @@ -1,153 +0,0 @@ -Container interface -=================== - -This document describes a common interface for dependency injection containers. - -The goal set by `ContainerInterface` is to standardize how frameworks and libraries make use of a -container to obtain objects and parameters (called *entries* in the rest of this document). - -The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", -"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be -interpreted as described in [RFC 2119][]. - -The word `implementor` in this document is to be interpreted as someone -implementing the `ContainerInterface` in a depency injection-related library or framework. -Users of dependency injections containers (DIC) are referred to as `user`. - -[RFC 2119]: http://tools.ietf.org/html/rfc2119 - -1. Specification ------------------ - -### 1.1 Basics - -- The `Interop\Container\ContainerInterface` exposes two methods : `get` and `has`. - -- `get` takes one mandatory parameter: an entry identifier. It MUST be a string. - A call to `get` can return anything (a *mixed* value), or throws an exception if the identifier - is not known to the container. Two successive calls to `get` with the same - identifier SHOULD return the same value. However, depending on the `implementor` - design and/or `user` configuration, different values might be returned, so - `user` SHOULD NOT rely on getting the same value on 2 successive calls. - While `ContainerInterface` only defines one mandatory parameter in `get()`, implementations - MAY accept additional optional parameters. - -- `has` takes one unique parameter: an entry identifier. It MUST return `true` - if an entry identifier is known to the container and `false` if it is not. - -### 1.2 Exceptions - -Exceptions directly thrown by the container MUST implement the -[`Interop\Container\Exception\ContainerException`](../src/Interop/Container/Exception/ContainerException.php). - -A call to the `get` method with a non-existing id should throw a -[`Interop\Container\Exception\NotFoundException`](../src/Interop/Container/Exception/NotFoundException.php). - -### 1.3 Additional features - -This section describes additional features that MAY be added to a container. Containers are not -required to implement these features to respect the ContainerInterface. - -#### 1.3.1 Delegate lookup feature - -The goal of the *delegate lookup* feature is to allow several containers to share entries. -Containers implementing this feature can perform dependency lookups in other containers. - -Containers implementing this feature will offer a greater lever of interoperability -with other containers. Implementation of this feature is therefore RECOMMENDED. - -A container implementing this feature: - -- MUST implement the `ContainerInterface` -- MUST provide a way to register a delegate container (using a constructor parameter, or a setter, - or any possible way). The delegate container MUST implement the `ContainerInterface`. - -When a container is configured to use a delegate container for dependencies: - -- Calls to the `get` method should only return an entry if the entry is part of the container. - If the entry is not part of the container, an exception should be thrown - (as requested by the `ContainerInterface`). -- Calls to the `has` method should only return `true` if the entry is part of the container. - If the entry is not part of the container, `false` should be returned. -- If the fetched entry has dependencies, **instead** of performing - the dependency lookup in the container, the lookup is performed on the *delegate container*. - -Important! By default, the lookup SHOULD be performed on the delegate container **only**, not on the container itself. - -It is however allowed for containers to provide exception cases for special entries, and a way to lookup -into the same container (or another container) instead of the delegate container. - -2. Package ----------- - -The interfaces and classes described as well as relevant exception are provided as part of the -[container-interop/container-interop](https://packagist.org/packages/container-interop/container-interop) package. - -3. `Interop\Container\ContainerInterface` ------------------------------------------ - -```php -setParentContainer($this); - } - } - ... - } -} - -``` - -**Cons:** - -Cons have been extensively discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-51721777). -Basically, forcing a setter into an interface is a bad idea. Setters are similar to constructor arguments, -and it's a bad idea to standardize a constructor: how the delegate container is configured into a container is an implementation detail. This outweights the benefits of the interface. - -### 4.4 Alternative: no exception case for delegate lookups - -Originally, the proposed wording for delegate lookup calls was: - -> Important! The lookup MUST be performed on the delegate container **only**, not on the container itself. - -This was later replaced by: - -> Important! By default, the lookup SHOULD be performed on the delegate container **only**, not on the container itself. -> -> It is however allowed for containers to provide exception cases for special entries, and a way to lookup -> into the same container (or another container) instead of the delegate container. - -Exception cases have been allowed to avoid breaking dependencies with some services that must be provided -by the container (on @njasm proposal). This was proposed here: https://github.com/container-interop/container-interop/pull/20#issuecomment-56597235 - -### 4.5 Alternative: having one of the containers act as the composite container - -In real-life scenarios, we usually have a big framework (Symfony 2, Zend Framework 2, etc...) and we want to -add another DI container to this container. Most of the time, the "big" framework will be responsible for -creating the controller's instances, using it's own DI container. Until *container-interop* is fully adopted, -the "big" framework will not be aware of the existence of a composite container that it should use instead -of its own container. - -For this real-life use cases, @mnapoli and @moufmouf proposed to extend the "big" framework's DI container -to make it act as a composite container. - -This has been discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-40367194) -and [here](http://mouf-php.com/container-interop-whats-next#solution4). - -This was implemented in Symfony 2 using: - -- [interop.symfony.di](https://github.com/thecodingmachine/interop.symfony.di/tree/v0.1.0) -- [framework interop](https://github.com/mnapoli/framework-interop/) - -This was implemented in Silex using: - -- [interop.silex.di](https://github.com/thecodingmachine/interop.silex.di) - -Having a container act as the composite container is not part of the delegate lookup standard because it is -simply a temporary design pattern used to make existing frameworks that do not support yet ContainerInterop -play nice with other DI containers. - - -5. Implementations ------------------- - -The following projects already implement the delegate lookup feature: - -- [Mouf](http://mouf-php.com), through the [`setDelegateLookupContainer` method](https://github.com/thecodingmachine/mouf/blob/2.0/src/Mouf/MoufManager.php#L2120) -- [PHP-DI](http://php-di.org/), through the [`$wrapperContainer` parameter of the constructor](https://github.com/mnapoli/PHP-DI/blob/master/src/DI/Container.php#L72) -- [pimple-interop](https://github.com/moufmouf/pimple-interop), through the [`$container` parameter of the constructor](https://github.com/moufmouf/pimple-interop/blob/master/src/Interop/Container/Pimple/PimpleInterop.php#L62) - -6. People ---------- - -Are listed here all people that contributed in the discussions, by alphabetical order: - -- [Alexandru Pătrănescu](https://github.com/drealecs) -- [Ben Peachey](https://github.com/potherca) -- [David Négrier](https://github.com/moufmouf) -- [Jeremy Lindblom](https://github.com/jeremeamia) -- [Marco Pivetta](https://github.com/Ocramius) -- [Matthieu Napoli](https://github.com/mnapoli) -- [Nelson J Morais](https://github.com/njasm) -- [Phil Sturgeon](https://github.com/philsturgeon) -- [Stephan Hochdörfer](https://github.com/shochdoerfer) - -7. Relevant Links ------------------ - -_**Note:** Order descending chronologically._ - -- [Pull request on the delegate lookup feature](https://github.com/container-interop/container-interop/pull/20) -- [Pull request on the interface idea](https://github.com/container-interop/container-interop/pull/8) -- [Original article exposing the delegate lookup idea along many others](http://mouf-php.com/container-interop-whats-next) - diff --git a/samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/Delegate-lookup.md b/samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/Delegate-lookup.md deleted file mode 100644 index 63cc3fb0f40..00000000000 --- a/samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/Delegate-lookup.md +++ /dev/null @@ -1,60 +0,0 @@ -Delegate lookup feature -======================= - -This document describes a standard for dependency injection containers. - -The goal set by the *delegate lookup* feature is to allow several containers to share entries. -Containers implementing this feature can perform dependency lookups in other containers. - -Containers implementing this feature will offer a greater lever of interoperability -with other containers. Implementation of this feature is therefore RECOMMENDED. - -The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", -"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be -interpreted as described in [RFC 2119][]. - -The word `implementor` in this document is to be interpreted as someone -implementing the delegate lookup feature in a dependency injection-related library or framework. -Users of dependency injections containers (DIC) are referred to as `user`. - -[RFC 2119]: http://tools.ietf.org/html/rfc2119 - -1. Vocabulary -------------- - -In a dependency injection container, the container is used to fetch entries. -Entries can have dependencies on other entries. Usually, these other entries are fetched by the container. - -The *delegate lookup* feature is the ability for a container to fetch dependencies in -another container. In the rest of the document, the word "container" will reference the container -implemented by the implementor. The word "delegate container" will reference the container we are -fetching the dependencies from. - -2. Specification ----------------- - -A container implementing the *delegate lookup* feature: - -- MUST implement the [`ContainerInterface`](ContainerInterface.md) -- MUST provide a way to register a delegate container (using a constructor parameter, or a setter, - or any possible way). The delegate container MUST implement the [`ContainerInterface`](ContainerInterface.md). - -When a container is configured to use a delegate container for dependencies: - -- Calls to the `get` method should only return an entry if the entry is part of the container. - If the entry is not part of the container, an exception should be thrown - (as requested by the [`ContainerInterface`](ContainerInterface.md)). -- Calls to the `has` method should only return `true` if the entry is part of the container. - If the entry is not part of the container, `false` should be returned. -- If the fetched entry has dependencies, **instead** of performing - the dependency lookup in the container, the lookup is performed on the *delegate container*. - -Important: By default, the dependency lookups SHOULD be performed on the delegate container **only**, not on the container itself. - -It is however allowed for containers to provide exception cases for special entries, and a way to lookup -into the same container (or another container) instead of the delegate container. - -3. Package / Interface ----------------------- - -This feature is not tied to any code, interface or package. diff --git a/samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/images/interoperating_containers.png b/samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/images/interoperating_containers.png deleted file mode 100644 index eddc8a52906d53746438e09c9bdf2bc503902b6e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36121 zcmbSybyQVf)GeU27r3-^T)L$%rF2P2cY~B5-Q67uN(m^9l!SDLfQU3mOLv#R+xPdq zZ@mAXV=#n!_t|Ifwbz0=l|>LB-w4GsHmTEQmnpgq}Jjq7&eVW@_u2+=oy0{sK*YUzx5eHDylh@eFa|?mwU6pXn@&g;K}bl)@;qkI593#?4G8 zn?1F|8pg!v&iu5LMF`oe)#lFkWhW-Zz4ezj1}9Z3@?>zrXsMdyjBLm&!#}7DpQS%P z0mhkNjO-2h7f-HMe`u4oKOgzy&mZ0?rMfQ{mdHJNDX~+^)zw@4=CFL9%ZNpX2o^@- z5)wWdZlBhJ z50QT8N{9t*{sBXD!u?Hjv0U+wp>8I@C9g$(O(f@`Irm@Tk)Gz7ot6JOkS9n;@-})f z)2L@~mDG7kRsZJJMmqkD7c@KLXsEw^j6?^)qSyn*6X> zdX*@#`ge+>YI=Gtf~!s1%iO$~dTmoxT-HJc71-&8xrad4>S`0W`Hu3CQ!|lqB6?_m zH^VcV;h-s74LB^HDt3@q9iv)Xi=RPfzJ7V;<~+dt`75e`$BzQN8AfffU5L60M?&|O zU{!$Q8a?3tFF|`M`2?I2&BU81l{4R|?;}S(&EG0rXWR8@p+-O9(nMzK`N z*jc6krOP8U=c_98>a_Q(%Q0L@4LI&1wKIHAi}Wo7rk(jrowO40K$>AZL_ zN7D6~r(hoNs3rG0mB?={YrkxMTYgS#4zqdk`)M}Yb__KiMk?{0Abw5lEVklAbOu=U z2YUNy)BUwXT6S9G(8`aoFLeIlGcxKkur@7F$(}K0e}f47YjBcIdl?XI?i{z=!<^oeb;*Z6(^?zMX$q`yXzp+*^{ z^m3oDu|tK0^|sZbP^coI(M>^!8b9XG>M6+8sNrKQ!vE<*@(x5{9a>CY&!nsMj*KI8}(9*un2W?{9_ir1hJrAmMb2 zy{>s^PSU66ZqnKGo|6q%DUe%$S-GqVF;EBn1}7b7aHTaA2Pjm>^S;S7`xr;3VM$grLw|Jr_O{O8@r|w z;qy4&IPs~fXn4<_gFMI2uOlFwaQyFxL^;z##-ON(oGIm$~wO4O&eD`qw65%Y1L3*`!8_VW*#8BX6 zyrlpDVww-7jm&6q0?rxg?{}@fNP$rET08tsGS=#QyOF8XW=s0JKOvRDR9XyD6hLDq zW#z=#_HWH7V3+)-&(3Rv|K}A)g-Fc?Kf1bU^X0xO{Z4w`yd-7M%}j}(oDa59_qI^l zz9VahXMe2UlDCIIeZE{vi(6XGwbPvrSU06aI5}~>;jWWwjO=)xocrQJq;ZXgE+1!& z20q3Ds7U$0!`nOj3ib9|G1;ZJYy^Nk!MXnU;vqZhvg>+3&;fvAng1ybxE3ejCC$W| zFgvl|b$_#(`(Clb?Jv~nXJdejVfUFy?~IA6FiqXB^Q2LWGSBDm`{Ho60?VDyOG`^{ zhWg^~jMcZ_K(JIC=3w*h0|ptcdLQBbcd<%mE9SXwq)tG*7!w=tQ;F6FQ~OJq1)A=VTPjDGJTK) z5x!Fm!SX!l*omYLX>Fsj%f``Zzj#REwoUqN1`Tgn6%(Ghn=%0TQ6&G_Gw#Eshu|qo z4LEx~CrB_p-){2h%6+a>N#TLWXvW7%U%F`_Sl)F^*hjO6P7&Sa$BxZ=m4Q-Aug5=a z+(Z+CBT!FdYB7GELgVt3D&MJk<5^Gr>?)=j_B(1uS6tvkaWTcGJhS;py=a-tN063(5UgT-m_e`a zTQ%=1?iS<95Ot_KC!+yjO?~?Xt9a|REaCo*0`T;$Cjf4eUADi}@Df}GobcE;Fn{I- z^Ju!#QQwN+60Ud`Td?R=!O`cp&zz$rZnVl^SeOOk}an8=2zEdU?&T(8gsYjXC$j}zqPOA#tcjMML z5*$8I&t{2B6AHl;x;lh)1|V4Lt~!+=<91rWUO$1oB!9k7HMchjKmh=e>YS%GvY9RK~pN;#i`Xh$uLn%K+XNDViO8 z(LY5=$q#FZ#iD+?Q)T=&o()wx-~b7GTk*oNLOxFGc~2r?=N0syFgGJ)A9*k(Ndd z9wbI>1s?FoGxkFvV!OU4mZjl7%4kJ`-c~7_PNHcn>?i_ zrsl`-p(`qrherr(2M$Sr2owmGu74m8Dr?1*r&!=Pqt}8H*uahu0`>{3QX(OtJkNd$ zDpc2%#z;jIx*-BUz2o=RxqP#wXe2&MF`{P759-U4{_iNGqL@FqFeisl{?E*|6pEis z5k(v#{o}J_06+ayjNvbUTcW5C&}up=AT%5auMrptqLib^tB` z{|E@;I%pz@)DEaX7!EQ=rpW&1dni~6A%KftRcUFT;15DUh3r)x|DKJ`Cvslp1{j60*E=H&1tqYiv( zx+8Jde&tCG3=Rh4q4-`N$T&K3H1Rx!V40`G9pq2E{P@X5+)KVrZ1(us>UiK9tVY zFGuYkCKZXpQ=NaBk9IU%4Er%boT67%Hr^n>Xb>MjXYgfBWI45p9- z!_>k-ry80qbJLZc82NZx*{GBEl@JOIzCPVtOO~U0AuEffS&CiOv~%{cV%pdj;(v42 z>3_Kpxz?Y^JC?7)b2Y)TG}5Z?eNG$>LV*E;do2H}j)_U)v`HW(FjoKFkdjs^rN7p`oa_va%nWt0icxKyEFZ z#5kz;Z2@ZOIC?p7?-9kZG3 zFgZ14{xeJ1YbBf{!&W_=jDm$)(y|rcKa16Ty<-NC1zNqsEQ+TH)1=s;mNa4;sg_xTzz3TnJIU#=II0{+d% zZjrz-lY9?6$>lHU#*$iE@0OP4&a*8m!C9f^TR$({4>p- zl}naIo67Z5l_sOc{{fr496PZWNW*u-%JuTXk{IPi&BPE0q-GzC(yq|&{lBA7A@R;$ zqHTAYPj>6&&Bz5Df+p?WIf~fSoUcSud+0p}tcxVSqN(B=Hvt&H16)Pw#fxBvdA;^T z@Vosq-x(O8_}Zx99h4Z2C=y?RRuaQurs_rge)*ubiV997UNnHkY+Kv3Nyl@m1!5L< zCMG$LyYfL|>^1PsuWZ}N+Q}iy5QPeDZn~XqR-i^q^V>8ZM-wnL@sZ~9e#m?ugVsRa zPfn)hRNK9Z(}F7G2B(a`rA|0IbDMDx*jsAP?LM$cPEHQabZWwk#G&k}u^L)-gEy~x zyMuuc@(9GheGdvDXQb=vYuYjUTmVbtZ(5+<-rl-xe!_bm&A(|`x(?3s2dt&qkDQBD zI1F>mpXJy83}1doV9CZbb$ApsAasWN*M6C2xncHPz0 zRb@Ly_s4Zq47h%Zzsl{!ezz2^SlDEl&h1Dff%3*kX5_$t%k9fAEtlN`j@K{TlO8R(`S=_~5UcDF899BtanV z!9sK1_%^rqiKTJ|H}YZ2DNbM9)A0gNKgZc`uL%U+EXHMvcy^grU)ArP`;_ZeqZG&` z_U+BqR{P&xU>~^0Bqa2S9JYiGaW+3esxt3|VC~J-Ve3~Ar!v0mx;kDv?jwJ*{9B1j z#@KifRZK^2>)eOkq>aL&KcSaM$1u3Uput#8qs?lF*kSG)rtihx3nL>VCRsAS7)R|{ zHFN!|k{-6lKHMxqdFlIXRo}-3pv!_Se@a-VOk(cO9qYJ&Aot_G(fup|w3f?1hoUC)toTQ{6^#WO1M#hbD9>LwEb_oy?XbLG+ zo`=SN*VnJ9Oe(bL+1RkPw6vJHxX_U@Myx*<6?NP4Nq*6w<=}vP`0&A5h=Q4&{fvB7 zNlB@@SiQjX*@vX`^vJ9%iuN9ltzUV%Ri?;*JsWv0tSf!f4^WwJc+(#*xaie4`uguc za#VCQ!h1aq{%l{i2?VO#-CoMMxbW=k?BG#RB^;=oiBPNb$X%PjU+h5uC^;#HYVKoDT*cYK_W=G4NLT+1lI8>s=19(31e@4W}_lN zI-ape#B5&R6mXcK$A zBN!FGEpNO%XqI{TG9I{H*V-{g*(56>Lqds(8SnpXN?^zKuHG70S$)Y6^Q~7a(X8n& zt*9VMl(=tf+^?UPe*L=S@PaB)j@_VM8OF$1|Mc|t7p3qK>(killA;{^l@(A1$;rq> zv2XXHT6>7=(fbebz+r% zML^~Cc2O?KPSBcp)m(8SO>OO%z<+Dhs|g|pN4{@NyjD<`{9y|CmF@RUV7O!3l(6dt zM!YP&&-o6+qW`7Q*vt&GFMGp0hq2$WO#9&i$mB9IGU2-4-+lq!lk8}pQ1T30io6Egf`o4H_Cf~%Omzj(pu6t4#lmJwS(%RYEhtKa5 z1K7`hv(y%IC(Fdx6Z={rnr_H}7_OkvGP3-|#zfz|rdO%MD2JL~^1Z`T)qUr8Ew+4Q z)z%|qD{sH|EZtuS0@$2$Zyy+tKkmkrz(^lrc>DHk52fcH+OJJJtj7)QcP}RF@6^+p$ACmzzgHeHh+r4qabg?^=HwO~j@h6^>03gDde*O^5==tXj9{aw(7tWFD{G ziiV!9aO_^d7um8@iUvkTh)POIz@b-Gk^mzhu6Ey@ibh-=N#!G-_U;`fxRJ5{xt3lR z2{=fADNNwHnOd8~#?zl7y;?d(48&Zd`m;+xyK|wMF z2Bo6noGRC&2Y0;so2uFaPO7)jWvvG!FeWl`a)A9gTTAWjhpsm_yOrVHD|o8n*Pj7V z-@nNMWu)I|waqA%%jJS+Y}wZ)#ee6OfkXgzKoCT2=J={yh#Ps#TIDx2&0Pvt7&UAE z@!rf{owdm&B94`5G~{#v{tCgW&}Ku50b-XIB}5 zxQ>0YyeyWN?`QgPZTq)pc#VL9imbX#*Z^mu@{W zczAfs4;NdzR-6ZX8a}3S05<~66;m&90ugTjkBUo5ptG~HZIs*l4NIKhID0Sl=VdC5 zTP=B1GX)Sn9yK?o&*Lz|4GfI9$9Un({Q7$BC)DDGQ;+ECwv235>f7!v4D?201}*W) z1)T^1;WP(c6>zveBDlm3l3H(3ZUAe3L4p4~KUuuj^?EvhE&>n>?Z39&x*P;z_vagK z@v|=&dqLJDJU>52q-Q!Yu?3O_n1cDvL`i;4jmE^(R7^6x+|B(|mIHr#!-$wy3hdfv z`aOri#-;vrr3n{1acl&IR_2&CRM^1WJ#l#!AO)vb5K^r+)e zTWH9J0KBtrq#OGT z>KIH?oC0vHcHLCb8>UJ`*DfQHEr6ynslIPbz^=HRu;t4Td_%=Y23hpk<(Sorb7~+r z3B2P6WesQRnFc7302Z1gw@%tQPM_M>=^J{lzXP>A;^frz^>>u#}CCUxYwIYdxjl_xyv$!9mZgNioqi?%DHpnYy~ebq2IrMe;TuO?x*xLU2O5Lna)m0K`9uE%E&;N&P$ZaWO)DO z+hJ>7jaRRLc}A~3UV>h`wq=<0gv-X?$Nibj-T;8l(grbP(*ZY@(tRAh&=>(`|JAFL$+H3V{o%tE<6h zHT^@QqjK)<{Hg5uu0S9}{&M~eH@wKlJxt^pK)7Ww#lS@0crm>rohH-@>zJ>g-8c zjJXPxKZI0ORk<$q?|a;Oq}l91V&mgcku#ODAB)G`l`3lhay$@>`cFD$^Rc7M{K z)vmlW^7L*+=8ao{2-T5%TQcKRa(xWP(Rw-mr^W)6;U<4QRXkNTzkmy86m@non9 zDM#a~64{=Is=m@PGS?7f8Ch96;F6LU6kQr6v%`iD#kEO zf}huaI3$W_r6R5-rL%YWb1SD5bb;Byxu7KWhqnJ)=K`Du_m7ij`m`i};Kssy|Qjg43289C6xll=^10RLJY`{O{jFJV3=z0LqBuy-$k_4>%vNDiN~(99j{y7+8R`D+Fwg=} zubMDW!>%9#32ciSV1#0K_uhys^qSlAfEf9s@_qPlHOv6B>`Mg5g0wgX_H^_N=f3LjQ z1o^(FZrV5&N-t{)c*50IL86+TUNnzI-_?6P@1st1E1NraRNBW*-`9!bs3j2o$`2sV z1#CsCa(WFE6ta4HA1XIjD;gHNLQt`}?IxIku7pe-_>TvOL@wa8)=q{%!76(8ORDX| z-m6!ys?EC5{%&lT149;5Kn+;i6~Cf4c}r~|ICUuaQco4gp^ALZ$OA8 zeSF}uaiqZrSOYT&IWHptwE^f3p`c9H)YR-)aqieXUj^{i`S1Fa$LGuz01j2I-wEcA zp&=fy8N-0Iv3ai$=`R^I6tcaBOt#DN@N5C|H8)9v@+ zIwt-^Dn$f9dKLqc$F3)_rOgd6EJEm2{>X<31XD`!tK~-&A|6jbHAX7vM1fd0s2x^M zMUdoO}=H})I{cIg*&P21y;2-QK4S1x;L8BB9h}x$!va;C!V;*t)pbiC! zl9E8J2om5DyqF11T zMO0M`>4vM#Zww8yt~MnewgsENgAxRYCj>xrxXfH*fy4FLjay~}Lw$xuw}C`~7m5Z+ z8L@enmIiyzX~dfOViDX9VDPQA*PH9BS4Ap_@?^EFvMpsq5A`{q3D48szefxh+R(8N z$lBp^KM zqGDrT{SzF-<_h+Dt$=SMth_s3gbO+zqh~hxDnv!o^n<3)50AKQVVKwP+JD{5)tznZ zs7@4=m8A_0DcFgzfw;bW>@~M{4crds1Y6+h2|IoW7B=>%z5^u`irl<#(7>1tQvm5S ztk?XQ+(WZ$k~?#xt@aqnbYu7fqT;LaKDB1otwO?yd<1M7IlbEpPUa_^U&?j3)%P+& zwg4o66xfT(=>nhxfEoedBXH*MCCAaTrjOM0Ku`j$3}$BLBZE-&6c~UYglZ3J`r^`3 z$rmq>4LPTu`ep(R32+iy2M1|&_2f$8(u(=W@bEk^AxIZM`jNDzD)`ikTh1UABs7>mkw}1S{)UNla(xEC%(2Q0+0&VF@;P`~gmlL;GvgLH4uk zqYA}vuTbPZj~uAd1QBQ=o+F7m=K6fp$fV5g{abN2Y<+Mf&m&5n%pB$j5H8&$0HIk4 z(K4JfGm(=gKQ)WE(OfX*N`(sZnK1gVbveLNufO8x^6_QJ7!pD3Uj@)}MGS2We;z(^ zK(3eu!;F@FG}9oX2qZG&@Kx zNf$te>*O)P!;8JWTkcy{&&;1&K4xTKH1~4*hG^Dc6jzBXANlxWrUP9rOt#Efa{}=^ zO>gf`<_@!F%Huj%Uf;GR90q2D_G)KVIsu0FIWpX(Uv42`Nm#?M+?cD`cm%Xw;R@9+ zjT_#XS|*FSOH4T=uMX>9Pgng|QDepj*YXp2poifJX}@`qHyMLpX0)ADj1C@vjIm#+ z1&>Wd!G|_ZAXpA%#bHRxs5D_n>G_2R;Avq(k}`Y#xUFSwI;cAi7Y(^AOasNfUfu-? zzn*<@&Y3Qmj0Ya75N9;_%p4EvoH2LN&Fp`a4!Quo;B!%v(&WB2H==F- z6Eukli3+9%zt$RqZm}dJl|w^wmlvv62~Hs|Vvv}HRdQ(63(>811ic*f|I9uC>>=}C z|5*)j`Fgs8Frq`JZi{*S^lv0kOZ954J59MwJA#lw{kux{8M(*4p1!=joqF3U^ zMv{b}0NC|6C=OSSy{bU&M6|*H15u2eaGVJUBQ{WnQV^{>Pfv8%H_&^`xfQ!Nxh^ID zG*ESt&`${yI)$TwR_Tj?fB?aWabZT)oH+Z+R^nRg5lJ92%nG3ijfqB=-~}o6jffH5F`7O>A)M|Gwa&ldFP~J zd3UxYRz5@;gHu3GJDzx@YIb$B;y@GKq^qa*G$-)hyXB}0+Zi4j7{FIgo%a$W_;SMt zqNEW0hRJIolA6BB^NrP`-8{*PJ6olpGgg>gJ)%zl*wjkqo3_p3>=--O55O4dp+ zqE-TXq8KY}mxWnSyJ|X7GJ4|+YI1Nw8N4<)h$a-z>V?Jam}~Dl${rbC@vy#qBqYtg z^ZuMAbT)-449Y9ms-oO}*-@E&0csckpkT$Dg7SSiIaJ3Q zexOhI0fC{7EOzRL{l3@ETI=2_(+(Oi753(nj;l`0U&VJr65)7_YY8GpfCF_CAq{a? z-_anEHg8)=PmoB$>vreGooMayd39^2M?xy@gs5MLoOiQTwxERO?H??5ho3hdF3ryZ z$08`}4&6+r?D)9Q>+Ji_HyCtC))FNWfQpQof7*W$iu8#`lo+LmfbEq9DvT@kZ?i#F z9W@E7ZAt~0?YH2p=`MZJiM|LiXm8Fzu;@_Pjow9O6-*v^-H8km5D-*@z9C>xsB|Ln z`{?|xr1>%TSg*&Z(r2pJ<%9%yW^F0GTCWXbAIdn zILD-(I{aPyQGKZ*paY;pV=;^}u27h6Zc&=4tpr?34Q9Y= zJ=_7f?)<-bktIqQvoCd-^!eCdP8#zrnxF>nHk;LsYT%+??pB;xoDbRWJ54(d11?2+ z6I5mc)Rf{kU{S=)ZQS+@sT|>`z^C*==w_QhgKS=uwc@q2`J}201WQJSMDoy~G(I^j z2=;g{;umT9;UEt2g!z0P1grf92yD(kcVerjKnIH)w2n&Sn6;>yW+8>}V^3TZ)IOG} z;rBfFBhbKQ^saxrHZ*OHQ2PNE%`Q~i9VBo2VgG4byQ73z* zj?!Aqi^D2rQYb%m4`LR-QX%h?zXC;vo=vU5#U+EIig|7S2+X<{i5uq07xQK_zv(&t zjrK%2KCHC&b9f5O49qCxcjerW(>HPvI;W8VCnKxGCVqvoS7@vIk_SB9gwb+Qz>DfP zIt8@yISQ1Sbd&Ca-!z4u1FF@R#gD`fi#+B&=%9L%+YrCZ6aZ`oWhOw)AmK7Qj{dHw zfZdAJu7Ed)c$Xoi2BqX~OBtE^ItcmE+@H2PXDdND$!vxFce!`#zp8E6G$};&(BF{9 zTS-cyXqFy`wOQQ0aMUPq>6>j)P!FC6a4QT-6lGy48QEWVzi>(jgQtFVAASGxvl?t- zmUYJ=pvd{rOVFi?Lg(11Jw0DH;yDx- zm%Dzdkm>k6KHhvckhYJm?u_~Qzm5L2(KjwA?3^7*R0JxAcTwLBzkk2V39{Y9qtuHN7Z~6TOpuR53v{*HdqTG1hR=G;5Ow^heltg^56 zIOtyu8oN<;r2loDO(0%)-PhTgr|U(Vs>3QhEtuQI#jd7r0wC=59ZSN-Sx;jPtgUFp zH4-T!*^d8h-maWI_F_{NQ(^u_y@}7hAE{o{RhN2eI@R0yNozy74!{GmR*)%8n!jC4^DZ9IaZU~HpL zWH+H}B((lhza?9gJd#rjJ3%OKzM7TG>LBjLvRAC^cK3Nd4-G$xPMkvM)<%HqJHYp~ zUT`S(nPMPk*o4m;iyUT6VE zD3LdTIHPaWsO#GQPKTsse5(FTW4D>xBRge_A@Rz>EX+OVv>iB}zYFJ&=u8;Y#@kLM zjEI)Pr+IwzJ0`Ry0^fE=N?21jQ7Zg)z9sOpLg=tDlzW@M*xrq{p_odbD3GL1AH}El zgPQtg(8zZ1i?Xg|@bo%AD+R~vBN4~N;#aidzmX~mOUOmVe+0=!l2auGM)>X>Tk8f1ZgVoWWx1xZ)OrPbwtPs8lm=&RB2>PiFK`&{@kG?lc^wMpkEV?5cPXKZD!Gs&Ooi))w)LGD;1x*8H` zu5SN?Q*BM@^x;EvEP9XBmz1Nq_P>zNmQNn(4{wRJm^``vMnmqKIKBKq^|Eu@DdsT0 zjmOJ5KtTI|T~aR|(w;qq%V-okQ%}6y>fUcziEcZm{zt$DNftLMQg$+5_RBY9uCGEM z;>JaC^8781imqp`JZzwUjDt-QltQ&DBxNcnaa-C5+&Rb&Wt++0REW(TjE2aw0I%V@ z^!G;gtE)pg3<#w7O5-5$QwGWTyZ0F}1S`V<74zNWCxcNTFol^+lZAsXvdVBGs_S!^ zfgPgYeM z7NeB7Fb-2?$ABft8CRob;_y{)H28S(#FSQK_`9&u#gUcI8ioAuL8suvgU@5aZXOXJTpc4YkqfyLp;Hx?F#>-#=QF4^h^G}+)@vBF$3n8Isv|!5Lb@pDHb(E zurqxkx-PyX*r%%e>Jf#dxo7UW5UiUbX`0GLHvAZT97<5Nuf_ll8$j&%n*Fw+t){8<0ZG&1!&Z7go0HC zfeULsvUc_2ZkKWR`ie)DA|+_p*xEr%GdNwF;*4l`gJ@c+Qp;ke3KmC6n)ps6*7DFk zPA`)B;{D3f(ni-}pEIU<6-Muc#Zt6>F$_~sc|SJ!&f;g;olxTmde6JPNFy&AOk^b& zmOfmHu>Hs~LVF2iAO1qav?uQryAp2|$F?wrd09#WCPs#-VHl|@^*?UEQwZrra@7-F;d3C(xR#S~CfdfloF~jww1cz0r!jL> ziQbD^Wc%nrW?b2k6vw=D^t|>rnaJYpJu?9Z1j~nZHULRTZw#XnZ*w6)SM_Bfd-ji% zQdMFa0mCBOTZCtv#qj1e{)jldeBVj1l^UkrTxG*1kAb|To~kn5Cfi%AL(eIRTQncq zrC4V2X!isoi}_8*r*HCSG1#GsAr2=Jkwd!;vhU6(ER*!(cUr7Z}{1nOv8 z-|Ws}_+Kz6sFlD4v?L9x`KgiX<3@^K(Q|6x0x`bP&y7oYSS4+NiO~?fPBCQmbGSak zpdG)WorCT2-*iGii3a%lt@(SAIaaIQr_-yT_Rb|j@65S9{m@!ayd14K?Z|x&dI~|k ztexcC)M_il|J|svkz2l4)TTCHz3kI?@$xYQOYhiLY3dbbjC#?*FNf9?nETcRVE+w2 zfAsY1!HTthmvpIeO_csLiO92Z7?C?mf#rFoJUtLtj68v(Uu;h2XIrsLzlhwIo2Q6i z#@KelH2~!q2C~dt;{BlYzvI&2U!@E!P0vWs!ISaxVtaFEB{Y@!jTlCpr0EGTK!)!TBtLVR=&aEPvee0)a8Qa@P30?9ZWD z|`>XCZpS2smfM7Y5&w`@D0QY_O8WCw4Re1304l;tMy-W=Pux(j;&&n4-GB5WaZeGiOePT*gm4t=O%Q4qWPVz zVV3_fhLy>D`PBhP1_g6*@8TLi0AAudR&pudp=p9Nq&RAd#LYL9@qcX}{hBRihnm0Pxyp;yrs zkmOJx%^;4B;^wd;&vI@;eH_H!9P9kr1I33aY~{mJVqe6gFSb=p$&+j-1!z6UC|(vX z7g0yoSAkdlC7v{UZU=M98Kb__7zSG$Hv?`$s6FR=WXZt@QRrFF!Rh<4&xDNhDzb>C zHvPL&D#xeoZ^zNI3W${U(0pxP{_vfU$lW9CDIZuwc=Db3(Z8CznPh{>mHw&XAa4R+ z`gP4bC&f4@D-k!~Zh=`M7{nodU zbu|SVl?^3%?!GMn{(p@tgYaI~QB*`iv>k+_kxP;h8}(k}HTCp9IzWu@6R@ET~&z7X%f1exBuI2~j=}v*z)ks=E z2AmxeoALaD2)sju0Pq=W8CPw-AE;vk&*Dozjh-k zd2gZc$1Jh?kq;MrRir(difXw{@pUavx_o_DvDNiL1W6u(#^`U?V#ot0U++gge(qY@ zXu^Q}f#rVO1}SKKKUlUPB=gm;$NUOWyoui~f%XmBiwmR)?cljhdV2cqLxZVC5cLYR*;Q$5~wq>kZyDz2Q>|UT{L$IR9WI=j*caEd$@RfH;FXPNk$Y@a@u`mu! z)PmABcxO3Ek9?f$lW|4{xSpANmJ z`lPNTAH&mC{HkDaL)NN-GDl#s76{@7mDdjaQz%<5Hbkw?^Q51d!miKZK+4bi`t?q! z*N_=_i^Z*rkMGTK{D5c+fV(%Z4hU%a&layNd^yXC1FsR(U8ef)t+5Nrw2=$}&8z=9_9s(TX-=`dY z@={l0BBxEmk*-E@>5&jSXb>2vpP#pN8zt`c?vE(UOG_o1;$18h8(q0<43W7YH1sjQ zHLIGW{l3NIrAbCu6p#EZqR>mZ8jqFeqfXkC0V{2EAsb6?vsu;Di<2f=WQ;PlzWW$i zFMgZA(Yg76vmWWvA|L`U9Hda^Mh%V9+uf$TvO`WJ))gUctfz`BbEt#6XXl235xu$1Y%#?UpzSwhf6t?^OC;do z@5eLvfDL;2%5?c(@xc{}UY|~U@Lu^7-X(ku{p-<1Ow5)!qj^~MeBFb#kd8#wzK(0` zq?nIcl>#NtoEjDJ;*v%j>@kdX*=$Wl+NhjWU_4z@L6T;_hxjw$VT6uGXI|=Md1m>f zJm=5gzb@A)6+gmWRDI01I(-YRBLQzUYRei_>@|&$x*#6~}4jL6e+x6VI3X5ojwF;wB#Zx`)7nGdL*D0eFMXpodZVQVm zE|{s6S@>aEmTc6}z^cMPx5FC0q97#n*UpRYW$lELZRxtAL_Ov?v~`&;W96NuJo^In zyXpOA6PF+IUX$?f{6e)3gzBwc>-rA7$qmb+bKwRrpL2%m`1@SvWz6}ViQR~4Ix(4- zCU)AEB@^|f7e0whcO)`G3h*s9;8(?&DR(zxg{te|vl1m(tH?O1g>6K6{4Yr3vdjOmwuN3xLdqDoviB^iEnI4 zc~6XKg>D&s%%DKh$yTi$%lQOh>55TVw;G$+D8l7u87|znI?k_OwvBu6If=kl&d=>8 zKct#PD>{BO%h^IXB9~rJ4iLy!ve0D40WU%T$tOv~w7&AnDCFP2t^6~dqblwkI5J|= z2yHO~Cl2tEnMM>W@AEVUp>^D8rr~S}wv<(usmkT^Z17gGJ6nm?C^2G8idu=w=OxVv zSsTzIIthE>ysZqul9kO1LktSlTC81PZHkiq%$+zDbSG6AJVLrJLcy+hdALspH&L!H zHmEz8U7f&{CdAn5W2PW|M#5=CT556giH99$86GvEkWv4t!A>l+Ma^|5@?mt*KeAtI zVf#_wXzQy9-^znli>m5)9)Z>{d`V&qhOi_Cyp*IQBn1!5Oq6DF4@`v_2IP|=Mr4a8 zc?1{&eWcF4GEOyCgYPF}wPb(WS|5nDOIY(w73(jgr~gCZ!+&>)@C4N8lYbVzqM@56J>J$Jo#-&^-S zmoC@9{J;PHYWM!_B&T_ywHYUPyTa)#Z3NnA3O|xLzE1m={Qj90$;Dl?S$|O(1!l?P2+hd1H zOUttUq$;~)v9L>4PDjRa;is&u-)>;MXIb9I{s`j;crSA{mOMrMYDdtF*{Rjn*WQuf zL*Vafj3J6Fhqsfov=tak^w}lS6OD3-Qdtrc$fBT_h+8xS6#rCieI>w_nBbEiu!ITm z3Of&A7HrWFiN*>!28iIsJ&}JXPocg!eA3o29%9{s(}sWv4tl*~Bk;Q8L(eIZWEQ@* zR+Bf$vFnpum4!?sN( z!_{Y&`#tN1NN`6cJIkKf*7bZfcTDG@MU;pA$Adh4_YcZ6fd`qugQ87mLZ!DV#D#7pKH=#*q^U`~% zY`ks)jm2zqK7(IU$ooI6W4Jil(tyFN#^3sfkL5&PG9DETV$UzH3q#7@6nk`f#|nt3tZZ zA73@~g=%5upK1q7Z@7*^vFYCZ)Wk@J{_2THfUOYUhlOb?*k6Zz``hQZzA;bZH1&SP z@IBLZSQu=!1>1Z`JhWu_GsJHx*-ow-(d9QAeJmSM4)XQtCn7qAL@_58rF-=pktzno zsmzDOA`n|8(%s(`he2hwa8Y3_rz5R`?-jueA0JJrq4)BDd=fV*y3ftiMusHxZz`9U z9MyDucOr_jqXXvp>s4I$QB9f7)fHOvRhxd#a|Za2pHia<17!>hbS`t={hsT_-nYYn z`_9;WI@@+0=sQNaV^p z9a^U!>Y61VgwE@0;t5s^+-XFjqK0P-J4$o}$$J}C)G=s=&o>w(f;e7#u7#CGZXSJ} zs4u&Ci=u7Mxc1;P#{E@5sKtHvMqLW;K?T{Yr9@9Snjvn=e15IN8HG~i)8)(lS0h?l zsEh#P#OKJ!thf&Hax@p=(MPD+bU>O^Yv0w*kS24q_S|8ifI&JS8V9-EB9KRv;<@iN zr$Hz-5+sF$gt2i|*o<8_ys&mYVD2xrHWQC!TilnR!iih7*&WJ5H~FsuRQEqii1n-b ze)LvFQML=yS9UpJAU7S2Q;Y#=*$Hp>*J4}4bYUdBrP3lIS4M`HdHdx{cwgTOn}zhc zYw!GWE}Ao32-e*qiSIBn#PG%FsVxq~#OW~PMo$VO{_aBMHsi^c`9HIhaC~|%93547 zT{|M}Ij!{%?sYM$q#Ap1^S27g;#3zp24OQ1>~c!3{6V=LU*oX&*zF$NF(9UeG`QW_ zoP)}NB!tV!o+OuME#-`5`sb?D9Sr#%29b}}*Hh;NEjc{Cs?ILSs;sY{w;r>79TO=V z5m#--WDu%gtfDCWD{=z{Afk3dE;YpV;?~kT;>5+UTYY6$&dKcMcDoX3n?c33&n;tB z$s)G297|}_4QpKY-7=W1r)LR*vTf|QDE`om4quvXy5jWh&AJ^-;!-Fg?b~4O z7j**@{YwPb+cl`<{Jg{fiU!WOxh@7(SI9p&pu-|QNfrx<#Y5G36SxAP1xzN`-SzZC zePVGOvMrCF+bF)0Gmxao9tz#UgW-w|gK7AY*YW%*ArOVN*(L*4NWw>ZS^b} zNNeq6-9Auc=U$v)j8(^8$q(FB-qnd0To|xxe$$QmF<(daY4;K>V{7teoz7um4C_*) zZSBZiwZVttnMzU+n0yrlv*_Qw1#A1BgO;Z7_N``k*qbZQ{fOLE*R1zDq~u=aJNs+i zxF>C8vNx~I(|PFm3GwY)P=r`?5Dn!Ifwc6)U|)a18?L9QP<9Zqh2A2)aOC5Bf|>8V zGv;G$Se>xlmaA{KIdP>`yNmMM{*suBgk-;_rhV-_^g^WR`_>k<3q_PZKRT7bQ^OZy z$@UqW#RA4EuR=tb9@aOI?RJO2IV=>$JO1PCl`CNG!j|lS?~&C-#~a@+-;tb7JSD9R zx%f)SN)2^2aCJ*J_+(9dh7Q5-PthVmR!1y;ig`hpkR4Q;gF2TG=UecU^l=AaY7K0D zZM(B1b<%TQG}eg20;g3(<))x;GzCvRIjvEYd|v69m}S?5??YPv z^|iC$zaVB=lWhhO{60j2Gqct|`imR<Jt6;&lzi= z1hPQG53Fbxvjp|Qa;8Is&;jV9e{!A#ZXAKo8xpe|jEq#90>i)=e*v|NmbMwlb6mCf zg%mc@_^)R|C=hyfO5MH$Nk_p&`IktVPs*pJdK;FQ<z zl(CX4zxyf0ZE)JC{ayxBrF;6oD)~=bYMOgUA8=HuiOgxdaa3My^Ecr}M`J^1;3MN8 zBO{ZEbMVxY3Zo>uYMqzV*ESCsz|SOQ|tu0dF+=EsxTmkFL)m z$TBzl-D3RvjzOWXj2Z52Mvep{b0cL~&+R$(_0pNW)R70Z%WO-Up~|(1z2h;)u^jY~ zRxsjE=ATs6)Pu4fL7Mn9Oj6>y{>XdP68Z?4tOYYuLd{my7E9hRuw)Ad$FC&y@$1KW zBeED65Ggep&F4V_4`p2>)NF91{Bg*GxS#*iEb-f^GJ^aN`LTr*g`&?KK0zND9!V)s zsQ)yQjPPgigtvO-NvQ3p+F<3oG7uzFgd@<_mK+5~8vjjC0^+9%kqtJfM2Yn`Vn=tL zU89og{82_vQiBM=2x7w}M%K1*^<7urxt(Lrbif(;r-*z5nv1MIGFgza1S3CVJsOis zMxG_+0;fq8ZWD){Y6c^7kkt`39W%g9sABaq?(3}Ek&9m%Co_9ML!BK&0DTm+w8y0O zgb$|*8Go6i0->+6r#%#mC3=T7Be&XBW^OX$8VHwqfSl;-6VvhmM;$qq!K<3FFsv1P z=hG?*I`kV{4yA(-H}3QCA`qloI;WANviJ-xlreU&mA;@jXN*1h&LBO8IL(pW*nMv;aq zKJ<%3_q_YB#$p-E`Lb8&!R~1xr{;54$7lAMOEqNL6&@<6X)EJoG6ZOD1|kpf-{VmS zwQe62xL-$CzSVi*YV}5#4)g4d0DhRGtKbfEv**E6B{q5JBaJRoe6JdW=De+d&&BoC z`2~-C%8V<@f~SxgbDhPjxBgPebcBUG(fal{Bl*dq?0jb2AGEDlOY{ujI{XwA% z0ngdf9_LI{iG><=U59N5x;L`1^2NvkH69jgE07(p8iY(T=_-xv7cXM_BH2jap0SXk zeRbiUR>Hq7>}EOLXugDy=0C&zr2(_yC}<(a!%XU3i8ZoU^AGoTdRMnw1|gq;WJ?U6rPyk-i9{(vd4 z83@1vt#%g+z!}wlS{t5UoiZDI&*yYkf(Y7M5YEjQ2(6g5c#b?3+{qN(p-hh!FBNaE z{K;rK8LmC!+R<2df`%(Q96|Q8+{S`m9gn)zU7b+4ruKpHFs%S)M1f1rr< zycz$TIb9T7+RGJb%#!3d4OM*GON(&$1WEJSQX#06?WI-SC z*1Cl@<(31s2#5DdiHK3$9i6sm%#{LC+-h}XGiXhKMoe4rC5_E3WOMfN$dmm9hv_i@ z(~%+Mo!mU|6OY^x{7uki)y)s2lZ?!2YtBQt?8aOQdmrsE79ye$gRkoc8}~~er@!g1 zGsJVR`V(wD!B~Oxv~I13RGlug(4 zz~P8b@wbfh^xA_1Z9hFczVL}fCBsrOIoQcU!9SwY38n&A_gZN3{jLpj)kqV8yNxTG zE;0PEK1A#2z2kg!C2@t4#dsYru-wr?4cj)Me}|9#Yq3c&1trtK@QS4w^e#{xHg@j& z+pWXSjOY*hUoHPPooAjO$QkjAe)Gh;e&C!zgOF`h09Uohd zWq3pik|m;$4Ka^xqS}nu{Qi;tawyv!QePrzB_`dMIg)8@ByWiQechOK@qq^|Z8*C+ zvU+H|u=9ugvg*Y@95Q8$q|rx4dYD~ydu|4sq}d3R*xNI=Nac9Tq5C;e0L%TjT&SnV z%Iq!HJpv&hKHx5B8{5G2XvIcI{S^90&vZ}J{N9RL#~0-4<8n8tK`dMe%60Jkn+e0I zjc#b?7atB1Ae?}#1cDp<#~69f%>TDP*5UGjU9>L@@BE>WA)JcyfnVv=#Rbt+^*bKZ z`HzN1oS+8?<_^B9+MP#-C5_NWk^DO_P1$UMm^{Aw)IkWyhmM54;Nr7cO#8mDIMD(e z`4sLaX}Qmw1^6RPsynheyG_Ppd;)?F@To;9fh~wVtfq#0Al%J-FR>6tL4{Jl{MsBZ zl^(d-%RKA;k<>soH=ckiZmIMNYgOz}gV+0#2}|t6tkbLeJx4w90ctQXCZ(dnb|y?; zECLB(@oc+07sBr>qgKQK2QSSiK3>SLs{S7qb8A z-F{&7x)pM!D187Sn0MykCS*g~cFpF{i$q059d0rr_u190!=jQJ566skxxHZYI@KjG zbfe%NGz=JT@*2_A3JwaxSG%0fTPP`b=&`c|45MH1OoIDc42z;8BJOcgZ)c!yLJ-V? zHLLUlz8fJ9w;Y+0oHk#>{%JI=2&(HB9red#Q!y)}yruuytXR1`6RMf_{)L|ny=QayL5 zGjdPVZ?aLO?kAS?q|JUBOzyCXCGNW!6Z1qfxwoOd0>}?%Z^TLKmV@n<&{!*_31QwV zr(K&w!&>@0D<7D=iEH|4ae&jzc&yQ2#%+f+gcU!Dj~!asozrHlQ|2ix#7mL#T#_J% zJF!&4;Gk|{-5;R3EOilqN2kTF&pSWe8!uQQCr>lB+9q(NBqnVfa`Q~rVyHs4_Gut~Jaj0*69%FE^onXH zr~1PU*KN$^tE_@}pHxr&%x5&r299&2yi%(BtL?0%leJ5=7uxttmT+Q=a3Qu%?ImZ@&)K#EMbiGlb=4~Bqqj8wu(DmT&S9wO6}4?$ZtD%ZZl9J_0hRI z)6@{)0)bvt2jMW@9i?AODk?}QfU~$H^MkVU2?1?MS^ipduU^ID`k_$p?NFQN@7Z4m zpD#Hw-u2zJZM~PQNacF$RnsrE>GwO+T1=@|nICAN(g$3w>q*#nR&U!`Th4G~lQ#w4 zyy#Lal15QZZ>7x%+CBI`w#_BehX54M(pF2*s;$1G$r=0IQ3cT~=VSe6G&w=PUDlH( z*41J0;HB!gvFa7jr{UWEM!9jKoxZ+z1W5io-yI5U?|hsEc&TqvWCiP8q3V_cA);bP zE@a}+M}rrn@~7dS%kr`%kcrR!lHH)A;)pxq1$Fp0vXlfAZF3gR`(p23ylN05z4x+B z@Gw#Ol~~7;iW6wxv(kLOCEpm-77si%DzQY&sAO^JxhFcb9-F*o?9Z{A2eGPlr$o&# z2nv0_hJn3BZxprs%j~S29(@@j&^|FoS#rn()XT@&53;eCT-GlajIBGW-@xCh@fxf( zRS|~I&h6Fx=98C2r=IFkF>|a}35>_H^1gafF@O&vh6$|FY_$f&hV&!H7q%O~+u z{1~+in#px>ML2G0J5NkVS|!~%eG9c)XGI|sxr(_GUj|F~#9G_*P++$^yP+9rUD#Fp z5@W`tI#5hy{{jI2mAnc40Wb|4%5iN&6;!U=J|(q;DqCGIQNDbvZ-Fbwq*#JuPttbw z5h;nWuqq+`?J{%%+b6Wu@^pQZNcG}R(am_h728yxa_!9T(z7DFS@it*V=fbJ?gd-h z;Gw^yhaR3zfUHen(pnoVF}u#}PXD~Lp!4*3$u|&C+tQkToj$P zJjs>SmpR&c@ApA4uF5ORdQBPsF1do}O$>X{s5}2tcfw6}&`(W=vSJ+m_=h2wO!*LhUpv@2$Z8&3QpKgq4xe zZ}((r-)X4b@du)$5VivXY01TV(exV;!Dt}GIb>h$mE?PHmJ ze5+TKr9mje2;Cjk@gMh&!w3VMCLz*OMJSzSZxOum}7*h5IUEBpq*H zQ4eu-w$ILxxT<6ci;RG`&}KVL&?y=W9RMbgANA@u?G+b3$u*S;A?hQe*hIG#V*n1_6Kvm^(rAD|NKhAo&(B8)2; z=xNwFsJL-zvWGDF_@AwaA-67yi!5X7K{B>rf1089XV&J`T-h5%4F5y%yB}0l$fXni z;nJE_%7ZMk#uGnUWCHzM@J^s8Nxe@SfN&tI;+``s5p zal!*Wv|OqHohaQ^REGDbXUQu<msVwF5T#^t@om7fiRhoM7e_M18oQ4*YKggQp>ADv2IoJY+}^G9xo^Qu#eT zelL`<)!fR7sOscg>I~0P{rlqr@%Jka^^*Eqoqi8bEG#;-5WgqMvsCrKFNU~`Av4TI z>c6o2xUnI27wbn#CB9@Y_`ekMC-E_rd3mPe9pe6UY*2Kc6DrtT^{1mMI6`Zvk!q6K z23e|Ha)eL507VpdqzlA53T(CHoogi?_@FDRseR%>uc;%*w}^U*I0Jxt1hT=ZwztNe zNUk&_EW|ai$^X;_Y?H^Q{6Pef>>!2Vf7`t;arvq|I>M^scf+2ffiaEnPb|83-AYfD zlPMc@H%T}7Z6tKY4sdTMfzwG!LjEBW0Y=xn27=j&8urpxB_T{&JLcfz>g}jXjiGYE z@}lC;0ILX+CADX`6%Hhs zHq7Kq1vpaF;JAbE%*>vcp^FPJ97kwz>aLHxu64>Uy!=*v7_s43x;4c5EMWxgVur*l z%SKSA9;gQK)zAQKaulkRgiX#{M!U>uGs0B;KXed@4!8ebaR7p;*(eI^8Q<{dUt5qE zD&o^<3etuw_E&5TUS`pkx^iqc?=I|3;wDBXR6X?DENd?%;vJXP#tva4O*2M|YeW9^ zw#VG<><8cX5Jz8#A5O3Ccj%*7JZQSN$n`)LNiMv{P9u5y$N>BY$z?aFx8dhw{bY#BSD{uiu43t1pf+ zrpa?}n_v!)_05E%e`{7HQpoMpV`sQT*>K3v(q@@YYzGZ{x0Q{>isDmV^_KQOI|Atj zqwmDasJtjYbRKtL$nc&DHt5Cb`a%>yO%QVgp`=b|O9$H5p-BUQ^!^yh2)GjC-nlCy z09P^yn}VtQ4AyiPuHkNO0FEHsUrBnA2~}aS{-Vf5M}q;p8&(Ir-rk`=z|&?6nc^k! zJfkV8#P#?*t)^9nlVl}O&kB9S^UspU*oy3HT`T~+A59kHpF89K>5_1&VKuwxDT5Oj85&o{$3S*;(pi_ zHGJIqyth@>>?O$wdYo1@{_x}{(Q(Is#+T=T3CNlG`<_oJua?F4Bj#Hk4y^hAc9Br% zO*`*WP6CS83-x?vf-$VI-Js3LP|@y(na2jdTftC#_=@w=>RwP0^f@V8fMTH{h@JMu zEUS+e1=#EUIFJWHsu}tG`TXeFC6W^^7#I>0uh3Z0ir48LJb+~8) z7Py)!bcRh9!r5u}Z<$mzpA#gb6wW^EvIs@ww_Ui~_=SC=Yp`GlTE#roomd_47kCzz ze#8}S+y^MYKn0?M|2c$Y{qK8;i4V8NGAWPse+3w`jL$}we38lO6J(>ssgZe0{JMPV zCR4Hc%Bvx$T~dY?)6un>y7Cr6P=FevwZ;)tvLF9k`yf>SlZKiA71Uzm@FQhTW~`HD z|MpKyV{84`0e4JQe(k!?=gof<0aNVdu1|@>Z{l$HpThzz8+f`(i{)&py!QKwn%3%K ze?A>je^2iG0$e-)&Ds?Iu{P9a-TItnC%rJ{;L+vwUrp9!F1t~%m+YMN*`uJ!ZOo}$ zdZ-1Z7B}wV;Xr6glA-F!Cmm`^4q4EhgITEmphL_*kjHl02a`k9B~YN-${J>OJ88)!Y4@-hmUoenl#P9)Kpk>@hN z)zwqCeu6h$NRv$|;@aqd%g~MAkzoG%SSHOCA>!OyocIoXE?{)pUs{7B%H2>#=ED>6 z>BrR*o#!F_1r9w=rS+;lBnMR7|T2KQ^-r9`g&?lck?kLf@qvl;9Q zCHQP2tkODV-G`YjO1SgV17%L9R;bK$aVLLJoaL#5OQ&T>iz+Q*PS9B%<*hh_Y|ii8 zir5Q1Hl|={aS4p=WGB&A*-s4VM zCL}}1geF+RrA;@VNpPwI#9PgHL6B78U&*@lu3YYVHCLB z6>$yl9NRL$m(_xuY8aV4Oz{HmW_Ofi^h?uXv^EC#l0%5)?4bOGWy>O@}762cu~!fCLd;#Dn@9M<^BX(2%8;7qrPLJ(&%S&!r0)mysDKnAeW@ zy~>TT-e&r_YfVar0!>@i0^~;IY9~JzIG;zBz$#UEis0-mox_q9pDOyR&@ZR|o-(_A zlrfd`PNDZVX+>V>V|oiG#yGg#*MZsSl)_Y1&uX?O%R`~vMr@?dLfE*g$A2%yX3C6B z2X`iz{(I?1eURl@`n+y8z2~c6cjU|1a4QFMGeV$vczy`Q``*fg8%3CTq3UkK6SNCG zMNqLAA*YLu57+k^fOS76lMA({~|4DbPq(zf5_=bKI;*>kEO|gcpkVk|J0cO`k0U~tQW;}H6MWRh++?h z!@C(@#WE-|v(5(v{49p=<%jyoSieWwJX|F;1a7G)Ns!v97`~VPLdpvo^qVGI#`VT0 zOA%ZfAipD63;2DJf^gbI2e_>j!JQ)2!v~KjgGG7C#w5EQsT}DT@Wc9CPP4*=PE#+#@^}5Z@lR*;5f+8V!D7(>nW2>7>kRIiauw> zqQ@KY0|H>AoDHX*2-z*BPD%h6g(-=4*TypP%AtRSZir}fa9#vPp^ zx1kdme4zP+btPn!cTBB)#C`Ic7Ro*S+)|3kt?90LM< z6m9E|xC$^XVz)-~K7B21jaauAfA!*bC|j-9LithrgBL+8G(7Knax(dHIG;M0k2^AQ z&3s&@fQPJp+(Cyv%etjr5+ zxl+(aMX9R;^htkWMhH%fx7J6pP$-8KqQe~M&9q&FcosBl+UAOXCz#5^in*(vu_%VQ zz0Ek%0^>Ow#=zKY#9`F$qRi#3M6qa8Zbd0M3_6X98F7?%dSKy~Wm*~?yeMLq)1WijS~DHV!W_OF-ElortP(0H{}P`FQ`Iu#hYIm5R`*CD z?@yVI#EMe9og{VPNByFkf^6>B{r=|iWdFh&w>WeM{Y1;)0GD6@|N8K+La&_ZIDvdg zv3VWLT3k-!cW5zyv$mP7uby|5#jW#n%tU$;NAj+a!W^HYwR!4I=L;ec_zh2q|0RIPKC|JcQH4{3W;0D>wgw$WJy+4|J&q*cszT6 zAM00}`dk!KR`&q61m3?nd48m-RfZ#${K<)@otkMdq>qTOJ@>Tb<2nGAmeJAC>9jVv zl5F}*HT_uYDCF2`Y_0!osWt(;8?5QqrN~MEn2i*QY*QG}z>$vDfJ!8h#fgKAVzeri zwNxk@EFZmhS4;p&^H?PTIHD+pU??9~x91gBuF@kar_q{`Z?K}8^wendrej7-!pmH) z&mBeXu8&aW_;aWqzR~65YJUO(wSAW6%fEtA%Ze0Qx(}Pq<~jh*;N#?(p8&B$qR^F` zs+J&)`0jK5&h}V1>Bx*vBq2>`UBdh8^Mm~SeE3_TK*g6Y+W-=2Tx#m<-oXC3bL0LZ zZsX+-uE0V%(gq7c`sL>ngEF27l%J4}%6p7L(6PcEX8HpR4^eMl-HP_K@a2E|#*66mne@St zMdzuZ%FA+VH_4Q`FGQpwSWuT;xLLw;BYK$WBRUSN&t4cV~jWU0W!X4{>#( zRpkve=%rXxLq%tNS%wM;M^JNcU<0r~-jceda2m4y=3^r$11`jwpRer$g5=$&XJm#7 zzg0hHl65zq0{1(>V;+6nI~5T* z@Y1f^m+#mxd*5iF`J~wXzTbrV?)No^<8?Lu6yEH*W9JnP1B|IH6r;;Cw{tfqfN5S_ z><-XI9d1r0?lCQUz-|rC&Ds6A18ecEM@y&Yj6*@U_=Z@?!os3=s3vna<u z@p!4JsQ{gn4B*ARt)1qw93(ez?0RzF3F+gfPh4K7Hdy$o@Zj2c|L_A`d;$?}Ue!0kZf+ z>Z7rflMgn+w7>X5-#d{O?ew@z7={9jU^HLK3d^FpI>Bw!;7_^lhIyfOwbSeBjNwi6 z^t&nC4@Kuc5Iv(`8tX7$uNb~YA{DBkTKz$(S<xslg+T6_kO>%)z$GpYlVt3LSXQe#-G1%QQo(tdB8r{$5%#6OIon;^5vJ0 z@fg(;*WUzUbTX4ge-jvkwle^H>s4<#O$Q;wz;h$Vm<7(LXJc;_@?s*eN&koI^VRHZ zVuL5R&C2;PYjjUBuGEOP;MZl#t}@SfLgGXT=r*kAD9AIruY+PDn8$0#;s7 zLbIa39~AU}ptGA)8yhzjltufNCS<9Uj&q$_#UXKXbC&^l{mxS%w-j!hhcx@=%Q2O1 z5v+UeIz*?nHE5xDH%>&hI^ahe>5^C}8MK$GS_TQ}=w5*60caHL*!^)yWH+Kf zBX6nb%?-0U+LyiO-^y}8jLT;~kg5z&VDF}gxmiC$(j!sONKZ0iO`gM*_4!L z_4veiTb~gdcPqer51yHsL2_dy)}BPZ#&ibFs|>UBh}Ej%ApBz!=)UaMZj15_eRTnF zm;{sS^TC0BKV|sBj~yyLKG^mye;qez#GvpN>pka}mzO8rKQ)etVGIvQzq?)oOuG$S zRk>mb1nkK11In+|SKhxS;q~kS&g^h`0+$lj{ukb0I{c+XWLu;Q%WI!$Spi#YxjiXW z)70c${}3`;i3$O&VD8xi=*zRh!ye73=aJLN(!;DaJB6yOU^F5_V2-Ex#7SK}VEPc! z8d~kLUbf%eO^}L*kN*!4uPp$z49eBwCS!~V0r;N#paBn!kkHrX1)t0vyV2E--@hYG z6IKoXRl^TcM>O|EsgRL^UVpe}mFYK+i?oY{|E9Ro{O!FHb}{S$Es^}E?OP~{o7g`y z0DGH27K2quQ8rJdqq&A3>q0~3W`#lgUu(3;NR7Q5FFo)|0F+&0KOa49*8mO0qA*zi z76g2Y$jBso z2JK`R(%g{~4P8k-e*746Q-?b=wW+M7MF83d0<_c~u#H_p2H>k^FD+AD2ti+^2!P7! zDIMA;1bUMvIYCjr_}X=+g%I7RABB16)L zLQhX!uK}EL4~NeICV&U#bOukvZJ3#vEr3R5J%AHN&CD180h4lyF_#}wObO7fcXoE} zo9^6qE4i2QKnXD0r|nZkg2@p{%E)9f)6t=T?j&tLKeK>#mWj0D;#3C*2bLnr%&f*m z03{W4A(3-)69A28;3r!X%Rt);0zc8$C-Z9VjZXkC{&;QhO;j&zmW@p=QCdbOj|L2g z|4hkmz@h_yAOCB&#Hv??5f&B(y75^4{xqiZx`Qz8v*w3p6f(*y`ajV+k`vzYy+6B^ zi{1pV@sF?nx=&?D9T|hmn7%a7BQtq_n87wGjSoV_$r(XVGQrUnEusv?SDe?h1-c zf{ksKxAt*zZMS8O{Zj;`~e$zKasx35NAEar5%Cy+=LTtvdVquH`llgc*;SXY@W zuN3CqIq8z8t;nX`yS8!h>olElyr_UA(FVu;o!Sh*vQ3Zd>q!ch86+4*%;SU(I1*t& zChF>(d)>)Wp0!ww7igr|l)Pokv`3>Nl-}1xZ`!7(NJJ8Zjgc*k?&v2yq4W4(K@4`} z-519l7x{E<`t!=)E;jDhiNiwviR)FiHyu1MF?B+2T%RAJ>xpbW5D4bUOBqScc_{;{ zLO^}0PzW1h^leO3*Y~p-GVX6901q0gvHQoNOkS47kli-uW)N#mnQP=DbV$hRCm7YV z4o5t^e;>2R6}gh0i?M^CnnGCdkaz@p39||>EoCAm891Hp1|)wZA#!A!rMOM4}Ru5#55|)$8d+vWGE#vpU@lDS0QCC}}1Lwg>|z?2J+Bee;Sp zfieixSZQl7?P1^GG?%bvDbhh7MFiTnMAf!j8G0Y5-(jhEHGoJR3GloyBL8}(EVU>U z5g@L}q}JrbAm)9|wO()c)?6m56dWV(%jCS_9jl&Oz!Dp2pwW0RG&e+(siKHoE2bhuI z(z4^okWX~g0e(P_vvNnxT3VNX?L2oGH)7=eQ8(Xn$e+R@>1d9-TkKe_55fd?UDBom zcZXrLjO=XCM6pxBB_5u@`$u1ZB#oWK|jsQ(x) z2`Fu5Z2uS$?y$i@6)MWl@2+&@NmAEa1sK%pvvoRHQ3=*Vy(7D35=^@$z7_ja7%SME za8A&C!g8=vHs&_cKSF6pODELL=Nv+cO%bro$6$SW@}|AL^aDk7ojXbqT{spv268ya zU5bg^4sivjfxs0ZKb%yxDaBfUmF&>jMe>?L?HK1{q9iVf+@^4}-JhVdyT3jAr+Q9` z)ze&itECGm_SZZ?IB44Pyk)r++>Ljis4{a9v@6UVFN@eaFR(=)TS^6h$;c9&+TfDN zGycpFHAugkzsp?8ih2Ak8unK7)1pdzA`c7~3UZd>+R!i!cuJZ{Wfc>MUz4c$MxkRb z4eZTK>=jC*u_4+(f|#s-TI)%0o=*hm#7w|u7*0Qbi>28x3z)c6b~IV&?FpFii%*Agucy+QI)iUbEvmhb+wlXCs5B3A=RU^L;L_g}sDFFrh!c{cHW zn^8D9DUv-94o7PPDRB6JbvF9!iGn?9PvMw{d%U>-D!(K>Z8$e@Cvun1ay0wZfAAU^ znS>AAUGW+#VTZGZit5We8w2ATUHq9?aIHr1k11Cr z$j3roy&aAE;Dgt(+$V$5=im6Hq5>0xN;uCjz{=2=qjHTt68>h-k-n$FS)ZoAK zzL1x}vgC44NkN&73}L1R_3HlZ*mKSr}T=po8yh0Y7W7> zdwE;AO26&l0ToG2jZGqa?`5M$I(Ttu_{IB2PFYX)`^m4c_Q?UED9%>E9h1=52)y2nf!#!kY} z{Ex8h`{y{B=s{Ara!$_VZJs#7ds$9Gf%S4#^!5H{eLslwBw0QE;<#+n@OfN(YG6=G3MXiWG%!6CHdgC{ zIyX4@w)g$hX9vvE_d#~t5vHd16R9v}(V%{kQLevBigC|i5oc1SUwQv>E)eDE?Z(PbV3VB>IgD943!G=Y#LLV8vgsHSA2W?>X|m3K?7j zwadY2kU|v?GP*^sY*q%7V*)CNLf9-GWcmeowrlN_80KGkqXXGkpNpi9@LYREkn#a5 ze({x+QAJ!Kxkc;$Aa2z&_JnW6BA4; z=55z1_v^Zk^>g-7RV1K^$GzOn#|o7k!yDNEn~0!!sT>H7QDwoy7Xr3Ye-nmOE3Jv@ zr~ia_r>GJD>qz!&CgS^>TLyM6$layR3$Z^C9Tz^3$*0lD6CmONK;ok<`>67UFFI~N+2k2Qu5pMd zckDS}ZXT;n`{7si$Tc5A>c$`Cd|N=JjchVeb+6KPP{KrABTm4Q9jF-62NmYzY4qGQ zfL)Lh(mV(nAe{L{?>2XRH$OMK&5IjsOn#@5m+R*}@bpi>@c22dHElkNw7fw9mz{Gl zS*<6MCpMaW+cYQp?7M3TWgBG$0vtA`@nJk+<;))0ujS0h(y*$Pi{d|K7Q#YB40~6n zom^=k(%o=L%p9IxGP!qvs7Y;rvqKRwhM^AtYuTe@Pki6o1gtysqI6kiuoTrnegxAE~TX2Mn@u$X5UNs&gl0Cb2k*VCzmmg1z2>G zx7T;Ap*mqsmW~=5t4UYBuZGDJ<)WJ;vo2K-+E>rE;E diff --git a/samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/images/priority.png b/samples/server/petstore/php-slim/vendor/container-interop/container-interop/docs/images/priority.png deleted file mode 100644 index d2ae7942a64fc82cea3b0569d1efffd8d884a269..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23031 zcmce;WmuHm7d|>Ph;$<%AuTB(-JwWGN~a(oDcv0d455T{2uLH{Eh!;g(%s!~_PoCn z-~S)ZT%woE^E`X)wO8Etz4uJGijo}G6LPF45C{ZIL0 zmONq(gGdqsH~(NlFlA?V)8CQpC+h>Tv9Y7s13n~dd5R1KKF3hQr2&psGa4B%)Pk&u z3GF}MNAE~79#ozEV7a&kBQEC&4Xx#(vX%hcfbRbu^em2^28_b0S=?4`+{r#IIkCqI zCE;+Xm9L0_ufc&dx_?K9Y?^&1xl12*+&IKhU&cpEtb#kv6;Ui$q)j81Z?Cvf+CLk=` zUoIY2`GFM*yX(8ypHo#)S$e2#0s#iaj#q*|T}cw%X1;Fp-tM)KP)gzz{7M}fA)&eZ zMQ)*V0$^9QlDm8TZEN-Q^>rF4){|JfvE6f0!7og4@$trdDGog*=sTbmV3u#>A!+3~Fj>VjtZ}2O*zg*FsibU$0&7_=1i2 ztwpG`wBM%uRy?CJF+{*&W!w_$2?hq9@AZJ8w7K~YdjSebRl>`!X=yJ%4kpom-q0ZEus6*W8xvzcQ%gcY!A9kCWvpsoaB%*5f38+p4+M{7(S*y5!>56> zP_a7+buBIEY7Y$h_3Kw9SSSIb(hxH32*c#1gPtaFR;kWyp@KU$jdWwB~e7tV+*;CYFoocKnIkHh5 zdoz_4rajSowd5eCm*6*@ZI2;9iZn|)(nUNo$F?~gR;10$&5f^5)=9;DgdLrn=Bi32 zIZ2!q~{+*o5xFd+KcBk(bTLQa2%izaKCMG6aEj@?eMwI^Q`_UXZDF33D8a*SU zXSdVq{I)jnV-Qf#ogFJK_Yj~fI*`WUZH!$bzbC28~KbFUTsuleF zDWRf*`|H;)Tr#roKs20{kt`_^8N6X((&_8 zHTy)#27+P>QV#LQj~@`fkr5RzRXR>i++S>T%*+_u+uOjWOl)jHoy$kszVF}T%SMv= zXJ$TM+t{EL5_;y+xL}$r5r}Hs9)J=sdVX~SFtx;fdpLVRGBe$wA_gY z%=-0rY13{!oMmj9qz6iVCRh&yi82!M z;o91s{7o00+r9(O;tbNZZ9S4YYaj{)Z0ZpPNg?I1v&-(uh zBP#bbJmU)OuHRA5WZc}`po=6#L@x|{@14Ofg>Uw?*@%zV;*}$omW*KQ79bHpW$daP z7G?E0O<8n1`%_p}M&df}5Q>hCO^hRQ76Vqrp;gnsfc@ie`u^xI9@F1Xjk%M%3?EKN z9H#VL!$A*%JxGBnjw|AEX34!_K9GP>IkQJ}s-`URLQ+yvH~|L-hvcyNGJQ&v-LORu zbRK{UOm5D$vw!`1Uu@8Mpj|rt+!^8#$f8}u?0s00s=aC zI+wWt*LD}E<_KS0x1&)LIy*bV^NE&$Ax|S??D64JOx4ivuzFZo?7oVVJc?>SIfd`t z*Th7q@55=vO1kI4v0x2H(^0^!NF06ml!52F@u?~P`m)joU9cL2cCGg{1w}=t+KHXZ zxEw84*;ALcvsIt6i;ESD^&2&%Wo11Eow_yj^!6%BU%X8SD=+6PyN5+b6Wg_1=fQ8> zG30aE(}tM}JMXB2RV1r0>%)h44fOavdJ61N(7_0rJueT=S~ZkXy^I}=xw^yEI&&wi zxO05D3z4_B)PNsq@c-!M>AEqx?3XPg=S#xL`ME;^Vn zEr3L9`1tri^a?BgJP(P$Yh}N7k$B3`x4G`5pSAnY=Tb=Z{d-!luyxycDf7Ed-72c8 zG%YtftawC3>s-S`Q?-jetUmX!GpE20dq zlkg-i(-2Z2m*T4)u?HIXk^(nKxBA@AClctR=o%YmmCx9i3?#fX>5F@@@*~jzzoMcd z?cuUNJf1_5ElAEzRb#ivzOuTyaQZ?4e=P4E z0jOmiX58VR8rB;+5vfIFhsja7cj@CIqo9O4?@nT*{9ypTzM3fWS$~iKkeBfG@{mNc zXd=hCUqg{Of;Qc41p`L>1HM=wR8>EGVCLrGSrGdQ0-zS834xHy9xlkYvoQCa@t^Pl zkfg}K1t`SfYD z5u}EyzWz&>gZb@I*qb8RAJrz3OgxwYb&=Yf6a)6yoMfOhHXMnw`RW z#uo-}vEb6OMhsIE6KN2iTCEj^k2h17jC4LQvJ!1rO3*c3=b1{1NUE(fczs*rYJrSg&IlRV^*XhqHXKdZ^F;Zrx0Cl?Ei? z*4AO=%fB_+K){W3N{CSd5#s2xN=r*+4oA1YB=J~ae-WgF-w$(;(}O*mu6JS#2ngW( zI7n()tpmHXo2|llo5=1g##!0YLbW?t0zin{?SAbs2-o`CU%>02i(&dz4nx^IAFgd@ zexVGDT&DKK57yc)M9|4aKNk=n1$`!zZGei4L%(5sp|+3cH1Ays94Wz)h-4(Zy+sg_ zkhnhmrH9>HTDQIhP2T-x zekXOTz_KO42>fPjWHmJtrdm=391vk*4+8xI12jQf_@=IS)wK!t-T2N(g@p}5DQGAt zfCgn{Wy!yJ6EI;Vqofo)g_HZ|V<)&L41<8-IUOAmdDQP50!MG}W-YWmKD z2e1$830Mn?jiEFsAQC3$I}^Z(F9kLKU;vN-z)O|R%Y*t&s=*ZgVbfLue0*F|(y-oM zdEhLjh?VI2A2N!TmQ45r1jdy!-xoHK(6EhGy27{SYB{QOO5{TK@XP0%_W(Tt z9kl+mDK2bmY*}@6!ZVNNo|}`C6Z?z34}g%8w3$Q{_|Mpc^qB?VA_DaCc@*cnQofY9 zID`Tl4K$-EoM>FciHQkZNf2js-C}Wn97W1ZSKmMCy6AB= zvhUYDOdnd1a~gC4bC>sv^-K zYnJL^0CfU%9h3Pw2a;wlHC2l-gCU+jut0g1=%1zIyMsV{V2S07t=@;_~vc+x2?l z@hVIV4)NsQzU^#%ytiutAQKcHcwTdXmS5J0J~xI&?d5lUx@iik{nf>s9lX;o1Dp-) z2H=tH<4|h243v0zOj)eilKK^`AWl#6N>`s}1i*00qSv{eBX6g|CabHfSE{EB2tds~ zC$(b~6*Yjv8>*bZqCysz!+&t$W|_D2Z`G$UY0zP{tF6BEBuV-?4gR>f@qhzpkEdrC z;&=Clz9hs@8Mv%?;7_T)s_1=xK6Nl!u0K~+TugX5?*s!2Yj8_SP0jJoZ50cK*Q239 z+H9-=P(^=C&1_&)3ofJ@-!T^Euh~(Iq9fET< z0E0aZ838|dMIIFv6$KY(qI(>MhlYqjQVw?m)4O&iiWUMh5pm&yn7O&R3BW@K4td|d zPYINc6##8? zaEt}zMFtd~u-^FHI7Jwh2reaM6hNnhL_`v*Um0}S=@lg9<HUk3x=?aoCD0ZD50Fw-jcw$3uQq^&hL)pMW-wv}=b(}x z%_=k00DLLdw2r?8*alHX)rc>JqoFKHj7K33mxw4BV82umPhv1SsEh6G?d5a(26I*{ zAvIk;rgme$e~$pn99&Q{W9pUl85eKp{#|7f?TOtciCQTFMR?fOi6fEPo*!H@9Yo5&{@RV7IyM8YxR$ouSb?Z;YLlVOR%#PfgNv()e%^U-MRgVd`k(mAXT$}U zx&M0r{MUZ}3EHa9KwAMXDdqe#IjvXxRc9m7X-a7W-Q?Hrj@m|kWj8m&z-~<_b;J$qe-}k ze$>QjK#u4Fx=%2uf!qlA`X4QZQrl05#b99j0D&*1q_Xo9&jwC*^w`9SoZ4M!5;@Pu zr|BL$%zEzY-xLF+DcQuts6lxKMf5wu zlIS3*$>D%QkwMKO)Jb)aTDqlk@kH+J)t$L$vjL2VRnrJ43NiHC*$PME1~0JJQtVF@ zU+%DBkAK(``0%${s0FWDCPpG~oGL5E9OFK|BZibRNYy(BuV6~==H#8XO-iu`)RF$TL*=F5A^7XOAXpdn)eb$#&TEcLmv0Ey!Z2g6p+% zGkqONUpbEXdj2Qp<2h{%N`S(FCg`cpHU4u;?ZJX@Cod9-Q=51)JUaNbRFVl-I z`T$8abQS{--`Sh)Z;t(L)hl{wGzr_4Llty?AjvI*ZV)_SwI76@^7~F={Q8d9w<=+n zSS?2m_8T;~(6+WV1_I-seF6ER^TP~o+1R*dBSxbdWWD6Lm?gh&eTZm~;iRMKV%8dD zTpDf`;|31x;ia7ju4>Oq+e=c;O~y{T;0d?81slFT0_XC^(jDk_C;oTEuoo|0 zzyUg7SVA=1%5azW7@qX}IO@y7D{a1*{RkhqLt1`ZA;J3_bZ^xntDs}I8gx&iKUiplx7;#mOQ!Rj*9i5%c8*>yaHPpiurUh@U{PVc0wrSjkvb!gY2IRn~A%`+z8JW5Z@vZ#stc1a8XlkGoL=FWQ~Dx;lo< zM9mL^0{FC6;lEgT)JM;fxF{Dk{jURiTd&?fSaOJ}D*njJ<9ppYZgwy&9#$aJUsP;K zOG5klb$#bBTe4W#9h74ocCkXB3VizNb?dLm$@W-W)wjtzHU|j1dfz?kj@G-tM0~wo zz$db`Ju%j?FD7%))N_NaUeA-zIsP;c6!|Xg~ihu zTH)lChmTiLim;CT${SjSLBBM){^PrRG-EX{VW?Vd=iRap;yE|5(oXOPI#0>`<2$y= zL)PCXWlpLVs)GFTRy@RNqD=JSfwvnt9c^Fj3lOJW>Yg&b0g6aJ={PImJ$}?xt9$a* zLXnWsPTN~D9WuAQ#LgIUk^r=XLkXWx`YDsHTk1rPN*b&7#ze*MgiYEKrGvKY2dchA zJ|o49+EWbK{GR(kG4{~t;pim+x93t}Y`B1~Y3F3>d-aJKt^zIOkc;T9ahl@-9-*Vj zn^pUx+`+Pnq!TWDzm)uZQ}H(fELJvdC(YghGfdk}t;_V>_)&Eqzu-%w)mjgLuCEj# z8<#m&)!ewS9Ka%cw_%XMAtQTgMOqwT^@s&HKU z8vivyO}hLeqxeG{%)hkF`FIkjFAH}-TT;iW{L_f>fet~$bZ9p2|2Z9y6R4tT9z2ux zT$~X;k*7LjJy7drTUMO$fiMhAKc!upyl4y@@w5p989b(s{e$O-m~tyQ%T+)0xBf)?tDu9kav;NjFKwK7dABN~3)d3hqI zWK86U^`uC6<0s;@V;y09=$Uw?L12tHC6rmL$E3d}vM(%HiH~ z#>A96S)ppEUMNesiIb@4Y!aGh&d0TOZ(4`PJ4LUS9NZran6}?1(fkFm=oJDW7N5jUYZlza-F}W)q&0ahlA0tdt3|*mKMt6Ci@>IBJ;SH&OKOXq$jhkyn zI9G$%RQV9p^8gv54rnaxZ!3r-wOp6=mVRS(yizFDE97(#YOZo9f9LMQ&@!)q9LjPO zU!gGa$?R(~+trwLqsj!+>!}YEZl(*z#Jm{{T+oJx?toXQY2UViWP$JW zxm)PoF-1OajzlY?j%*Q$>SZnIOl*u$`Cu)zm@a!~rikyuCyMgxY18e3!X+g~9KA#W zz2dX)e!zzpX$4)AsoeCkXvP->(syPy+>XjqMyE8Jm490Pd6LUm>~eXU(MI~~cvaSt zu1{!c@56QI{#^vfD(XesQ5BPousx~}EFmZFU$nt-R-Mm#mQu2`Fwp3x9k1pq|LSq2 zE?)NX`tHQIS=cbLR_xo8;b#ZhPr%1g#E&M@Fg?xUz9jqXr}R5x14p)1nyzN!>+--t zzHu!pX~qmvr7ZoDve>gAxqtJ4Cn1$$Q+&U1_WZ+CM4|~bSEskFwq7~L<1EvkI1f@k zd=vAyLIe)SO^&$XnG8yUPM75?-5I6pyA0POg*StRlIrjx=tY-tUucsZg z75M|FE7i*$|GPKBb@rSeVTxThd-$oMyEDj?QeNd_QNVSSNhN=mu(1)_U(XN|T_v)FQo+50 znD3qqfKeHYQcE0{69m&3s$cUb zsxsJVg&h{UnDgPdkc%_{%tqSOitW^jzPQt3&43{1nQkhJwL<#`rh-Cvl)9cazg75w za_Hrn8ccXCvH?3aIbFVU__HN_7Kz=ljrD}5WzH8hq6{ZahNL?I#5VH0g^0)JfjHSr zi9pL71isLKjuVeEWGgM?legBRV$4rPasp}I9+A!uS!p$=$Eq)KPG>2x8veDcQqA%> zQ^uClbAy}-VtL4-fLQN!+zr9EWZ|14(_5WJJSUe9C3`;5Hj(3DBKZ*qb}1dQl@tJ+ zt1a!Hl619?rikP{8-jF+^cX)KvH&KbcvDm?kYpi=*%*s^O}PPk3oW5LmDBNJ^6}Ic z+j@m>@WGQX6zhrN%NB~aEm7THaVl65K`oC-z>R4CiKks%4Vi?_uV)n?V#_=qc`i|A zU3%z;4N+0Evzws2j|DFBSP+r*nK2y`C{zZEl z^c~SqV>G}C%D!%p9%U{5`i#L3`d{3k?a94rhn-)e-L z9ffeU6zWyHpt?4i2)&~Q>Frd|7Ie?ZO7j+<`0*7%;QLMygG7iKR#^L~Yow%?G=w6e zt)|l)H-^(ykGmt#8Eky_M@l)`a4Ka~FIgIoS?Il7S3xOuAtH|oV#;afVOKyT|31VU zCHTq8+@i@*h;KAQSrw&b{VO7*lrkk~|I;<(vPU@^5{J8pPY3y99%WH1bOP z9~AA1AAX%>UnH6aH%<2<+KQ|lk488`Xt`K$VG9CJK?>OyHer)1NVev3k_I|+PRtrP zp`$|<_g;2f4Ql89MqQ#Zb<2dE;x|!hz*<2(>4+5E`R?3Y`3L87&8##NzItN?<6_(Q>e*<`=1C;_D?oDG!Dc43Z z_}H{z#Saw_zXDv5mKjfSmtZM2l}(d}qqI93gb}_k>4`6%i?n;XVL-}X6IxbtQ&41g z+bR6~`IDA|qf9LjzAN+o{rjea$)wY(8>NU|etE1%0;*yu%NT6p6adkSZgJ{=t|Ogs zgE*2*p#Q3+t7=-qKQ~O%o9X|jl+T@yupkl4@YVGz7X?IEE5EKIx^b>bsh|2tx)cNCSFpL2eC zw~W+RKpGbGUvtd!lJ`}#8N-bpHsU(x(;#(AtQfu9C7uxVY0qoQG_lz? zue|JSl244Ymwj2R_X~=f-3S`}oX(biTd0uy6$noowy}PQe2bnrZiccXA{qfv(LWS- z_Acr1dP@+#E6JtjXk%}%BcP$VxX1l+CS=M3MW`a)*Z83>XnN$~I!B23%>tfK=6}cW z{{K*e{%;*BbAJy4PM)UYrcoj|%fyY(;Hd~10|jgRt1QY_OA~{fdg+(r1#WTl@}-9a zP?pvnpj&NuNeaAuLBnY-Pm%ZZo%qKx`6EWyY-f8@<+M{1A}imf6dqe)10sBcC|<(% zk{X=Omcl+l{P8k`)kXe4V@Z?9F#KL!13O2Ba*2Y7Q%^Y`C{Wo{ z=_Jw7HG&JLg@g!qP}RGaZIVrjz{A08kW+WRV2f)Ip?8n|TvoY!u8tN|=rMmL{t!wz z5+0@(1PQ9dffn)^Dt=D#{EUVwqu+jYDHibC=;(VH3)Yh$S(N9gi()R)mv3#7frckt zhxLTzo45AX34!D%rllF$^J= zM~_5Ij}NBcm!`p9s*OubV?CMW{Xf?QuX**Qkt30KXm~v?^wmzo*h%0XU+~MFqVt-z z@A{J(MWvQU%fwt?DP_fv!DC^1LV784f zuE8^o4h4co%;1Qjzg4KXt!^ObQN8=4HG+(+H>vr|VmHRCG&rmP z(*z!x{w9pd5_?_Yz24W0TMp}HUBgKz@5CW2E(dML>tzyLDY0(*6!e4N_fuO4%xvA=RJ%&o*I1kv`_R-E9BsCR(syTMF;zN*UN>B97H^tN zDpC~7`EP0&UJ>>=`9y3Lvysx~EESY=&oq0+JdTEz^LhC0eTz@KJ=$Rn>m!E+C0Azh zkgGah;YM>9qB<=zTL`z-A&lnq2%z$9nuzWXkGQJn4JQLvC*(9GI(qbLO&X`)zTVX7Plyzt@Y*E^84# z<~Kyb4t08D&<~$hh__!kpNe%`a1JB$L@C6k{++d%5v*hAt1$PYGzz{zXjo4omBp{x zBznD;j7hVz?Oispkr`glxUA4`(b1-QM|xbo=6~$(8$m{0895zB#6~M7T1VfVqUQRr zYQGZ?TiBfl38nM7`Jz40pQ$|9smKtdKyN8R-dkpqZJptvrUd1tE`9iJ>YK1=A0V$jF+2Fs5bV z!uWRkOSQteh$lTf9{2SZ(hIR0^c`iQs-5ZG>}<}pSUKaceg8P;#Wo$ykly9a*oz_| zT--S%ce_@MEGG0YWpTGh|EoW;B%@72M&xLc$)W@ZjyU_$Rq_aa{oMD2Y4elMK^4aInxz*p{SiH1{Jrqd%2 z+2V39;HXjx(()Sp;2 zOs#yyZI(tHF@g2OA(mF006!uutJCNutISNoA1WCs@HePKbT)0`TLFO!_v!SI9)sJm z${0k5hD`T?ehdWpBFyf(B8EQIYx5;6KnC1@g!x-7q#OY$3k&;`gBaU8drsQWr-9dB z@Cu{X>ZX_}T-0smu%65qiQB)AlhboQY}t=|t8t$lV`cMY(Xu>Lr^k2zo<;XgEeA6Y+k=P!1ROA5s8%l?f71$F!zaea%9FtI^aWKsdnnS3Y%_N!H^IBZhvFBsdy@U8e3j^E%Xh)T>w2Y{^p>J_9H^U;7~|&;m$mwq=1ku zD>nV(7b;1f8}|~rDnnoCXeuPR&o6hNSWoc2rUu1~8&C}dogc#5u8`HK1<^hA^@~>3 zDFHIT9YIE`t$WdDpugZHd_UB^T43$YwO;U3M&Fnw0G|LaX{1u)R{RSW95ht zUGGv5mhIcV96{K+^HaQG<#P^&H0l1nH#{d|*Q6UAYC~>5H#}|2;_Zyop64?SxXa}^ z_Ul+ro?f-yavrtZ#y*as6^J+>{xX1-``jDvP2tEH>g;@o!LP=J!!c}nLKIv?NsU>) z#g9^buDh}S@^OmS*9%;*SeGhd#2?TOb6U!Ae`1!&oz)$Ok%=KdjLJ$S+vTXU?I+%B zrn$}4F8BU@vE?*SvgI^aHeVvoTQ3)T+xnQzerPsef+D;jWMvH|6)NBAg!lKLjzC4@ z?rN&Xh?!Z`P9#0?Ijf6}7|C!+Z5nh_n?3seQVckDCE)lK@8MqhLa+O>`&q*^aqgmX zEjZ7(W4|_#okHgF_T^-=n^Qd0Hpz4UM+hbaG{yN< zDP9J$r?{I7%`REjc%311r~aY#9{c1JzNXi~8J>&^BgjIBacYC-LlybobqwM%VUYn0 zOt>y;L=@G$?=GsXY^m4$AO)I5Q=asJ2neI2Xp2DxQAtOkv44@mWryOov<7qrFeR~EGZfGQGZ@<*baCJ@E~PzJ@s}T z)|0%Cn{V+~@|2K*#Ag!Tk@)(RdO-HNZ z#76RBu{6+x&(%dhdV&1EQlK91L@Flwz=W1ee}d37C?~yErY(dMGM4PSo z{pvVk2;2WIYOn@c8VScatP14sEJDSlMT35DgB|t%ZMa)S&}Zdlqk0)(>a+7T=2S{$ zx^w^nQ^2KwNRNR}Z!_=NRGE{-ZZq)UwYf_4;%B8)79Sj9u5H|@#)FS27C!pa5E$AB z_D(Wexe8&g8TZ{jTUH@&(Pt~TBZqr~cZDt2O#ToN&=f!@eH4d4jq{Q#`ifYzGZ2NFHgCQ>~&Q9Ihn# zA(oAd(fG39QhZ=Ax@3`87)|4K?tDsQe}CrrOT+)=HXgF&O#XD2z&V-r zzz1$H-gSArg_X#|O9X8JE~4f38{%f)_AYhlkR1_r)wdArjg(og{sTCS$BV_eT?&ma z7gC2EUz`hK*`_4>j9&f@LRp&SQb_OQguvx>B=>LoRMxKD@S`QYp=oSCyR|l*i4!4; zq@>Um5svx8?aA#=oLj=aJD;(M?0j7VaHOo{;0qe&H4n&mhr0DClOH(psIO)I>NY*g zo0hA_H&Ux;T&oePqOIvVW3nIpKdb8mp-36FLzmwdg+vK?D|*lz_Z<+CyN z=h{H(#jDLu>J$5#-ySojJ463_5?P8=H>)*F?@K*k16LvIsK|b zEvilH;5CgG{{8jWYjw6;!P?aj$*qn0ux@oVa_?(tg3~rn+JdoHZ?xl(`_7y9Ho}YF znu=yaugu0UBB@ECN4SAPL|!c=5DS)FcGLSmdgG+fpQjkhiti+i`eOtX$-esy8pImp z4B$KG1-e^QTwZoD zbgng0A!+lH_Q`A9q$O61!XN@|vfKaPv9T~FeFg~-X+TX<@4mkOQ5tw1b|>#TEW?&Z zjwdNz051DClZ9KIR49;Y5xB6YSYBi*O6xn8=7a}jUeaS!h7=ZxGes+5g%E zz=rzQdXiwh%Fdg5UD#Xfl8_GfW-W~rWrJrM26O%rcxgNj%{W;Y=s>n9#76&sDK603 zvrv9&k=W@aEgD(h`%D*%T#B6M(z@Hc)|zS&uu%D_nf3o0lz%hyP|;}N5Gwwl`09

&XhtcB%tDXCe5UH&>INUsL*6G_q~bovgF|s`PB(L zbw6{+eON&ij}tZ+@Z9{o)^cZ;x=?Z7v`%g9c%2aEEC?Ec=Q}J!0(@L9Gx^E^*(i$e zwmJcULTku}kX&<0<#7!zYE{=xlR_vcsBvskar9+o>WLYlan6RF25PJIP2*=LB{K|= zuXccpflpH0jem+c^EgCt7VJ{aKzRFs8E6}b&*u+cWS53shc!G)SWT0*ek#>}K1Jto zM!F>#RZd8fvjyd4df2cQ*Fb<&#OFVES&@bt+7+1*2G?gWv1BHer36~M$OeP+ArNLD z(8zcRWI!Nf9Plp^7&ZNksPi)WcVzcbmvn)PQ1nYrEWqmUJlDqo8ai zOl=D%h&|jmN=K1nnLa)U-28p79RU?F`G55!lEgLx_eqh(_a3NufoQm*mYj&57t;5A z@l=PH`(tP{&9|9woK2dY(;OX4K^U1{StdD1^Z|V@8B%~aA%{%|7Dv@-EzGlinw60b zOoGDmoJiUt%9RQy2T$X5sJ+*t65~b#;CnMo5=pQdn0} znS_xEzIr7YpW2HcT$PuaYY&$i1z+)$O*Kn!m%Wuw2i;D@8q2a-0``-fFZ@QFH zg9z-JqPwiiWPmjVf?lMd>Au8P-rhy6jM9|;*IN`DbPa?y$vemm1x!ypPnf&jrAM6n zNdW@iT)9SajLRnNS;KPT0Z(OHom&tNMbID`m2Cg;M$XL9BPzWfVoA`LsO}LXMySM4`OCb&V9F$rJ9N^IaGaQmDAB zJ3I0CKa*EUNT{%VgiWc3B3VrOVt&YxfMLWp4Y94}E1?mhtn2bO5;&P|yUvHNW&8=P zzj~$QeZuvI|K6|MKQPAqQ3^c_=E^}rN&-7VNG5fAl#)+wg-pmfruLW~shB-n`)qa4 z%@5=)_@KpYavbSdJo>{gLYJ2pAeoCy?!7v<%hLYb>w8Fpk_$ROg`u{R9<^Z2(qT&%qKAyN2bL#% zqhVmh%oo)~kkcT7h*J{;_Ttg0)^j|2Y;E?$ffb652t1_o@YKJv6-UQ?KEKXFTcBN4 z^I|-}GV9>YZPo7Q67AZ?SxsvF-JMz6Dex@@o-?ANu+Kjx8}!@W77er45QVLvpfu4U z2H@h;W7G!CGdR7rcueYx;UtiE1fMfqyS?tQ|G06LGT@$ZdAE_u^V!)s?lWT(6|e72 zj;PN0vtXrEVeP8wJXwOWdLlyu%l2f)> z>HD{3QFPWhZDQiP{k}8HcTp*SsZcXB^H1X>#6``eO4N62a-+Au18UdQFxBq|$BvQA z20-Soe~liAM)S=zwX=n`L_c1(es|y0C$HZ+6|C}Up2gOb>)ASI@to#tc3Nz(VYhBhKpThb$U2(h~k}J~c zLr<<3XZAs`;d9Ybg?hSy@x@sf#pv<=A+z0}_IlJy7*>bMb^z2oxD#BW`xlFA{%`S( zmVxF)IX+Q_h)_$@m-gl!PCqb2V>jN>cH1RxaN)3>C8U{rX0!o6jhu`|r-HdSa60FJ5m=$z&iecawoT z=E)1^CJU$Wi(?7igS+Pscl-A8a)yg+JVLq;CrXFO#+Hx1kD}yy2{QKW)x9~=Yj`&S z$v+8C*RI!D+22o&WC>nApqb4vUQT-j%WyxH`geDC#XVPJjuNOpiTBAm{_`AnJf+_D z*Uv=<-BB#bzFBWb^l~?FTnG5S6o8;roC?QrVY07lnd_No{iR@9dX+7!!S;8Q-yqTW zJNa?_Fthzuj1u^eX4Nx?i!eNLpJl{#0A}z4l@O3$&Sl=hkCLcbE9bIXEizZuFdt`b>ZCE`@6bOvsrAa@$fVu z4S~-Mj&d+fr9S)hgs8~}Mk=kkA3x@z+}E<-@?P)q_hUV&*}d{SWY#w1_>d5JOyKe5 zqw>@g_}&M`g(K&gETh`psz3?Kxf+di)|PB{v72ymvH6mwU)c zbDA?1fkHysS(*P=JNF&bMAz>DJctM?;G@z62_Pc97{Dl95Ca5I2#WL~5$Q-Z0R%+g z6{STw(nF|%v;d)rs6Y@=Laz_fyYv>wJv{H7x%a>KulwJf*~ttEyL0xO-`PFc%=Z)3 zbjV>7`c?xfbS3&HXIueW#Sne@5IyJ(x1Ygz8F9U1=_>+4OmO&O+hXbi;-&|?UK(M7 zGthLRk3+t3XT<@2U-5EZ)|Pbs(;3}J(;BT>G`f6f*n2awzb@c?^+&DAMk;$1UrE0r z4IBNkHQRogt@C}Z!0h*V%C2JHB_)qXt0TUpFA>o`rnBu%UC-Y{$l3my_1@g-bSx@* zFg91_I8=r73*6x04cuAYea4eEUa?@GZuqLgT1G7fVG)a%6DJ!*gr=tS8lrNjr!U5v z-7u9rP+3UaGM)IB^KjJBTlI6>=|8+^V7BzlbtE``FP|o7+|+I*y1u?AoAG1Kcl_bU ztlK#p(y=xv3e;}!VD0kCQN%aPCM&RkAf4AO0>9tx9~CP%!iGXiTEB^5_FTHB(ZgqD z{tTdKs)>alh{W#dpigRaM^%`zLXDd7?PN)w4>QVq+YaVI!~fID!HJl{j2AkxEA_~V z#sld>(?dr2)nQ>Uk2ERv`R+q<%lm_YVk7VUH5T;oRhn60r`Wp`%yKv^#1tXnj<00$hTkidMR;s6_s025$wz(ib=bEN>{NBc_)5y4G@3c;9@Q^8Q;H*pJ zqeoe>>~FHqx|lVCvJRZ(eehwAkHOIi9j;NhHz}L)?11<9DyZ;hid%kpR9sdZsYxLe z9iPI{bf9R@z|Xw36Z7g&Z%t@csR+u!9aP-1|J-f8`lD6(=^3|gJ9-Kw(Y6dBIGa0g z>~MmM_vo(TXMU2Bf(5UuYu`~-kvw`DE{B=c!=dL#SI6_zEL^&`zN`jPIxSZD&PpqC z87+TfNr7R?!DaF_^dlx>_on{oydknqubfKzr{c%w z_R}A@#<4rAF8iITVaMEoHs5+o-Cf&0lB0c^1j$1=*O8i6$bD(rQCJW2Cn9<{q1at( z!a7ww_({W`4X1ZwTVJIE%4kPTVFFgpj_~fG!tKY1i&9tYXQr-NB61&N{QN%q((d{Y zJ#=)~9G#cS;e(@CQe6|JU{ted67HJ~NDVnF)snRm)Msa*j6OO3;-eMtgNSqLRUA$2Qkd99~#e7~xa} zky3-kB3u!m4SI^IKmEp=+&;P0H@Ad8sCwf4n}wc=p-+CL#68gE$DgU2rJ)f6A*}d5R3r=`5S^hR@6Sxk=Y=SAbNA|tVAiy zda~C!x{&zx#&e`A(J>r$1}Dfy(wCt3NZ}9&u1)ZhWPT#>)L8EmaMzi8p)MEtvqFa% zG$z1K8FK4Pm#jb9pGOzUw!|<4*U1Iz+_9;IO1H$iY zK8PTPb<;kDg6s-qD$+} z$*<}BhClula5u*d->-w2k%q|Z@iwrqw;od^!%1)$oI*2HrVVAin7+`S#Sz>|2c)eHQtZ)u=+4& ziZ~^rjVM|0_}=}6N;nff=GR`P9f~j?JF#{*uTRhO{xSnA%bBV3BM}lhYRL=MTrg)d zA~=_v55teKw#{h74wXr==5{O8rj?G&ON$&0qYF|}zsCROw+Jfj>j{Z{3%AX;CtHX@ zgTgx}=s0C;8AW_AGjW?GeLJ5u4n_rHXTXMDFyf^o^4hS|GVyL&YOs)7HK$lW1q4Ze z&R&f>7b$ooh?;8le<;d0QBZA+ zA^`Y1t~v1fAItdv_xQi;s}d;`W-uMhb~SiCRB%+|rsO)kyL9y|!mT!2m*GS(zT?eC zg`v^~i1LG}E*#JA7%Bu7ZML4%RFka>PzE6j%l8>+zhfbDuRkl5>bAt#cty5=eD5GJ zt-CCSPwmMw)Qe3{~>K z02nXr#Cw-4lKwepS<43c+UXV&i4?bLg8N^`8?Eydws^7fB})`~Iw(C!wd&5;Rfn2@ z10T&Rv2jtMpp|b@|J_PukRfI{bMnOLNUy0Fb3G|>ElNJ*>ZE*b@?^yEu>p%Fc9}KL zO9`~%)=0v?TLFlWp>j0xvj;`4atTaluJb`F=4%CIVr^SO%Fn%kej|ELW1YV3vTH~5 z(eDTtdYA~*s9Jn=fFrhmj64*Do)5AEA*p)OQhnJv_CnW}g5qK$Gcz-C>zx;n;NRyXt->3o8v`7c^r4=j$LzV?g9Z34bQgo~MAV+0y^dL)JK zuvs2m2p|~%%jsZ;O&+tH+45z7XQ*@ql4b#Odc~0ezpE0R{8!kqqqq5u#|^*yw*eSX zID8fn=&qMs?qUW4e7@Z%L1jXg&}`(dM2@&T2d__m->9h9GB(!5sSdyMDqRP5P?@Qj z8AYaCTkFkpEZJPU6Bf?TJ8_BMZDPR#PD_6`f?(kO$ zK(GMKqkmv2v`1HSk1!RE`nJ0^xeUUNd489l0f!O$`?avwbiDDkfC&v7;bt4ieV@oCdH?xrjFQSZb7l`d3LyhW4lm=3Zw?bG_5EU{aaB(9?THy)! zZ31-S+|Ml2YS*+Msx&G-n5)d0;pO>;UCR#-n=0=`N@mHuy}*@JPpF)#zi#S3_B5Ui zE#8sp@7PEpnF8Oc7T63cg&9HoszICWo76c;<3v$ykgdb@m0FborUdWyify#R`JCqF z4@7IFOV{<~TVCpn3ucB&hWs1sGZ=Yq-Le^dXrbpd=3hTwI-~cLU~x5YQSHdcNYgUg zP=EsbO*8GwkzsqX95Y5Ktezn1wv?2;LaYVz%K|U}g~i2Q%LU)382_~M{1A1GI4tY5)&5AGtOel3_Qlosz-fNS)ocv z*IRGK@C7N_*}mAkgGh!Ukw}VC9Hqj=th2Loe{82Q@0RDxQvgz&?vJJW(~eoL>i3$@ zOu0&qx~ClPOhrJ~(S z;ILSD{n8|Nc1B9e=FWXxIyR@CfM?$j{Yh}K=mB^b$^6}qrCq?bULt|`E(In7KCDhv z@GdNAI>NF82-O5CjUqTKL@BOV`y8(}`CrG28$0&o8=P*6v-UY^1rxo>W11Yt$_!Sb z%QKy+$AW^ms;cV5jTV(@;hxmg)GFsen9ION0W|$duyic~O5z7lS)AtX!S$AIpONW)wmHtG-B2JMrB-TbYm?)y#wR8^0VP39Ozbyj4;|!F z=2i$FRSk@6o-#qnAsIYXIv#L9-`>pvOXQGla3jbmeX&(!QR0)X+YQ!!T`P4<$7D?c)^K3 zj*pL@&kBcj ziXhRB4ywRiPKO-=X}bxc(xesAqSr%~KW4jbRT9Sk&Tr3fM=-5@R9NQZPwH%K>#(hbrn(hUMiBi$w4Eq&MV_r3Ms zy>E;+-g69xp0m&1d#%s;2oKF z=Xu~CM5i}0YN+6kH|qN^@EXlQ`kfO5g82jX7w!uqCMg6$1(6XKRdY|@U-a-+n_Lt= z9%-$4zfAZ>`i*~372@oB9K`oH4#jWO%gQHrRT-IUnMTfLN+#pUg7sqq>^yw3; z*QJfF-~C0yZb>ON1% zb9sQSe(*P}Pywab@8K-#Z#U(G|L@-_$Y9Vk&?nksV`B|x!~7=$1`khnc6P|2Pt?dU zRjj8gddS@tIw@eE+SLGeKTcb|Lv~wqAid7!P)q z&n2-K9{9`!5jflZ_Mn~(e3U48~l2zQz-Py=Vslj~&+`kJ5;B?*|wa0E{`B89ka_ak?5z~TD zk5w87fByX0*)kq1ig>^)4h}p6zkAN!DB^WumW^@R3$PS9-@kt!h@|}&-S@7|5aNNzCXKXzKW{q zEU5&zi8Db&?n=#wQ1^GsafK`Ca=qrnR%O`Tx2R~eYOV0gH1>9=CI!5BVb{)BY;xHf z9UXPJnb3cHxK~zES~+S06ApvV%%z`caLj9#vKmNavQ_X=fL&rq9C2@|+zF+)r9~if z3O3|jfAC+oxHT##@FF*+xU4J)2NFZhzj>q`2A?=<(;J3E8y6oR(Az8NeYNN&fbUD- zb9>pN=zEGw#^V41*ADDn-Tt(mI%I}HDMUt0Ok6cwB_t*Lk9@EAiz_M!k_Miq7I@TwVWsdo z6%>{1UhyH=-ex^sQx;cNCUu8m$y!!&wtemhy|`@FWc_QRi_I6L$8mCJjpz0ql2vWkj?v>mEm;^q;tv3+UwZQ(oPg<{h# zuMFDA_}vbJzx{Qm%hOMVb zZ&atcre1KlPJO1Ey|S(@nZDNnr>@7w7l=PTqsGd-eS7e)_g#N}C9oNFA;QWa$-tNQ z^z3Y8Pm3Jq>C=xJ14$-e`VHV#)gEVN+f7S5_qKE2(MY*$Ix6&A$ztDfBAImFfVe(& z$5-3J^y-z|RJqOz7Z;b;mcR4Q4u@3L)d`ripG8MUf4KYW*tq{~KtND&sE?B0wXEf4 zxAaqd{Hp3m&q7yM*Pp%0_Qbh4?G!$jlC9;DU|;!0$Mwy}A=GT0C~B%ECFaIIPZzw; zh9LgeXItyA=@wW*6#O)}?3bdLbn3p}%*rSz^nOj!k7#J%`J9wwGGAv~rS(eaiakZ{ z=kTy3C|E0NYaCM2NSOq>P74m>@d9~$!Jbyni!Re7J!JXuD&KogHBC*gg8>^ZT1H0n z7YgYjdV1tt-QBQ={^;vlZ$4`4Zu7YvzTs5_x7r@d!=a?~n@UYHH8nN*d%UWIhXim~ z($}}m{1G`24gm#I9F$xCzyKUXSy>r|##&lLYU&c6o_ybGYK-dVmDSV`lLj_wAJ5O7 zqbLMPR##Vlj*LhFL{C>Joc0NUl7@JkZHg-6E%-g&&(ztbnF|lq+AKEV*Dw2er5%kI zDd%BRQpQF^K%dwww=HhD*!pID`}WP@^pDKM#01sr*H3Zj@yKD9N z%NLiD3ihvGzZ#uykAZp@@%0sQJ($~I&n&+tdj9-5h%=FZJ8K9A@kcOgLx2rilLL|y zwqarK&CG5D#~jxQ=;uvh1?jlbypcQ_+9%=10=H%e`spq!%92`HLUw+Wo-Q5-ND=jPgTw2l8Un*t3 zIhbNxt@X#P{WfF4=W0F-j_N)2oM7WZlnF0Px2y9rfAnfLGWr|(Tn zOg75vmrgxmWD{S-7ZuUNQEBRXd<7{m(Eo+;IUk?4n);XLvWe0rCVAUU%uN+u6z28w zrc-6_GAYvX^PhQ~4RQPI{u&raU^D4;7u=Gf@DShK+cWJBfqwe@c_Qa(XZi7=o`Zwq zufSGemalehUS8{=ut_flfW6P{4;Pgmj#{s7TI&36=a&UyK|SgFUYlB4SXf*%a>Y*X zju*zZJlyQ57#JMYvH+MG5q@kLX>TTGHeGRQz>($za#{8-(rJJjx zqpOjZ+;(u)Y|@VFuAb~9(We_p1`*>spM@VzVvV`d<}VtOlZmcx_9}aJoZsr}XD)ah zwSKt2m>!^f{3`_mQTg#dBYqDxK_MZY6ztYhuZl}c6HZS*IPztDGwy*tNfGvIYq`Ii zH?E)mT2Y|@0!Rz;K;L5nA9lq1a@Ks!f#=U?j@YNf#Le1DfB_85%mjtw3}EFFL9q{r zVF^A1HI{3c+H(F|R^Nyjtc^ycJ`-lB7|6ospi^YQn9J$k^;j>f2S7DwjEsyj`|hqs z{1QV#kUh3C+}^MK2>-D2HK{)@R_LXD+jYSfdK)j5@6AqOCd=usgck$$ez!UR{hor` zvb5iQgMs}w!%lb^85tZ2ZO0$ZVwa8Gd(0hg8$fY?mwtsW~NJ!f&9#uN%#{lMG=qtLLm$+ zPERD^0IZ_W30}obOsIkM0Rs~%E-CpmZQ!TpdmKpl6JJx8y8UktOaAxoY5-6cT<2{w z?>VQH)YYG7`8_l~d-lwIaY}bu)4=EX)v{l^z}XT;EEq5C%e(_CBe7xR&t1w77emX&)RP&bMHVRDsJGlT21XOqokH%AbaIQ-hZDu-E=D zaArzGNy!3$m!Ns^aFTJ7ET2O@;YFr=Oi$5+PWW%n`ZL?(PjXGgYGC=21j!U8P&O8#5W3R2Q@6SsoW* zL7|}opgHzf)%Jr%>!Uxzs`2PrB|LIf(A69g#P}wpdepcP0)`lrv|E>SHZ0+9r`IEEY~fIz@YC@UElELZd;%h3&{u%pl=pur%?OFy1& zNEX#*z77g9o`~CyEJ`wOdVRXmAXXxhASWjW4gwgXzj~>L=(GzA(A@XR>jg|SUlE|! z*)L;u2=+>-w+eTWa@+j?G!(sba<|bI%#_Fd7^Znx-H#0cDN{eom53BDNlCTVZ}$}h z=N+oo6u_Vo)=>-OQr0d6hTYP?j#>PGaxXyg#=-!Q_v~2-Ck+J03O^75nhYaDZ^Xom zI7p1R(qIH1B;A~gcfzlry^3Z`YHDit)nGy;&@?>K!wdm}&$RjQ15(23x~~Q1TiIt1 zC>c5-^Z5iFjaI8CCpbGUGc%^Ds>)S(8PxS3 zqMr3s*-7yLU>t`FjjSnh?gzEgEfo(=jkHZ2NWPUehz~6$tFlu($)z|OUTFJhD|Lphp zI0&R8XkTj~q;|)iOU1>-sOaco-rfRobhsSyXA=uc5L|rx;P2l#c*tV7vd)%Tz1TcX z-(!&RU`ytWSs%MtAF0~fGCAu>NlS+*7TLxE2$M@@g?snz9gJSMx^jWw8?q94FU{Be zYuoBz2J+)AyAe@Q;@a9IgJ$fTBU!NkPnWhhW55}2-oOu<)l5IYgn;Aj1OqaCt_F~E zwWBjLsF6MJIGsT2&R>|Cy-vX<0Zu^D01{vwXQs3?MdjteVIb9V7Y*WUEtmYHF2~7! zrg}MoiM)C9CficGl)9)qRkKVhpwVdywmyA9Xt=DFzn|gZ;jI9y?gp6c-6iA2d4*U~ z5@FOG0%+CzmQY_TWgqvlH$vJFGGKUUpJ!)h!TJbkUevlqjgBgfIJIFPsSaG_(jH04 z$zeQz=CD4cV=n=gNE{I}6afSYH+Ohz`B#byLj-(a=gN-l(9lqiKOBNLg{GQXP_6Z} zr>9i-_JX@rY!OmucL1nuf~E?S-HBolKb|cU0I^%LRpt6+K|zQR5zuZ7n2BQ}BM~4Y zpOKl9&=m@CkppvvC^9xv(-gNjbZX3?bc&f#)h2yw0LsKbgkd; zHBrZ|Gg~weP{M;+C|Ji>!Al}QcUD0TI&CR5=rYTtyhe(Tk3ZlG>0ag8bBc+L4b7z| z_s!ya>WwGSxgIMVqhsHS50e|oY$jk8fDlI2b(vHzSLhsl$F%p`W$}z;*>kTPFiD5f z$`jD2cU`Q$gbl}tMie38be?Vu0Lskfd*?2f&U2DpXj7)a_*PaHCT$iLbhBjb z(Zj=|;h=8*_}7aps+TXJPe3V#bQ)S{W|&iqSkTao$WN!*7zxx5 z%tZJ%mOi^{At*WDggM6V#!M&k4C1P_wKZ0kT{Vl;5WoSiK>sJyWuBIx^qRQKF^1QI3kN5~$`g%WO<@wE;raC_Nf&&6*QxVi+Assu;Yu#AF zK?Rmt!0-Ulz4g)!a8FupZo=T;;F)ix0}@abm_Ec+6bRVfwivNJ+Z+-zGoy=$h^Vq( z7E&DfAw}r}lt!?@!)X$r`LWZ!n?q@#AXz=ETpM*+(}sXRy7Xky&K$O}u@SJYj2hn& z7ZXDOH30hKx{E>KcsS6QBI6t|79&-u-|9_a&z08NHIm4r0~-32LYW}|qWHk~a-J*BJx8H-(U;BkNv<~x4dik#NKh47!zSwy+) zGd5fT#~lb-ZQi^vy`(5~jR;(^4j|J2e6WISdG`EyPD{%I`_v{-5?FR^*Ji-fc?wIz z-(O{w-@OZmCH-z`B{JmhX1e{diSN)D8|Uu4P`C#a`Y|YYS|%o_)7G$rv@~j_?~Nr8 zLmr-FF!nl_#*GCsr5BhY$HV+b+26iBP15&dsA$|Ifph@Q`X|Lm5S$Aj>_R#rL# zVdjXMde2O?$yli-i<+8Rhh06eAYg_=!%jgO4Cl-AnhB2DZkd5lW%E3@&~+N(1Vsch z_rMT`OU(;5oP5^8U$A=rbpRE$)Q&M^#ck=e7<0#_})AmH` z?CE%Ww+LMSNytQFN;5C1(=Ibm_d=prLddd45o3w zBvpC&7cgV@A!5XaEj23(i#R}`d##@;LQX++WNf(77Mw-|Gi6BAw&HKrB3T4#bh#

z5%u)+`~q-zm@?bEar^!KucyQU?p4#?@(c_N-`r1(D^rGC^pZ08-8{`G>>D2~#|vZt zewXPs{+aOpGniOgw7U|R2DV0cry-1Vd#p!ux9DF1Q>$?! zQRmO`YWKGf8*fJt3nA}8gHTacrl$0}t2U=7p0cxkHx1O!a~75n>$R!PX?I}sX7Ubd zxAju`{>}OG=a0L7C6Fd>JvEXRDS1gI z>`SIlSTm%bn|P!ONCW6#z)RaF_L`Wx2M*;ZaA1j|CBY=}fRQqE1r#CliEDG~FZ9B@}) zJl0;5WE~KRBLYU^f?$qZy!nebJZyVy&G4TOs$d*Pvn%Po!-u0hy{7IZzSsc}#bJnZ zIy*ln z0PDL;RZ%b)hgP!cgtqBte}DfmDB@Kh@kz-rL)!;IzxM#b@pf7c^_+86_l6%UWG_btkOf-*0^N4nNxo-2(tm=Bi_maI#zm-I_K<>ni zL0nJ;K(5f=6$F9%^KsBiAD9cpW_+=)HCgK^x1Qn&s<5;i!vnT@bdCSZAVK_rmPV`b z!*jdl11_ys1b#_Q3ScnsQdPB-2RNgm{We@CK=r{QhbO^nj?hqFMdB6vPD#m3qID?P zGYuE%>!Md2>DVg)=?sXs*+$Zl+? zr1Q8RjtW~M(1Np@nwlaR1-R=d#UIAV=fG8Fs4i-uXmr*NILtifC+iS^styl~j~Q*t*KveJ4T8 zfyW2MA~Ymq4G@a+`O3E-Rsl?L^RZ_*N}{`f3fR@kw$1H!Z1G3jtKs9+et&F0(!o^g z`0BwO0v_a~T2};&S)9x2!BWZ~yN+^;Hv8j5IdUl#pVE< zrom*kya7M;Z}(KtClmowzUh_zXe#S{vG%n(zV=3(e)3O|vJbA+9cn)y4WI9fH@8r~ z2RG1#FTUq705|yX;R6`XUgt`>=EtJudB5D=EyCxJXD?oesW;bI8vW0Ys@ehqQd*xh zJ=4_il*TGHB2{wx_f0yho?vePSPciX{L6K3B)Pc$!9kmg%MY?9(*$qC4^-ZnNHHD& z^ZRwv9pQ73B`Z&*5Bjd5Pm-;~#Kd%3TjzGS*WQK|wZ6K*4Eu{obg*mi8HDSjV)l2+ zEk;90=h}-dM_!bUBKUhRDQY%8JlCWc6H^VfDdeNKvrNzXf(&nds*$nO7>@@)pM3w& zFF+NXs&+0L{>HQ%iqE;Y-nxxZC>shncB|>T%(Jx-h7X-BqAGRc_+%os>ag=u_}#!I z!h^l=ux1A$!zsR%%E^7WkK;jub5OF{$mbjQ?5e?t9)mw7_BlQ65}AcEjjaydKQPoL zW~!U3NL-==9(&v@UEzKCyr@1Izo|Mfe4cr`!q4*^V&7TZXLO6h(>3_gF7r254a)&S zLg#I(R%Djakk$HUGbTC0qYwYc7S-u^raJn0S*bBFfRzwoMSyt0a@%V|`S1Qfy)~<2dLO6%YvvU4_?j$oMD`R*u_I zSj)5G!Ne!yvj~fYnc5g_E;}DhNn=(QU4k9zw)xuLiwICOF%VMPGQDZ+37I#;5J~<8 zkx-_BXxQ+DOlwj~oc$QR(q%`*4M`U&zgUTG#D=6Y|Gl^7KUq8>c_yB6GX8G1f#U^Q zNr^i%`XpT0f;U-ZC4+xWkK8yd@{e`yvk%qH*(81*_AF$~Zazupv3-^H{XH+{Bb7B4 z!zdLg{T-Yl=eQ{QNK0cq1t~l3pF3Pl@)9K^Am+^(%SjjGk5tZtc6}Q+c-ei^x6aMI zu~u`?Tn^K(ZS$3x1M{+;($(2n!3Pgpe$>ZA_w%zz~0I1rLme0Inm4ul4a7Q7*dua zbakX9UDcJwZxYIQMG+r~X;pCW&3;tmP0l!H!&`>0Hdx7#v~dd|T))_>GRpEQ|Hk5) zDSlFntm|S)lG`2i_k%gwOY4IweonGV8wf;>Yz{r|+tVsLd*V9s5^=pi+J=%M=Jj+$Ik}E1MXZc@Dku^{j-qAzR@by`W;9o? zpOXUES&>gNRMO_)A}{JN=U3?3nQ-v1V;Q8#h(NI?3+dCpC-@@Yev=yOcs;5g7WsPJ zP?-rct1S3ec3o38opQFxEspMi)T2HQEAUd^GDTN$)d{;R8ybQ9VWp#`i_@wOdL2l6{20C z+_gnRvubDgIlq1$;sy_)yo8ng$jbO#LM<9<_!9Wa z@V$M7Mf0J&kb-awdC6MUnn6186gD1O0*2}w)-;Um1Z+%oV%oB__idae2Et=e+KWvI~icbKP z@o_|!0rRoR&piyzZD_bRe*uq3?W-mBSIj`q)xrn+cRFV*juOgoDNm6!87sv+qRE%> zwMU1IXvIZC52UuN_WCbrOWp7&8ho+kkdat?KA_&l=*;;*pCrQL2CDfxT79H_?(*|( zbl39~N3H4|p8c(cRIza+W_fIa+zuNn>oR{dh|=`R{;2wG#7E4b<;MiZ8de5wq-N-o zl9PVIP{-WgK3@ioA5Pr=qIB~){JF$)YvR&d&?My56)|z`51$c6V zSW-RZj?Ak2aY0TPCj08-q*S%5Vv1rcF%o4=JoJeOXl>x`fVs2L3vQ-g)$?+wP4gRZ zm29Ws?VPz?-6$wS5U-!R5bjTpqzGfuia{Hmv12O8_gNc|_n!27qBhaBaPV=cP4XEk z;XmsOagXuZl$=IkNCPw*8M^!vbEPv`54wJL_k!k063TA z8g^bevAtrS+BeX^-AC<08ry$96~s&VmT0SSdR zJZcj+EajIUcHo;;Lp!snsQG?0GfTjwHVr_Tkl&N2yS45j?I#K+6rgia(xX6hxrNA; zSKBhmB_{=oJ{R$u+>SXCHs4E!y@vIOF-B&LBYU10Q_@(ch%a_Qg_rPgsj-}j zu%xJ%s4@H+T%LhaS{FAJ#EAGPy2BP0!`f-=(y{s!)t|+UVEuIA{d+p86_!U%c=3YgwV^b zkxJ5!iglR)uSw%0_Jx!QYpD?zk`xsCxU{K2TqEy*s-^L_wQ_BAK122@)D>f_Q}aF%XLG*~&-t#56Rg?6FX&srzDn%6U` zh9@_i#e0X66JK|P?x&iVu^nSGcxo8^dJ1rV%0$BE1-rpaI*HJd3ZfojrMDxI5gkG= zhTM-kYZN#LXb-!`Nmp&%BNZg52T}2 zAj_bQl#U{mSCmxHi>Sz(%Q|wBDZRz`jye z9e>!683vP^s=h~!x)cjIO0HrD60N)xh`}C;V#o{mM`c@=+&RxfJC^`2jn%~V^x*wzLfMM6cHCE^bc!i%pO+4 z^V1aB3KxwCqt~iMRs7v=%VhV}e~gBQ0X$~iyowBXX~70IY9i6%xXC^3{JzSN%teFW zc)!+JxxP|We~jl!QPG7$8Y7B=pw4On3^M2wE_v#=&d_nG^IileC*tgna&~3{AK2H8 zxQex!>L96@^cc#b;ekWpVIO58v7a{qt~7G&CgDs`L7oJ+%^bF!Ng)Y+!VHT>r=+up z^L8rwy;olq_scMepww(@=CF#!WliW4KG+9DCB>+-&gI2Y5v}0b|K`Gh z#fp->MO6!t=2D4{O7HGa#fziNiUTJe8iuK7&o5n`;iX4NAaTI9lW~=k zDkoGQSs|)M?%%L%fXRpTavwN>&?m2dlNC6}6z^c>TMm*c9w5B{4q$Hf+QT=OPzK)< zS9BVtH+akAhTUN0@N81soP!OT7C&zJyl2IHOGb+y_SXpdM4xP4L@!uSWiizM$Q0WI z;02y8JEOGY;wzfm%qY>9*bYNw*?lfGV7n_FGK1fG>bphw=^IF&|!hN{TsaJ? zLJ=-dw7(KIgg-TQ1nYP%SSNXsCfkAS0l6hYg5}Jm`12GElnSygeXb?+VI;{2QtJ5o zU+@X5=IVN4h{8p$gdwWBukgNF21TNlTEc{$1Bmv}Sg-tlHT`B`mK*RslY2S5iuzcaYIb(*Ec{_b>7x$`1?M z{`fYN4+_kC+Q%M0s-4qc(ixnj1x54|`^%xUvIKe6+lY|tBP_q5ACBvA3212Ry(Vhf zB+iAnp@i)id#m2h4A}60sTQpK9AKeczg?DEGsRUpTXeIaXO{fq565%fMKkmEZA;AJ zRU##|=ZXlKyDxS6WTAGsqHf#xP}nBLbP@l4dQ%Wz5J>JY=Ax?4OJU@E7>!uM5u<>Nvy(WHqFkGZv28eS4Cbjl z(;?IPKFaumJ_5eSLR|U{{HgCPYgyJV=T{~CVHX>&Fk+U zeP|L?_$ebUPHr3#Bk68M8N_M3>T}b9O|a`iiPW*`_c%bF3lW)Ct~KGugBURs9|$Gp z($l-&tGk6+ktkYKmWf|138E^>O1XPVo{`53tbW*LCMD@0cLWm~)Zi934)mwv9gq)pAB z;sjW6)!%C6?pg47{NBY6IlRs^ZW3r+n6lO(tVLLU2H8I&Ak4jw(6BEA#S(4fgX@ z&J~#(#e%KwNaRVA5&cYQ@t#AqVZVrj@&{gYPAbKw3O4g|_R7@E8kQD`xNGx8-JmF-pe%WIp>IC@Tv+AdP%%_Q6x!xQ6or3G~z6ISCmjfSM+^do{k~P4380Z!%F(;a4$T<{3uDK;I5t7xGK#i}#C` zi)C~Xvr!GJv@1MdU(OV5=)E4May=gV{?l{(6Dx}EA)cSTuaTUaTg7gFlkBd3*TPQY z$7nSl46-13<#pAeq5WaFZ;DbF*;*71+!je(>0xNjNg>}dDyH{m;Uk8Q4BAUB+o19m zvdtjG^Tu7PAi5WMHW!*j_NiMDMS?{6o>hn6>@;eUjk;Nn&ChUB=THh=eItGRJU`Xo z;_8VEH))4ePSeCU2-R5%@e(;*=YrYwm}M@^-pR(p7_C|I3%6Az|m?t(B5ev9VKA>Bk2s z(XoM>hp)I57pX$aBXf-3vF~l47EXX@iPRqRo>{Sx5z%o1fBb7(lKn60N~10NL0!ML z!~&n zX1WM7&GrvaHO2Io>j=d1GwMm5^v5dQoxDvpHa3ii39+l`)_6Czf$OLO(0($|CCR16 z7#S+L@Vwh`JGi~u^Bh%D=zdT_m`*u%a(Kj9XSJ|=zQ;~ja7&H<5DTJ&moJwE7nW_j zeiMU4jl;u4z{5oT*eN~nG!QRCHM=rRy_FFQv>&WBXPQ^F_qg{s$`0r)x6Nd`Iqs7b8L9&=H8)G{xS(dl4muGsU23An*dPv`i?2Fr>=L_;EnODN^1~C9 z43tKV7t1;U6prmR4DFc_cXyAp*(Fvu$ss6Xy^o0$Ta54KY1OJI$^! zh6)~b>huuwiHuwe)t(vHZ0&-C%+QqGCoIMp+CfH& zPK1HFH;G<6?TxkeA=j$UHR~F-4T%{MxtOAizbp+2vTErQ=dz`klPs4xJJ+ppoBe28 zj{tF&7efmKC98*sp(3aSMvd-&F-l$5Zo0&qg@S`K7TilUIgT{f^lrSs4Mc^8&-T=7 z;7$)dLuRAu&tVv-I!WmdEI*)>onR`=kRHQhH#BiU_&_|Qs7;rex0-%Euqo2hvq~#> ztbn)`3(=?~(j3?z6u(v#Me3t*w};OXr7da!Ai%PiO%@ zJH-C_Mj7hBhv;`R@>1aXQR9shFICfFW@S0Ac6AcB1IGo;OVEA-(U4V9F{p7^gF{4= z(^xPKlL1@(M>O*-;~gZFb4a3CiH5NC0xR~EvLQ{bd;)CZNCXlA@FL1kB@8=NXW8SczA^nVOjR2&W>fux3@mWSrgaiNfsv&Vc@ESQd|(nW>O`niDW zD@R76dNiF|_Uq(@R<($JTrW|u5MlH)z+J*q4~9OW#mj@2;CwU58MZCr6pIJG{}Lc+ z>5=0PeWK1O!bY@Mc&YY9P+2rW^d+i8aVVr`gW@M89#RCVxN=U>Aq8fjl?C*PvV7nm zaW=e;Q>EIO1j5kc;yL#}0xs$=D~KJRRKU7Hp}1~GiH8IE(8L`9pZeQ*Oymr5UO;-U zh2ug1Qc9WCN=W`0(-xJA`-L~Qk^e3Q@Qsj?JhurN77$z-+1rBf{eeS39;jO11sI?C zs|$zqD4d6iuwk*Y4_MGAq;F4OJlyWN0(tj$-If;Cp}o+V+z$hf42#{I-Gy;OpRFI3 zIvH{m{~aL=J(-PJi&U~5=^Fdy+w+y8DS^ogY>AE=5X2snaM&7rb*>m5luJ)E#e%80 z%u7Ni*4Nhc0#l~<;}MpGS_2w29l~L9N^tu3?MOApkxmK*VScCL(85IT@D~pkV>@3d zAj2rQ*#b^o9P$Y>M@!91+3Ju1u=3*Qui%@4CAn`>6FspZ*sGc!vMs9@0zoFQr8X`g;OOBY znQA=i3-)+uhhN$Jm7bMs2=^Rr(qo#1a|A62~R_ z>oT69ng+a_CMnJ5`7rNov#=9fkCZYB$}KVC)1ptj6xI>ld6-*X1AJz&%NmJW=&^ z4+FxQM(3^39bm?EG>4aOK10OE=E~vDHI`EypTRJ=6Cz=rUxnPeXXHKfB}MJqU}q+V z%EJ$^E-1`bBI0`4z~=}0a1{(yzy9ioJosJS?casv_iB!N-{CA$OD6Nc1J=FLSyGpr z|GMeFq``3s24geaJ;pni}DE*!9__|gp%Vh+X*G`Y;*!9#vnj25!< zF&~#6Zl!KL>ek_5lFa$;6CF)1``uYWpwKvV`oON&_GLix#sQ#XZqoa@qgYlwjHv7Z0vY+hN@1I^}dg3e-(FEIs=iwUrAU&i}|H<)}vEr2R^e#a^Pc|bVQLq0qX zO)_5#8DM9*al9nR>>BP?{|n}~z3mYY0n;9Lg$&~16-GB!B|ECI|20OhiJ6tOL!%g>B3s)s!$C>SLO2MgSF?6&{*C?_F! zAZKK+h8>B@DLSo-t>@HUDTw&*cyySEGkMeIxf_Es+_tuAtQyu%G&~G*e^RERBqNNv zKyw@Kv@!LFnl^*Bo2HQv7s*l5aKWs?Ah}}Vp%wMy`BTHK73h(U26cz5lTK~!&7AQB)FtLE zh5sTfEN{^CTdd8wnSbPVCh#NMzhM%3{zVc;PY*Rv>)%6=f!;*1NNtzho%$!Xq#`Ie zNyI4cpm^#?!x$_vq0-LO#vG zVXTY!Xl&PKLry&ZYqz=%f|y0Jq9UoDJE%lv)aEZ}LhW|p^v4{b7+$7GR#@aMR0rj` z^h$V>t@aW-zqthRHCgiYgbBasaEWoIU<(_+Pa!Y@gA8KA>;Qg`=I#Pr@FBjJhciCeK{KTzgG*EFF8tRYj9!J znFGGii~|NAQBhb^;Qv!;-gGt2k6#@aYW&mhk)=yT)kyFIQN$Rk`31udj3xpZT)MR% zw?`f^)=|+C;2Tj6Y8r29I5TT|lXDuSQ+d#WWtZQWSpIrs)-DX4_d?7f=bvl?Z#P*L~G%{deuldP`MiiGDPW5>lm9c}ow$e7rR{#72TN#gvfG=Ri4 z*|#7UPC}m;d5wRap~aULM*(QkINI(O)n1x&1|BAStZ1ZS<$&^S*c0T6xO~_EWUQ@b zg1;;sM^YTIsr&y{z_$$Dr{Lm_UG=6pSlx1|9W8Avv3PYh;{~dLA0P;;5SvbaU=C)6 z=sAh1A<=ZXM$?aSUSPWHQy<oosM8oVxB!?4EuX7b` z9;I&WsmBH_n9)M@A561%TrPs(AbiVC9+Ga|^s1uZjY=@^g=^5wsED2GrNT%3@4$LO z>E)Jft$>Q*zw7IV|Df_Lm#d*nL(OhBYQnlgLT;GqnVt|@MTqCb{;bcGe<9I=DiiQz zW_FiV3*@ENS32np+A%A@PBwMlSa4Z-amW~TuGsWE_%VVl{pnx{WiL6;EuSK~gpq?> zYixBCs(rf`yVUpPWIou>N83~sn$+G{3mB_%pn z4DO&$&`f%1j_R>GwUs&?QwecE$l^Cydl;FUkSs~g=xADQKGFO4U^FB8NVI$lnNo`V z#M16>SMO$Fpe-htPJnLg6q<7tm4YoFXnI63GspH^^!~)8iU5zw?5C0l;>L1W@b@j} zh1oYMFBIOX^Z`c^<4V|hRruymEWc-x9iCMI2MNzyk4bzQThM~l7#Zv2CT(iezu$J= zkcB1CBK7vH%!}oLQ9cr`+1|}>N>76k>=4n5*l#`(ofZHoL*Ok-LZb#8AkY-eG(6nVP2m}Z?b4(#gaCd533_(*X5knI*qLwcPu3rpL+8NbZSWWa zu7iv)w23xUx#@<{BHG+QCl>y{NE4)pzlzd};!!XZ5s~;`(*-pI9t?#3A2m;&dpNlN zrBzP$|EE>DS3Fb36UQR{7}k~o+L=ozX3pWLsGlaVzZdZW@u+<#EHHeIxxpbGcIkKJ zGnXCr4%#LBb*d7g6CGqcB_)QHWext5bxf{*QU5Hs2@js29d5xxXn1NFj~?sYu0&NP z+$j2l+Yd8mgMAP~Oy5!9V<*0V77=kEz8gRo3smCWRftt#Bz)zhdBRLr%qOVI_T@~D zLtkKT_+|75Hgkz*x(dI@dw&LsdTVnkYh(r;R|y<^{3%p5c)0JpOvzp&u>WfRvR`iG z@b&^reevvAuV9lu>*3yavE26Y2Dc|I^|cC$|HyQ@!9Cyn^A%kJTx|wKhMzNaQKrRq z-JawRi>1Gbx#eS|bnvZt#@43?Sy-kwmi?5ZmOW+pGu;JfX|=mI^(&{=`)a*q>-{L-OGDDj{Ek(C%jMN?l8(bbPsYAYX&A8UdLYlp$Ya9 z5t}^MpHGfLEY=hD(zZMQ+~ThL2~Y5YxL^N(=7!*7w&-|4>1DfS)?-Kx1agio3VpJu z;d(FdWhf<2G4l=!+G-c`^1-I?no{>TzaHV^Dq!n#k}#A}SL^F3XD7gH!k;na2ZxGn;{0cv4oa%>tgX1Q zm}x5W;OV!IG78S~{->)iGhWN99(jqFwA~O|E!3$;^VeCA;v0-k__Zi1IEFtfZY_RS z9fC|Oqpy=Tr;x5RAC7x!T>WDYqf*Io15du~il4;uAj$c|2nBJU@_xW{ttCi$x@^J^dR|TyscPeAuq0gQd?%C*Q(C1^doiSzbxhs8pC4bku zTx@fA@iLP`8BiBZlYmOP_OsSl9CnC!s%FXS#N{A->-unIX z{qy_pcMp&Kv+cS*KIiSaUeAS`gop*FuMW*zlg1+ZI*4W0-VA83G9QdgWo6mr1&5{A z_j1`3D8zpAu@I9t7Ev)FOA$q-Q762!4St2FlRwQpTf2>l61X2ePyg9i{bTlpule$K z?XzC?gSLaCRP*+EZQCzCRU=G)$4W`9-l>M^izC@>MFc30on{36T+Yk8R@ya|@q-L> zXhq{->7`@gk*W>lMbBXdli2shYvv4f)yUdMRYTgB z$3j-e+>aZJ$;!6dFfb?N{<-JY?_^6RX?H(cFOuAk{cBZ4!Wxj() zDy4M__F2Ds-}s?WiOEfjH(qm_rm zC%N_in0+*B5$>0&a#Wf$Q4_oNzMCWlx3dV4e$R@?T9QS{QXQo6d#<)YtpinShu#=J zGRUqtdUWRF3GYJZFK^L*9mAa}T_FzGn-@4SjX&{k3l4E}dmJ>f*$+~nmF!l*LZ=nR zj`RF41Z8n8M2tOIlsG1DOl|i2^mD8?v$gjk5@^bnr@E;qB=epR!nV*w2g@B@qlG9w z_-c0Smyo*b>{esB#q^P`nDpJAW4Uk8^#K_PP1ePX=;-Yy4{Er^X{1fY}79}-+RTFb&dHUB5T3@?DC13QKtLv^dXjv5GC8@T%PvPl2Kd=nwD|1 zuQAx349Y^ojhIvq2ZXdml|R?pLU2lMrD;S!itNjrN=+Sx0(>+ z@F5@gi4#+k>D~eBMz6T#QB_aoWv|IKvh-PkcYA7hEqOEQ=}r zr2n;`=B5Nx)C)dA2}=H_x&YTztv6>EXNN-(#8m`Nb*HD|RyyPN=an5(n~_bW>khA^ zYNFulLK_#i63}B=yr7dICxt2Sd~-jR3qh6*A8kUA@3E*Y2=ZB!mDHi;AHFzqE%mm) ztz;si7jgPghgu7x+!5Y{9kq}^kQWM(=Y_=cWV4RM62c}*7&c+Ba3ZdVJ{lXB1lJ+E z^L1xCgES|j-pYJ6`;3sqN`IZ;-O2 z;jRIMgV~+VgWYdvt4=PqNvGalpV!n`Sn%HI?M<4fB~G-PoL2Ul-YeOTH*^`KZ;bEE z+4@aUKjvMFdfU0~DIt>&c`fyw;^bsqFt!ZYK|ZGcKYotZMn-=BP+y7eL)$>%Tru`7 z0`12_=(Eo;%p^5(oYUt$2nP-Skr;{BxTTGLEhGpVq^MiNB=1dZpLYn!ykQix-*n4; zTzC)}W-KNjQ((N^&w!4pb7Aj2cN6Ja5~6Hs#uCfqnB?($av|;AwC4_0I%<{F9{mnk z?3QTURwYsfxiZ6IzeRt}YsHkZw2zx_pL~GYCD+nsL&h9ePe>}0wDoexoH#=hR*I!H zWUIMnDqe1Ht!|kN4mfO2Xd&_Nvkq7@=q-5qw#cmGIBm2l+-B9I2`qL1`^r$*3 zhR^tN1_@|=mJ>yPuh9$%t2i0_d)?bZB9ygm`#XG=;Dedgt!_^h=-fDtx zK}DGh*3PT!`j2;lE`isOU?&?gdHB1QALL@JwxFb1iTQC#DJl8FUSOH9*=+IR`)gcd z3E7K@!~EM!A87^6rWF(xp159x$ve%8>o7Qt)cP^^7}KumDY6Z^&C-v!)eCPFN4Vnu zi<3Fw@%FK%$I`7bx@jI0u5URA-wt@dqg6ZAf%lv3bRUAqCZ1~kq$Ai2YUL<**`HcT zmMeCsQD=Xzcd@Ts$;a_;TTFU*gR5qiY@2u9vg_AXOJZi|v=YE+ZaHYEqwSFcx}ma= zbAr6DU77Rgfm^BZn7&Ka@l2o7NT-JT^r5#+eiQ@72byprglql5*cn4pF5H`9kboG1p<>J`Ejb<^a5XWTX~PP*~uSmvYs9u?FMdq zP}u6o;Xh|RLp0AgmUCYw{206Oxy#hSrkk;izD&dDsXIF!9}Y}gTT>=!QWP^7d?j|3 zXErF6zQhAlGJ4;~&a8iD24_wQQPc6==VU;7Z|EvZM(&tjfRL%e+{3 z>VCq+aI*%=dIzt)o!=+1w^_$6qkbjG1#-;8zrWBqit;F39$1UeeC3CR2%w}`W zmt~+wJ^`0jK%?>XUYDAb(fc_Tx;{yJu~i8t0U>P&_fa8MOI;PByzX`*U`hnn10246 z(<*Vizqhh!%{5wii{GU=J!4U0vS-Wk%i7;WeF=wTs!tmkKaq#ULBzTXBHoqZs~o+H zOHpfFuI86!WORflQEqYF0Qf9`cQ`|5s?N~G&sc^HS%nRq8(JJYu;;NfXCYa_oN=YV z0j1z*d6828NS-Oy&q#8y^&=8uYB`-BSS$i0AP1^_T`r%s&W}L$T)M>mb7XlO*^QQ) zYXBL4%5GJM;NdI5s!MVCyeOSPt%#lztX7$bqCu}ZGy5tpE6na$B{dF@kMH96TDN1% zyml#_ZV9H|yC4-u^_FMZ*?Jq~5#XBA;}a80&-QIvzF7qAx-=YCDj=<$c9wR0_d7b{C|nE^h~ zMmvCAN9f9_E3Hw6`;%VB^aA2k0`!pT;9|f-HKWa2cXajA&IPg@Z-Cb{UH=frwcOLy zl?`;#^q!{WsEww{&(F_j=rrNq2J=x|<44{18)%p;ZhU;azvStl_PcW?CJ%?hzUh4E z?N!{#zilIsz9E1?P_~#z6oCO8-@?0Kas7Jn&u=58j&(s(Db^Re38fABS2YT*YCN8I z|3HCBx&kI;UQ86~E+!rZ^Fl+I0>~1HZ5Jvpou~|d67g5+b|S~4*SKDkf~;_$5370P zh$mzXHAG<5@v>_O4IC|M7#($1v3ZUfT!d9??A`{TW0rMNN0=h#vG)5{e-RG^soW{% z7E`>IfL2hOCQW#anlX`DkIq zT^90WR%7t6mAXB@45mX#lB{uun7!3svDoz4T+gxnJw&%~QzaGw=KL zJLs5OOLZe|upfl;#{-y1fDp6P4ZY``w_bptPu=#{BbRU z75g@5Bk1?QcH{u-ma!|Bq8gbj7cZ@22hrMG2tQVfY9YvERXC`s1rT0mOZ-s1o2+Kk zLp{p^aLvCN7V^nd>EO>?pMYLKgA7&I#6-!oy5#BU`F=xQ(^=>`1vAw?3pi?qXslsCtJIB2 zhz$3^a+#8qHInz&(M$U1r^Ur)@EEA@AZ_>?fR$c=#p50tTEqsrK)L(7zWR`Pjfl0I z@nUKQaI<$KS#=SOefrv2?Q|Z#lEK)B?G8M5x_iWH=ot(I$mbdrK@l$)?iY3poqFmg zX?*y~-(5pB{+i%Z0BEKpDX; - } - - class RouteCollector { - public function __construct(RouteParser $routeParser, DataGenerator $dataGenerator); - public function addRoute(mixed $httpMethod, string $route, mixed $handler): void; - public function getData(): array; - } - - class Route { - public function __construct(string $httpMethod, mixed $handler, string $regex, array $variables); - public function matches(string $str): bool; - } - - interface DataGenerator { - public function addRoute(string $httpMethod, array $routeData, mixed $handler); - public function getData(): array; - } - - interface Dispatcher { - const int NOT_FOUND = 0; - const int FOUND = 1; - const int METHOD_NOT_ALLOWED = 2; - public function dispatch(string $httpMethod, string $uri): array; - } - - function simpleDispatcher( - (function(RouteCollector): void) $routeDefinitionCallback, - shape( - 'routeParser' => ?classname, - 'dataGenerator' => ?classname, - 'dispatcher' => ?classname, - 'routeCollector' => ?classname, - ) $options = shape()): Dispatcher; - - function cachedDispatcher( - (function(RouteCollector): void) $routeDefinitionCallback, - shape( - 'routeParser' => ?classname, - 'dataGenerator' => ?classname, - 'dispatcher' => ?classname, - 'routeCollector' => ?classname, - 'cacheDisabled' => ?bool, - 'cacheFile' => ?string, - ) $options = shape()): Dispatcher; -} - -namespace FastRoute\DataGenerator { - abstract class RegexBasedAbstract implements \FastRoute\DataGenerator { - protected abstract function getApproxChunkSize(); - protected abstract function processChunk($regexToRoutesMap); - - public function addRoute(string $httpMethod, array $routeData, mixed $handler): void; - public function getData(): array; - } - - class CharCountBased extends RegexBasedAbstract { - protected function getApproxChunkSize(): int; - protected function processChunk(array $regexToRoutesMap): array; - } - - class GroupCountBased extends RegexBasedAbstract { - protected function getApproxChunkSize(): int; - protected function processChunk(array $regexToRoutesMap): array; - } - - class GroupPosBased extends RegexBasedAbstract { - protected function getApproxChunkSize(): int; - protected function processChunk(array $regexToRoutesMap): array; - } - - class MarkBased extends RegexBasedAbstract { - protected function getApproxChunkSize(): int; - protected function processChunk(array $regexToRoutesMap): array; - } -} - -namespace FastRoute\Dispatcher { - abstract class RegexBasedAbstract implements \FastRoute\Dispatcher { - protected abstract function dispatchVariableRoute(array $routeData, string $uri): array; - - public function dispatch(string $httpMethod, string $uri): array; - } - - class GroupPosBased extends RegexBasedAbstract { - public function __construct(array $data); - protected function dispatchVariableRoute(array $routeData, string $uri): array; - } - - class GroupCountBased extends RegexBasedAbstract { - public function __construct(array $data); - protected function dispatchVariableRoute(array $routeData, string $uri): array; - } - - class CharCountBased extends RegexBasedAbstract { - public function __construct(array $data); - protected function dispatchVariableRoute(array $routeData, string $uri): array; - } - - class MarkBased extends RegexBasedAbstract { - public function __construct(array $data); - protected function dispatchVariableRoute(array $routeData, string $uri): array; - } -} - -namespace FastRoute\RouteParser { - class Std implements \FastRoute\RouteParser { - const string VARIABLE_REGEX = <<<'REGEX' -\{ - \s* ([a-zA-Z][a-zA-Z0-9_]*) \s* - (?: - : \s* ([^{}]*(?:\{(?-1)\}[^{}]*)*) - )? -\} -REGEX; - const string DEFAULT_DISPATCH_REGEX = '[^/]+'; - public function parse(string $route): array; - } -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/README.md b/samples/server/petstore/php-slim/vendor/nikic/fast-route/README.md deleted file mode 100644 index f812a2a014c..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/README.md +++ /dev/null @@ -1,273 +0,0 @@ -FastRoute - Fast request router for PHP -======================================= - -This library provides a fast implementation of a regular expression based router. [Blog post explaining how the -implementation works and why it is fast.][blog_post] - -Install -------- - -To install with composer: - -```sh -composer require nikic/fast-route -``` - -Requires PHP 5.4 or newer. - -Usage ------ - -Here's a basic usage example: - -```php -addRoute('GET', '/users', 'get_all_users_handler'); - // {id} must be a number (\d+) - $r->addRoute('GET', '/user/{id:\d+}', 'get_user_handler'); - // The /{title} suffix is optional - $r->addRoute('GET', '/articles/{id:\d+}[/{title}]', 'get_article_handler'); -}); - -// Fetch method and URI from somewhere -$httpMethod = $_SERVER['REQUEST_METHOD']; -$uri = $_SERVER['REQUEST_URI']; - -// Strip query string (?foo=bar) and decode URI -if (false !== $pos = strpos($uri, '?')) { - $uri = substr($uri, 0, $pos); -} -$uri = rawurldecode($uri); - -$routeInfo = $dispatcher->dispatch($httpMethod, $uri); -switch ($routeInfo[0]) { - case FastRoute\Dispatcher::NOT_FOUND: - // ... 404 Not Found - break; - case FastRoute\Dispatcher::METHOD_NOT_ALLOWED: - $allowedMethods = $routeInfo[1]; - // ... 405 Method Not Allowed - break; - case FastRoute\Dispatcher::FOUND: - $handler = $routeInfo[1]; - $vars = $routeInfo[2]; - // ... call $handler with $vars - break; -} -``` - -### Defining routes - -The routes are defined by calling the `FastRoute\simpleDispatcher()` function, which accepts -a callable taking a `FastRoute\RouteCollector` instance. The routes are added by calling -`addRoute()` on the collector instance: - -```php -$r->addRoute($method, $routePattern, $handler); -``` - -The `$method` is an uppercase HTTP method string for which a certain route should match. It -is possible to specify multiple valid methods using an array: - -```php -// These two calls -$r->addRoute('GET', '/test', 'handler'); -$r->addRoute('POST', '/test', 'handler'); -// Are equivalent to this one call -$r->addRoute(['GET', 'POST'], '/test', 'handler'); -``` - -By default the `$routePattern` uses a syntax where `{foo}` specifies a placeholder with name `foo` -and matching the regex `[^/]+`. To adjust the pattern the placeholder matches, you can specify -a custom pattern by writing `{bar:[0-9]+}`. Some examples: - -```php -// Matches /user/42, but not /user/xyz -$r->addRoute('GET', '/user/{id:\d+}', 'handler'); - -// Matches /user/foobar, but not /user/foo/bar -$r->addRoute('GET', '/user/{name}', 'handler'); - -// Matches /user/foo/bar as well -$r->addRoute('GET', '/user/{name:.+}', 'handler'); -``` - -Custom patterns for route placeholders cannot use capturing groups. For example `{lang:(en|de)}` -is not a valid placeholder, because `()` is a capturing group. Instead you can use either -`{lang:en|de}` or `{lang:(?:en|de)}`. - -Furthermore parts of the route enclosed in `[...]` are considered optional, so that `/foo[bar]` -will match both `/foo` and `/foobar`. Optional parts are only supported in a trailing position, -not in the middle of a route. - -```php -// This route -$r->addRoute('GET', '/user/{id:\d+}[/{name}]', 'handler'); -// Is equivalent to these two routes -$r->addRoute('GET', '/user/{id:\d+}', 'handler'); -$r->addRoute('GET', '/user/{id:\d+}/{name}', 'handler'); - -// Multiple nested optional parts are possible as well -$r->addRoute('GET', '/user[/{id:\d+}[/{name}]]', 'handler'); - -// This route is NOT valid, because optional parts can only occur at the end -$r->addRoute('GET', '/user[/{id:\d+}]/{name}', 'handler'); -``` - -The `$handler` parameter does not necessarily have to be a callback, it could also be a controller -class name or any other kind of data you wish to associate with the route. FastRoute only tells you -which handler corresponds to your URI, how you interpret it is up to you. - -### Caching - -The reason `simpleDispatcher` accepts a callback for defining the routes is to allow seamless -caching. By using `cachedDispatcher` instead of `simpleDispatcher` you can cache the generated -routing data and construct the dispatcher from the cached information: - -```php -addRoute('GET', '/user/{name}/{id:[0-9]+}', 'handler0'); - $r->addRoute('GET', '/user/{id:[0-9]+}', 'handler1'); - $r->addRoute('GET', '/user/{name}', 'handler2'); -}, [ - 'cacheFile' => __DIR__ . '/route.cache', /* required */ - 'cacheDisabled' => IS_DEBUG_ENABLED, /* optional, enabled by default */ -]); -``` - -The second parameter to the function is an options array, which can be used to specify the cache -file location, among other things. - -### Dispatching a URI - -A URI is dispatched by calling the `dispatch()` method of the created dispatcher. This method -accepts the HTTP method and a URI. Getting those two bits of information (and normalizing them -appropriately) is your job - this library is not bound to the PHP web SAPIs. - -The `dispatch()` method returns an array whose first element contains a status code. It is one -of `Dispatcher::NOT_FOUND`, `Dispatcher::METHOD_NOT_ALLOWED` and `Dispatcher::FOUND`. For the -method not allowed status the second array element contains a list of HTTP methods allowed for -the supplied URI. For example: - - [FastRoute\Dispatcher::METHOD_NOT_ALLOWED, ['GET', 'POST']] - -> **NOTE:** The HTTP specification requires that a `405 Method Not Allowed` response include the -`Allow:` header to detail available methods for the requested resource. Applications using FastRoute -should use the second array element to add this header when relaying a 405 response. - -For the found status the second array element is the handler that was associated with the route -and the third array element is a dictionary of placeholder names to their values. For example: - - /* Routing against GET /user/nikic/42 */ - - [FastRoute\Dispatcher::FOUND, 'handler0', ['name' => 'nikic', 'id' => '42']] - -### Overriding the route parser and dispatcher - -The routing process makes use of three components: A route parser, a data generator and a -dispatcher. The three components adhere to the following interfaces: - -```php - 'FastRoute\\RouteParser\\Std', - 'dataGenerator' => 'FastRoute\\DataGenerator\\GroupCountBased', - 'dispatcher' => 'FastRoute\\Dispatcher\\GroupCountBased', -]); -``` - -The above options array corresponds to the defaults. By replacing `GroupCountBased` by -`GroupPosBased` you could switch to a different dispatching strategy. - -### A Note on HEAD Requests - -The HTTP spec requires servers to [support both GET and HEAD methods][2616-511]: - -> The methods GET and HEAD MUST be supported by all general-purpose servers - -To avoid forcing users to manually register HEAD routes for each resource we fallback to matching an -available GET route for a given resource. The PHP web SAPI transparently removes the entity body -from HEAD responses so this behavior has no effect on the vast majority of users. - -However, implementers using FastRoute outside the web SAPI environment (e.g. a custom server) MUST -NOT send entity bodies generated in response to HEAD requests. If you are a non-SAPI user this is -*your responsibility*; FastRoute has no purview to prevent you from breaking HTTP in such cases. - -Finally, note that applications MAY always specify their own HEAD method route for a given -resource to bypass this behavior entirely. - -### Credits - -This library is based on a router that [Levi Morrison][levi] implemented for the Aerys server. - -A large number of tests, as well as HTTP compliance considerations, were provided by [Daniel Lowrey][rdlowrey]. - - -[2616-511]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.1 "RFC 2616 Section 5.1.1" -[blog_post]: http://nikic.github.io/2014/02/18/Fast-request-routing-using-regular-expressions.html -[levi]: https://github.com/morrisonlevi -[rdlowrey]: https://github.com/rdlowrey diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/composer.json b/samples/server/petstore/php-slim/vendor/nikic/fast-route/composer.json deleted file mode 100644 index 62aad22b0ce..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/composer.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "nikic/fast-route", - "description": "Fast request router for PHP", - "keywords": ["routing", "router"], - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Nikita Popov", - "email": "nikic@php.net" - } - ], - "require": { - "php": ">=5.4.0" - }, - "autoload": { - "psr-4": { - "FastRoute\\": "src/" - }, - "files": ["src/functions.php"] - } -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/phpunit.xml b/samples/server/petstore/php-slim/vendor/nikic/fast-route/phpunit.xml deleted file mode 100644 index 3c807b6acbc..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/phpunit.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - ./test/ - - - - - - ./src/ - - - diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/BadRouteException.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/BadRouteException.php deleted file mode 100644 index 7e38479661e..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/BadRouteException.php +++ /dev/null @@ -1,6 +0,0 @@ - $route) { - $suffixLen++; - $suffix .= "\t"; - - $regexes[] = '(?:' . $regex . '/(\t{' . $suffixLen . '})\t{' . ($count - $suffixLen) . '})'; - $routeMap[$suffix] = [$route->handler, $route->variables]; - } - - $regex = '~^(?|' . implode('|', $regexes) . ')$~'; - return ['regex' => $regex, 'suffix' => '/' . $suffix, 'routeMap' => $routeMap]; - } -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/GroupCountBased.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/GroupCountBased.php deleted file mode 100644 index d51807f0772..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/GroupCountBased.php +++ /dev/null @@ -1,28 +0,0 @@ - $route) { - $numVariables = count($route->variables); - $numGroups = max($numGroups, $numVariables); - - $regexes[] = $regex . str_repeat('()', $numGroups - $numVariables); - $routeMap[$numGroups + 1] = [$route->handler, $route->variables]; - - ++$numGroups; - } - - $regex = '~^(?|' . implode('|', $regexes) . ')$~'; - return ['regex' => $regex, 'routeMap' => $routeMap]; - } -} - diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/GroupPosBased.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/GroupPosBased.php deleted file mode 100644 index 4152f7a7efc..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/GroupPosBased.php +++ /dev/null @@ -1,25 +0,0 @@ - $route) { - $regexes[] = $regex; - $routeMap[$offset] = [$route->handler, $route->variables]; - - $offset += count($route->variables); - } - - $regex = '~^(?:' . implode('|', $regexes) . ')$~'; - return ['regex' => $regex, 'routeMap' => $routeMap]; - } -} - diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/MarkBased.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/MarkBased.php deleted file mode 100644 index 61359f5e73f..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/MarkBased.php +++ /dev/null @@ -1,25 +0,0 @@ - $route) { - $regexes[] = $regex . '(*MARK:' . $markName . ')'; - $routeMap[$markName] = [$route->handler, $route->variables]; - - ++$markName; - } - - $regex = '~^(?|' . implode('|', $regexes) . ')$~'; - return ['regex' => $regex, 'routeMap' => $routeMap]; - } -} - diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php deleted file mode 100644 index 713d8972f5a..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/DataGenerator/RegexBasedAbstract.php +++ /dev/null @@ -1,144 +0,0 @@ -isStaticRoute($routeData)) { - $this->addStaticRoute($httpMethod, $routeData, $handler); - } else { - $this->addVariableRoute($httpMethod, $routeData, $handler); - } - } - - public function getData() { - if (empty($this->methodToRegexToRoutesMap)) { - return [$this->staticRoutes, []]; - } - - return [$this->staticRoutes, $this->generateVariableRouteData()]; - } - - private function generateVariableRouteData() { - $data = []; - foreach ($this->methodToRegexToRoutesMap as $method => $regexToRoutesMap) { - $chunkSize = $this->computeChunkSize(count($regexToRoutesMap)); - $chunks = array_chunk($regexToRoutesMap, $chunkSize, true); - $data[$method] = array_map([$this, 'processChunk'], $chunks); - } - return $data; - } - - private function computeChunkSize($count) { - $numParts = max(1, round($count / $this->getApproxChunkSize())); - return ceil($count / $numParts); - } - - private function isStaticRoute($routeData) { - return count($routeData) === 1 && is_string($routeData[0]); - } - - private function addStaticRoute($httpMethod, $routeData, $handler) { - $routeStr = $routeData[0]; - - if (isset($this->staticRoutes[$httpMethod][$routeStr])) { - throw new BadRouteException(sprintf( - 'Cannot register two routes matching "%s" for method "%s"', - $routeStr, $httpMethod - )); - } - - if (isset($this->methodToRegexToRoutesMap[$httpMethod])) { - foreach ($this->methodToRegexToRoutesMap[$httpMethod] as $route) { - if ($route->matches($routeStr)) { - throw new BadRouteException(sprintf( - 'Static route "%s" is shadowed by previously defined variable route "%s" for method "%s"', - $routeStr, $route->regex, $httpMethod - )); - } - } - } - - $this->staticRoutes[$httpMethod][$routeStr] = $handler; - } - - private function addVariableRoute($httpMethod, $routeData, $handler) { - list($regex, $variables) = $this->buildRegexForRoute($routeData); - - if (isset($this->methodToRegexToRoutesMap[$httpMethod][$regex])) { - throw new BadRouteException(sprintf( - 'Cannot register two routes matching "%s" for method "%s"', - $regex, $httpMethod - )); - } - - $this->methodToRegexToRoutesMap[$httpMethod][$regex] = new Route( - $httpMethod, $handler, $regex, $variables - ); - } - - private function buildRegexForRoute($routeData) { - $regex = ''; - $variables = []; - foreach ($routeData as $part) { - if (is_string($part)) { - $regex .= preg_quote($part, '~'); - continue; - } - - list($varName, $regexPart) = $part; - - if (isset($variables[$varName])) { - throw new BadRouteException(sprintf( - 'Cannot use the same placeholder "%s" twice', $varName - )); - } - - if ($this->regexHasCapturingGroups($regexPart)) { - throw new BadRouteException(sprintf( - 'Regex "%s" for parameter "%s" contains a capturing group', - $regexPart, $varName - )); - } - - $variables[$varName] = $varName; - $regex .= '(' . $regexPart . ')'; - } - - return [$regex, $variables]; - } - - private function regexHasCapturingGroups($regex) { - if (false === strpos($regex, '(')) { - // Needs to have at least a ( to contain a capturing group - return false; - } - - // Semi-accurate detection for capturing groups - return preg_match( - '~ - (?: - \(\?\( - | \[ [^\]\\\\]* (?: \\\\ . [^\]\\\\]* )* \] - | \\\\ . - ) (*SKIP)(*FAIL) | - \( - (?! - \? (?! <(?![!=]) | P< | \' ) - | \* - ) - ~x', - $regex - ); - } -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher.php deleted file mode 100644 index ea98009bd26..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher.php +++ /dev/null @@ -1,25 +0,0 @@ - 'value', ...]] - * - * @param string $httpMethod - * @param string $uri - * - * @return array - */ - public function dispatch($httpMethod, $uri); -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/CharCountBased.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/CharCountBased.php deleted file mode 100644 index 22ba2406f1e..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/CharCountBased.php +++ /dev/null @@ -1,28 +0,0 @@ -staticRouteMap, $this->variableRouteData) = $data; - } - - protected function dispatchVariableRoute($routeData, $uri) { - foreach ($routeData as $data) { - if (!preg_match($data['regex'], $uri . $data['suffix'], $matches)) { - continue; - } - - list($handler, $varNames) = $data['routeMap'][end($matches)]; - - $vars = []; - $i = 0; - foreach ($varNames as $varName) { - $vars[$varName] = $matches[++$i]; - } - return [self::FOUND, $handler, $vars]; - } - - return [self::NOT_FOUND]; - } -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/GroupCountBased.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/GroupCountBased.php deleted file mode 100644 index 0abd3223130..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/GroupCountBased.php +++ /dev/null @@ -1,28 +0,0 @@ -staticRouteMap, $this->variableRouteData) = $data; - } - - protected function dispatchVariableRoute($routeData, $uri) { - foreach ($routeData as $data) { - if (!preg_match($data['regex'], $uri, $matches)) { - continue; - } - - list($handler, $varNames) = $data['routeMap'][count($matches)]; - - $vars = []; - $i = 0; - foreach ($varNames as $varName) { - $vars[$varName] = $matches[++$i]; - } - return [self::FOUND, $handler, $vars]; - } - - return [self::NOT_FOUND]; - } -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/GroupPosBased.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/GroupPosBased.php deleted file mode 100644 index 32227d4944d..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/GroupPosBased.php +++ /dev/null @@ -1,30 +0,0 @@ -staticRouteMap, $this->variableRouteData) = $data; - } - - protected function dispatchVariableRoute($routeData, $uri) { - foreach ($routeData as $data) { - if (!preg_match($data['regex'], $uri, $matches)) { - continue; - } - - // find first non-empty match - for ($i = 1; '' === $matches[$i]; ++$i); - - list($handler, $varNames) = $data['routeMap'][$i]; - - $vars = []; - foreach ($varNames as $varName) { - $vars[$varName] = $matches[$i++]; - } - return [self::FOUND, $handler, $vars]; - } - - return [self::NOT_FOUND]; - } -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/MarkBased.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/MarkBased.php deleted file mode 100644 index fefa7118571..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/MarkBased.php +++ /dev/null @@ -1,28 +0,0 @@ -staticRouteMap, $this->variableRouteData) = $data; - } - - protected function dispatchVariableRoute($routeData, $uri) { - foreach ($routeData as $data) { - if (!preg_match($data['regex'], $uri, $matches)) { - continue; - } - - list($handler, $varNames) = $data['routeMap'][$matches['MARK']]; - - $vars = []; - $i = 0; - foreach ($varNames as $varName) { - $vars[$varName] = $matches[++$i]; - } - return [self::FOUND, $handler, $vars]; - } - - return [self::NOT_FOUND]; - } -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/RegexBasedAbstract.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/RegexBasedAbstract.php deleted file mode 100644 index 8823b9b2528..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Dispatcher/RegexBasedAbstract.php +++ /dev/null @@ -1,80 +0,0 @@ -staticRouteMap[$httpMethod][$uri])) { - $handler = $this->staticRouteMap[$httpMethod][$uri]; - return [self::FOUND, $handler, []]; - } - - $varRouteData = $this->variableRouteData; - if (isset($varRouteData[$httpMethod])) { - $result = $this->dispatchVariableRoute($varRouteData[$httpMethod], $uri); - if ($result[0] === self::FOUND) { - return $result; - } - } - - // For HEAD requests, attempt fallback to GET - if ($httpMethod === 'HEAD') { - if (isset($this->staticRouteMap['GET'][$uri])) { - $handler = $this->staticRouteMap['GET'][$uri]; - return [self::FOUND, $handler, []]; - } - if (isset($varRouteData['GET'])) { - $result = $this->dispatchVariableRoute($varRouteData['GET'], $uri); - if ($result[0] === self::FOUND) { - return $result; - } - } - } - - // If nothing else matches, try fallback routes - if (isset($this->staticRouteMap['*'][$uri])) { - $handler = $this->staticRouteMap['*'][$uri]; - return [self::FOUND, $handler, []]; - } - if (isset($varRouteData['*'])) { - $result = $this->dispatchVariableRoute($varRouteData['*'], $uri); - if ($result[0] === self::FOUND) { - return $result; - } - } - - // Find allowed methods for this URI by matching against all other HTTP methods as well - $allowedMethods = []; - - foreach ($this->staticRouteMap as $method => $uriMap) { - if ($method !== $httpMethod && isset($uriMap[$uri])) { - $allowedMethods[] = $method; - } - } - - foreach ($varRouteData as $method => $routeData) { - if ($method === $httpMethod) { - continue; - } - - $result = $this->dispatchVariableRoute($routeData, $uri); - if ($result[0] === self::FOUND) { - $allowedMethods[] = $method; - } - } - - // If there are no allowed methods the route simply does not exist - if ($allowedMethods) { - return [self::METHOD_NOT_ALLOWED, $allowedMethods]; - } else { - return [self::NOT_FOUND]; - } - } -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Route.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Route.php deleted file mode 100644 index d71ded18ad2..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/Route.php +++ /dev/null @@ -1,38 +0,0 @@ -httpMethod = $httpMethod; - $this->handler = $handler; - $this->regex = $regex; - $this->variables = $variables; - } - - /** - * Tests whether this route matches the given string. - * - * @param string $str - * - * @return bool - */ - public function matches($str) { - $regex = '~^' . $this->regex . '$~'; - return (bool) preg_match($regex, $str); - } -} - diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/RouteCollector.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/RouteCollector.php deleted file mode 100644 index 4386bbf3aac..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/RouteCollector.php +++ /dev/null @@ -1,46 +0,0 @@ -routeParser = $routeParser; - $this->dataGenerator = $dataGenerator; - } - - /** - * Adds a route to the collection. - * - * The syntax used in the $route string depends on the used route parser. - * - * @param string|string[] $httpMethod - * @param string $route - * @param mixed $handler - */ - public function addRoute($httpMethod, $route, $handler) { - $routeDatas = $this->routeParser->parse($route); - foreach ((array) $httpMethod as $method) { - foreach ($routeDatas as $routeData) { - $this->dataGenerator->addRoute($method, $routeData, $handler); - } - } - } - - /** - * Returns the collected route data, as provided by the data generator. - * - * @return array - */ - public function getData() { - return $this->dataGenerator->getData(); - } -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/RouteParser.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/RouteParser.php deleted file mode 100644 index c089c315163..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/RouteParser.php +++ /dev/null @@ -1,36 +0,0 @@ - $segment) { - if ($segment === '' && $n !== 0) { - throw new BadRouteException("Empty optional part"); - } - - $currentRoute .= $segment; - $routeDatas[] = $this->parsePlaceholders($currentRoute); - } - return $routeDatas; - } - - /** - * Parses a route string that does not contain optional segments. - */ - private function parsePlaceholders($route) { - if (!preg_match_all( - '~' . self::VARIABLE_REGEX . '~x', $route, $matches, - PREG_OFFSET_CAPTURE | PREG_SET_ORDER - )) { - return [$route]; - } - - $offset = 0; - $routeData = []; - foreach ($matches as $set) { - if ($set[0][1] > $offset) { - $routeData[] = substr($route, $offset, $set[0][1] - $offset); - } - $routeData[] = [ - $set[1][0], - isset($set[2]) ? trim($set[2][0]) : self::DEFAULT_DISPATCH_REGEX - ]; - $offset = $set[0][1] + strlen($set[0][0]); - } - - if ($offset != strlen($route)) { - $routeData[] = substr($route, $offset); - } - - return $routeData; - } -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/bootstrap.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/bootstrap.php deleted file mode 100644 index add216c7d01..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/src/bootstrap.php +++ /dev/null @@ -1,12 +0,0 @@ - 'FastRoute\\RouteParser\\Std', - 'dataGenerator' => 'FastRoute\\DataGenerator\\GroupCountBased', - 'dispatcher' => 'FastRoute\\Dispatcher\\GroupCountBased', - 'routeCollector' => 'FastRoute\\RouteCollector', - ]; - - /** @var RouteCollector $routeCollector */ - $routeCollector = new $options['routeCollector']( - new $options['routeParser'], new $options['dataGenerator'] - ); - $routeDefinitionCallback($routeCollector); - - return new $options['dispatcher']($routeCollector->getData()); - } - - /** - * @param callable $routeDefinitionCallback - * @param array $options - * - * @return Dispatcher - */ - function cachedDispatcher(callable $routeDefinitionCallback, array $options = []) { - $options += [ - 'routeParser' => 'FastRoute\\RouteParser\\Std', - 'dataGenerator' => 'FastRoute\\DataGenerator\\GroupCountBased', - 'dispatcher' => 'FastRoute\\Dispatcher\\GroupCountBased', - 'routeCollector' => 'FastRoute\\RouteCollector', - 'cacheDisabled' => false, - ]; - - if (!isset($options['cacheFile'])) { - throw new \LogicException('Must specify "cacheFile" option'); - } - - if (!$options['cacheDisabled'] && file_exists($options['cacheFile'])) { - $dispatchData = require $options['cacheFile']; - if (!is_array($dispatchData)) { - throw new \RuntimeException('Invalid cache file "' . $options['cacheFile'] . '"'); - } - return new $options['dispatcher']($dispatchData); - } - - $routeCollector = new $options['routeCollector']( - new $options['routeParser'], new $options['dataGenerator'] - ); - $routeDefinitionCallback($routeCollector); - - /** @var RouteCollector $routeCollector */ - $dispatchData = $routeCollector->getData(); - file_put_contents( - $options['cacheFile'], - ' $this->getDataGeneratorClass(), - 'dispatcher' => $this->getDispatcherClass() - ]; - } - - /** - * @dataProvider provideFoundDispatchCases - */ - public function testFoundDispatches($method, $uri, $callback, $handler, $argDict) { - $dispatcher = \FastRoute\simpleDispatcher($callback, $this->generateDispatcherOptions()); - $info = $dispatcher->dispatch($method, $uri); - $this->assertSame($dispatcher::FOUND, $info[0]); - $this->assertSame($handler, $info[1]); - $this->assertSame($argDict, $info[2]); - } - - /** - * @dataProvider provideNotFoundDispatchCases - */ - public function testNotFoundDispatches($method, $uri, $callback) { - $dispatcher = \FastRoute\simpleDispatcher($callback, $this->generateDispatcherOptions()); - $routeInfo = $dispatcher->dispatch($method, $uri); - $this->assertFalse(isset($routeInfo[1]), - "NOT_FOUND result must only contain a single element in the returned info array" - ); - $this->assertSame($dispatcher::NOT_FOUND, $routeInfo[0]); - } - - /** - * @dataProvider provideMethodNotAllowedDispatchCases - */ - public function testMethodNotAllowedDispatches($method, $uri, $callback, $availableMethods) { - $dispatcher = \FastRoute\simpleDispatcher($callback, $this->generateDispatcherOptions()); - $routeInfo = $dispatcher->dispatch($method, $uri); - $this->assertTrue(isset($routeInfo[1]), - "METHOD_NOT_ALLOWED result must return an array of allowed methods at index 1" - ); - - list($routedStatus, $methodArray) = $dispatcher->dispatch($method, $uri); - $this->assertSame($dispatcher::METHOD_NOT_ALLOWED, $routedStatus); - $this->assertSame($availableMethods, $methodArray); - } - - /** - * @expectedException \FastRoute\BadRouteException - * @expectedExceptionMessage Cannot use the same placeholder "test" twice - */ - public function testDuplicateVariableNameError() { - \FastRoute\simpleDispatcher(function(RouteCollector $r) { - $r->addRoute('GET', '/foo/{test}/{test:\d+}', 'handler0'); - }, $this->generateDispatcherOptions()); - } - - /** - * @expectedException \FastRoute\BadRouteException - * @expectedExceptionMessage Cannot register two routes matching "/user/([^/]+)" for method "GET" - */ - public function testDuplicateVariableRoute() { - \FastRoute\simpleDispatcher(function(RouteCollector $r) { - $r->addRoute('GET', '/user/{id}', 'handler0'); // oops, forgot \d+ restriction ;) - $r->addRoute('GET', '/user/{name}', 'handler1'); - }, $this->generateDispatcherOptions()); - } - - /** - * @expectedException \FastRoute\BadRouteException - * @expectedExceptionMessage Cannot register two routes matching "/user" for method "GET" - */ - public function testDuplicateStaticRoute() { - \FastRoute\simpleDispatcher(function(RouteCollector $r) { - $r->addRoute('GET', '/user', 'handler0'); - $r->addRoute('GET', '/user', 'handler1'); - }, $this->generateDispatcherOptions()); - } - - /** - * @expectedException \FastRoute\BadRouteException - * @expectedExceptionMessage Static route "/user/nikic" is shadowed by previously defined variable route "/user/([^/]+)" for method "GET" - */ - public function testShadowedStaticRoute() { - \FastRoute\simpleDispatcher(function(RouteCollector $r) { - $r->addRoute('GET', '/user/{name}', 'handler0'); - $r->addRoute('GET', '/user/nikic', 'handler1'); - }, $this->generateDispatcherOptions()); - } - - /** - * @expectedException \FastRoute\BadRouteException - * @expectedExceptionMessage Regex "(en|de)" for parameter "lang" contains a capturing group - */ - public function testCapturing() { - \FastRoute\simpleDispatcher(function(RouteCollector $r) { - $r->addRoute('GET', '/{lang:(en|de)}', 'handler0'); - }, $this->generateDispatcherOptions()); - } - - public function provideFoundDispatchCases() { - $cases = []; - - // 0 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/resource/123/456', 'handler0'); - }; - - $method = 'GET'; - $uri = '/resource/123/456'; - $handler = 'handler0'; - $argDict = []; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 1 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/handler0', 'handler0'); - $r->addRoute('GET', '/handler1', 'handler1'); - $r->addRoute('GET', '/handler2', 'handler2'); - }; - - $method = 'GET'; - $uri = '/handler2'; - $handler = 'handler2'; - $argDict = []; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 2 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user/{name}/{id:[0-9]+}', 'handler0'); - $r->addRoute('GET', '/user/{id:[0-9]+}', 'handler1'); - $r->addRoute('GET', '/user/{name}', 'handler2'); - }; - - $method = 'GET'; - $uri = '/user/rdlowrey'; - $handler = 'handler2'; - $argDict = ['name' => 'rdlowrey']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 3 --------------------------------------------------------------------------------------> - - // reuse $callback from #2 - - $method = 'GET'; - $uri = '/user/12345'; - $handler = 'handler1'; - $argDict = ['id' => '12345']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 4 --------------------------------------------------------------------------------------> - - // reuse $callback from #3 - - $method = 'GET'; - $uri = '/user/NaN'; - $handler = 'handler2'; - $argDict = ['name' => 'NaN']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 5 --------------------------------------------------------------------------------------> - - // reuse $callback from #4 - - $method = 'GET'; - $uri = '/user/rdlowrey/12345'; - $handler = 'handler0'; - $argDict = ['name' => 'rdlowrey', 'id' => '12345']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 6 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user/{id:[0-9]+}', 'handler0'); - $r->addRoute('GET', '/user/12345/extension', 'handler1'); - $r->addRoute('GET', '/user/{id:[0-9]+}.{extension}', 'handler2'); - - }; - - $method = 'GET'; - $uri = '/user/12345.svg'; - $handler = 'handler2'; - $argDict = ['id' => '12345', 'extension' => 'svg']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 7 ----- Test GET method fallback on HEAD route miss ------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user/{name}', 'handler0'); - $r->addRoute('GET', '/user/{name}/{id:[0-9]+}', 'handler1'); - $r->addRoute('GET', '/static0', 'handler2'); - $r->addRoute('GET', '/static1', 'handler3'); - $r->addRoute('HEAD', '/static1', 'handler4'); - }; - - $method = 'HEAD'; - $uri = '/user/rdlowrey'; - $handler = 'handler0'; - $argDict = ['name' => 'rdlowrey']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 8 ----- Test GET method fallback on HEAD route miss ------------------------------------> - - // reuse $callback from #7 - - $method = 'HEAD'; - $uri = '/user/rdlowrey/1234'; - $handler = 'handler1'; - $argDict = ['name' => 'rdlowrey', 'id' => '1234']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 9 ----- Test GET method fallback on HEAD route miss ------------------------------------> - - // reuse $callback from #8 - - $method = 'HEAD'; - $uri = '/static0'; - $handler = 'handler2'; - $argDict = []; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 10 ---- Test existing HEAD route used if available (no fallback) -----------------------> - - // reuse $callback from #9 - - $method = 'HEAD'; - $uri = '/static1'; - $handler = 'handler4'; - $argDict = []; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 11 ---- More specified routes are not shadowed by less specific of another method ------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user/{name}', 'handler0'); - $r->addRoute('POST', '/user/{name:[a-z]+}', 'handler1'); - }; - - $method = 'POST'; - $uri = '/user/rdlowrey'; - $handler = 'handler1'; - $argDict = ['name' => 'rdlowrey']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 12 ---- Handler of more specific routes is used, if it occurs first --------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user/{name}', 'handler0'); - $r->addRoute('POST', '/user/{name:[a-z]+}', 'handler1'); - $r->addRoute('POST', '/user/{name}', 'handler2'); - }; - - $method = 'POST'; - $uri = '/user/rdlowrey'; - $handler = 'handler1'; - $argDict = ['name' => 'rdlowrey']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 13 ---- Route with constant suffix -----------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user/{name}', 'handler0'); - $r->addRoute('GET', '/user/{name}/edit', 'handler1'); - }; - - $method = 'GET'; - $uri = '/user/rdlowrey/edit'; - $handler = 'handler1'; - $argDict = ['name' => 'rdlowrey']; - - $cases[] = [$method, $uri, $callback, $handler, $argDict]; - - // 14 ---- Handle multiple methods with the same handler ----------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute(['GET', 'POST'], '/user', 'handlerGetPost'); - $r->addRoute(['DELETE'], '/user', 'handlerDelete'); - $r->addRoute([], '/user', 'handlerNone'); - }; - - $argDict = []; - $cases[] = ['GET', '/user', $callback, 'handlerGetPost', $argDict]; - $cases[] = ['POST', '/user', $callback, 'handlerGetPost', $argDict]; - $cases[] = ['DELETE', '/user', $callback, 'handlerDelete', $argDict]; - - // 15 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('POST', '/user.json', 'handler0'); - $r->addRoute('GET', '/{entity}.json', 'handler1'); - }; - - $cases[] = ['GET', '/user.json', $callback, 'handler1', ['entity' => 'user']]; - - // 16 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '', 'handler0'); - }; - - $cases[] = ['GET', '', $callback, 'handler0', []]; - - // 17 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('HEAD', '/a/{foo}', 'handler0'); - $r->addRoute('GET', '/b/{foo}', 'handler1'); - }; - - $cases[] = ['HEAD', '/b/bar', $callback, 'handler1', ['foo' => 'bar']]; - - // 18 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('HEAD', '/a', 'handler0'); - $r->addRoute('GET', '/b', 'handler1'); - }; - - $cases[] = ['HEAD', '/b', $callback, 'handler1', []]; - - // 19 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/foo', 'handler0'); - $r->addRoute('HEAD', '/{bar}', 'handler1'); - }; - - $cases[] = ['HEAD', '/foo', $callback, 'handler1', ['bar' => 'foo']]; - - // 20 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('*', '/user', 'handler0'); - $r->addRoute('*', '/{user}', 'handler1'); - $r->addRoute('GET', '/user', 'handler2'); - }; - - $cases[] = ['GET', '/user', $callback, 'handler2', []]; - - // 21 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('*', '/user', 'handler0'); - $r->addRoute('GET', '/user', 'handler1'); - }; - - $cases[] = ['POST', '/user', $callback, 'handler0', []]; - - // 22 ---- - - $cases[] = ['HEAD', '/user', $callback, 'handler1', []]; - - // 23 ---- - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/{bar}', 'handler0'); - $r->addRoute('*', '/foo', 'handler1'); - }; - - $cases[] = ['GET', '/foo', $callback, 'handler0', ['bar' => 'foo']]; - - // x --------------------------------------------------------------------------------------> - - return $cases; - } - - public function provideNotFoundDispatchCases() { - $cases = []; - - // 0 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/resource/123/456', 'handler0'); - }; - - $method = 'GET'; - $uri = '/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 1 --------------------------------------------------------------------------------------> - - // reuse callback from #0 - $method = 'POST'; - $uri = '/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 2 --------------------------------------------------------------------------------------> - - // reuse callback from #1 - $method = 'PUT'; - $uri = '/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 3 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/handler0', 'handler0'); - $r->addRoute('GET', '/handler1', 'handler1'); - $r->addRoute('GET', '/handler2', 'handler2'); - }; - - $method = 'GET'; - $uri = '/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 4 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user/{name}/{id:[0-9]+}', 'handler0'); - $r->addRoute('GET', '/user/{id:[0-9]+}', 'handler1'); - $r->addRoute('GET', '/user/{name}', 'handler2'); - }; - - $method = 'GET'; - $uri = '/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 5 --------------------------------------------------------------------------------------> - - // reuse callback from #4 - $method = 'GET'; - $uri = '/user/rdlowrey/12345/not-found'; - - $cases[] = [$method, $uri, $callback]; - - // 6 --------------------------------------------------------------------------------------> - - // reuse callback from #5 - $method = 'HEAD'; - - $cases[] = array($method, $uri, $callback); - - // x --------------------------------------------------------------------------------------> - - return $cases; - } - - public function provideMethodNotAllowedDispatchCases() { - $cases = []; - - // 0 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/resource/123/456', 'handler0'); - }; - - $method = 'POST'; - $uri = '/resource/123/456'; - $allowedMethods = ['GET']; - - $cases[] = [$method, $uri, $callback, $allowedMethods]; - - // 1 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/resource/123/456', 'handler0'); - $r->addRoute('POST', '/resource/123/456', 'handler1'); - $r->addRoute('PUT', '/resource/123/456', 'handler2'); - $r->addRoute('*', '/', 'handler3'); - }; - - $method = 'DELETE'; - $uri = '/resource/123/456'; - $allowedMethods = ['GET', 'POST', 'PUT']; - - $cases[] = [$method, $uri, $callback, $allowedMethods]; - - // 2 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('GET', '/user/{name}/{id:[0-9]+}', 'handler0'); - $r->addRoute('POST', '/user/{name}/{id:[0-9]+}', 'handler1'); - $r->addRoute('PUT', '/user/{name}/{id:[0-9]+}', 'handler2'); - $r->addRoute('PATCH', '/user/{name}/{id:[0-9]+}', 'handler3'); - }; - - $method = 'DELETE'; - $uri = '/user/rdlowrey/42'; - $allowedMethods = ['GET', 'POST', 'PUT', 'PATCH']; - - $cases[] = [$method, $uri, $callback, $allowedMethods]; - - // 3 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute('POST', '/user/{name}', 'handler1'); - $r->addRoute('PUT', '/user/{name:[a-z]+}', 'handler2'); - $r->addRoute('PATCH', '/user/{name:[a-z]+}', 'handler3'); - }; - - $method = 'GET'; - $uri = '/user/rdlowrey'; - $allowedMethods = ['POST', 'PUT', 'PATCH']; - - $cases[] = [$method, $uri, $callback, $allowedMethods]; - - // 4 --------------------------------------------------------------------------------------> - - $callback = function(RouteCollector $r) { - $r->addRoute(['GET', 'POST'], '/user', 'handlerGetPost'); - $r->addRoute(['DELETE'], '/user', 'handlerDelete'); - $r->addRoute([], '/user', 'handlerNone'); - }; - - $cases[] = ['PUT', '/user', $callback, ['GET', 'POST', 'DELETE']]; - - // 5 - - $callback = function(RouteCollector $r) { - $r->addRoute('POST', '/user.json', 'handler0'); - $r->addRoute('GET', '/{entity}.json', 'handler1'); - }; - - $cases[] = ['PUT', '/user.json', $callback, ['POST', 'GET']]; - - // x --------------------------------------------------------------------------------------> - - return $cases; - } - -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/Dispatcher/GroupCountBasedTest.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/Dispatcher/GroupCountBasedTest.php deleted file mode 100644 index 74820fcaf98..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/Dispatcher/GroupCountBasedTest.php +++ /dev/null @@ -1,13 +0,0 @@ -markTestSkipped('PHP 5.6 required for MARK support'); - } - } - - protected function getDispatcherClass() { - return 'FastRoute\\Dispatcher\\MarkBased'; - } - - protected function getDataGeneratorClass() { - return 'FastRoute\\DataGenerator\\MarkBased'; - } -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/HackTypechecker/HackTypecheckerTest.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/HackTypechecker/HackTypecheckerTest.php deleted file mode 100644 index 7bc6ebb310d..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/HackTypechecker/HackTypecheckerTest.php +++ /dev/null @@ -1,39 +0,0 @@ -markTestSkipped("HHVM only"); - } - if (!version_compare(HHVM_VERSION, '3.9.0', '>=')) { - $this->markTestSkipped('classname requires HHVM 3.9+'); - } - - // The typechecker recurses the whole tree, so it makes sure - // that everything in fixtures/ is valid when this runs. - - $output = array(); - $exit_code = null; - exec( - 'hh_server --check '.escapeshellarg(__DIR__.'/../../').' 2>&1', - $output, - $exit_code - ); - if ($exit_code === self::SERVER_ALREADY_RUNNING_CODE) { - $this->assertTrue( - $recurse, - "Typechecker still running after running hh_client stop" - ); - // Server already running - 3.10 => 3.11 regression: - // https://github.com/facebook/hhvm/issues/6646 - exec('hh_client stop 2>/dev/null'); - $this->testTypechecks(/* recurse = */ false); - return; - - } - $this->assertSame(0, $exit_code, implode("\n", $output)); - } -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/all_options.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/all_options.php deleted file mode 100644 index 05a9af231b4..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/all_options.php +++ /dev/null @@ -1,29 +0,0 @@ - {}, - shape( - 'routeParser' => \FastRoute\RouteParser\Std::class, - 'dataGenerator' => \FastRoute\DataGenerator\GroupCountBased::class, - 'dispatcher' => \FastRoute\Dispatcher\GroupCountBased::class, - 'routeCollector' => \FastRoute\RouteCollector::class, - ), - ); -} - -function all_options_cached(): \FastRoute\Dispatcher { - return \FastRoute\cachedDispatcher( - $collector ==> {}, - shape( - 'routeParser' => \FastRoute\RouteParser\Std::class, - 'dataGenerator' => \FastRoute\DataGenerator\GroupCountBased::class, - 'dispatcher' => \FastRoute\Dispatcher\GroupCountBased::class, - 'routeCollector' => \FastRoute\RouteCollector::class, - 'cacheFile' => '/dev/null', - 'cacheDisabled' => false, - ), - ); -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/empty_options.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/empty_options.php deleted file mode 100644 index 61eb54190d9..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/empty_options.php +++ /dev/null @@ -1,11 +0,0 @@ - {}, shape()); -} - -function empty_options_cached(): \FastRoute\Dispatcher { - return \FastRoute\cachedDispatcher($collector ==> {}, shape()); -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/no_options.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/no_options.php deleted file mode 100644 index 44b5422f583..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/HackTypechecker/fixtures/no_options.php +++ /dev/null @@ -1,11 +0,0 @@ - {}); -} - -function no_options_cached(): \FastRoute\Dispatcher { - return \FastRoute\cachedDispatcher($collector ==> {}); -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/RouteParser/StdTest.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/RouteParser/StdTest.php deleted file mode 100644 index 41f194ba8b6..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/RouteParser/StdTest.php +++ /dev/null @@ -1,147 +0,0 @@ -parse($routeString); - $this->assertSame($expectedRouteDatas, $routeDatas); - } - - /** @dataProvider provideTestParseError */ - public function testParseError($routeString, $expectedExceptionMessage) { - $parser = new Std(); - $this->setExpectedException('FastRoute\\BadRouteException', $expectedExceptionMessage); - $parser->parse($routeString); - } - - public function provideTestParse() { - return [ - [ - '/test', - [ - ['/test'], - ] - ], - [ - '/test/{param}', - [ - ['/test/', ['param', '[^/]+']], - ] - ], - [ - '/te{ param }st', - [ - ['/te', ['param', '[^/]+'], 'st'] - ] - ], - [ - '/test/{param1}/test2/{param2}', - [ - ['/test/', ['param1', '[^/]+'], '/test2/', ['param2', '[^/]+']] - ] - ], - [ - '/test/{param:\d+}', - [ - ['/test/', ['param', '\d+']] - ] - ], - [ - '/test/{ param : \d{1,9} }', - [ - ['/test/', ['param', '\d{1,9}']] - ] - ], - [ - '/test[opt]', - [ - ['/test'], - ['/testopt'], - ] - ], - [ - '/test[/{param}]', - [ - ['/test'], - ['/test/', ['param', '[^/]+']], - ] - ], - [ - '/{param}[opt]', - [ - ['/', ['param', '[^/]+']], - ['/', ['param', '[^/]+'], 'opt'] - ] - ], - [ - '/test[/{name}[/{id:[0-9]+}]]', - [ - ['/test'], - ['/test/', ['name', '[^/]+']], - ['/test/', ['name', '[^/]+'], '/', ['id', '[0-9]+']], - ] - ], - [ - '', - [ - [''], - ] - ], - [ - '[test]', - [ - [''], - ['test'], - ] - ], - [ - '/{foo-bar}', - [ - ['/', ['foo-bar', '[^/]+']] - ] - ], - [ - '/{_foo:.*}', - [ - ['/', ['_foo', '.*']] - ] - ], - ]; - } - - public function provideTestParseError() { - return [ - [ - '/test[opt', - "Number of opening '[' and closing ']' does not match" - ], - [ - '/test[opt[opt2]', - "Number of opening '[' and closing ']' does not match" - ], - [ - '/testopt]', - "Number of opening '[' and closing ']' does not match" - ], - [ - '/test[]', - "Empty optional part" - ], - [ - '/test[[opt]]', - "Empty optional part" - ], - [ - '[[test]]', - "Empty optional part" - ], - [ - '/test[/opt]/required', - "Optional segments can only occur at the end of a route" - ], - ]; - } -} diff --git a/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/bootstrap.php b/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/bootstrap.php deleted file mode 100644 index 27e6d4c8fbd..00000000000 --- a/samples/server/petstore/php-slim/vendor/nikic/fast-route/test/bootstrap.php +++ /dev/null @@ -1,11 +0,0 @@ -> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi - -script: - - cd ext/pimple - - if [ "$PIMPLE_EXT" == "yes" ]; then yes n | make test | tee output ; grep -E 'Tests failed +. +0' output; fi - - cd ../.. - - phpunit - -matrix: - exclude: - - php: hhvm - env: PIMPLE_EXT=yes diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/CHANGELOG b/samples/server/petstore/php-slim/vendor/pimple/pimple/CHANGELOG deleted file mode 100644 index cc679972ec7..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/CHANGELOG +++ /dev/null @@ -1,35 +0,0 @@ -* 3.0.2 (2015-09-11) - - * refactored the C extension - * minor non-significant changes - -* 3.0.1 (2015-07-30) - - * simplified some code - * fixed a segfault in the C extension - -* 3.0.0 (2014-07-24) - - * removed the Pimple class alias (use Pimple\Container instead) - -* 2.1.1 (2014-07-24) - - * fixed compiler warnings for the C extension - * fixed code when dealing with circular references - -* 2.1.0 (2014-06-24) - - * moved the Pimple to Pimple\Container (with a BC layer -- Pimple is now a - deprecated alias which will be removed in Pimple 3.0) - * added Pimple\ServiceProviderInterface (and Pimple::register()) - -* 2.0.0 (2014-02-10) - - * changed extend to automatically re-assign the extended service and keep it as shared or factory - (to keep BC, extend still returns the extended service) - * changed services to be shared by default (use factory() for factory - services) - -* 1.0.0 - - * initial version diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/README.rst b/samples/server/petstore/php-slim/vendor/pimple/pimple/README.rst deleted file mode 100644 index 93fb35a89b7..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/README.rst +++ /dev/null @@ -1,201 +0,0 @@ -Pimple -====== - -.. caution:: - - This is the documentation for Pimple 3.x. If you are using Pimple 1.x, read - the `Pimple 1.x documentation`_. Reading the Pimple 1.x code is also a good - way to learn more about how to create a simple Dependency Injection - Container (recent versions of Pimple are more focused on performance). - -Pimple is a small Dependency Injection Container for PHP. - -Installation ------------- - -Before using Pimple in your project, add it to your ``composer.json`` file: - -.. code-block:: bash - - $ ./composer.phar require pimple/pimple ~3.0 - -Alternatively, Pimple is also available as a PHP C extension: - -.. code-block:: bash - - $ git clone https://github.com/silexphp/Pimple - $ cd Pimple/ext/pimple - $ phpize - $ ./configure - $ make - $ make install - -Usage ------ - -Creating a container is a matter of creating a ``Container`` instance: - -.. code-block:: php - - use Pimple\Container; - - $container = new Container(); - -As many other dependency injection containers, Pimple manages two different -kind of data: **services** and **parameters**. - -Defining Services -~~~~~~~~~~~~~~~~~ - -A service is an object that does something as part of a larger system. Examples -of services: a database connection, a templating engine, or a mailer. Almost -any **global** object can be a service. - -Services are defined by **anonymous functions** that return an instance of an -object: - -.. code-block:: php - - // define some services - $container['session_storage'] = function ($c) { - return new SessionStorage('SESSION_ID'); - }; - - $container['session'] = function ($c) { - return new Session($c['session_storage']); - }; - -Notice that the anonymous function has access to the current container -instance, allowing references to other services or parameters. - -As objects are only created when you get them, the order of the definitions -does not matter. - -Using the defined services is also very easy: - -.. code-block:: php - - // get the session object - $session = $container['session']; - - // the above call is roughly equivalent to the following code: - // $storage = new SessionStorage('SESSION_ID'); - // $session = new Session($storage); - -Defining Factory Services -~~~~~~~~~~~~~~~~~~~~~~~~~ - -By default, each time you get a service, Pimple returns the **same instance** -of it. If you want a different instance to be returned for all calls, wrap your -anonymous function with the ``factory()`` method - -.. code-block:: php - - $container['session'] = $container->factory(function ($c) { - return new Session($c['session_storage']); - }); - -Now, each call to ``$container['session']`` returns a new instance of the -session. - -Defining Parameters -~~~~~~~~~~~~~~~~~~~ - -Defining a parameter allows to ease the configuration of your container from -the outside and to store global values: - -.. code-block:: php - - // define some parameters - $container['cookie_name'] = 'SESSION_ID'; - $container['session_storage_class'] = 'SessionStorage'; - -If you change the ``session_storage`` service definition like below: - -.. code-block:: php - - $container['session_storage'] = function ($c) { - return new $c['session_storage_class']($c['cookie_name']); - }; - -You can now easily change the cookie name by overriding the -``session_storage_class`` parameter instead of redefining the service -definition. - -Protecting Parameters -~~~~~~~~~~~~~~~~~~~~~ - -Because Pimple sees anonymous functions as service definitions, you need to -wrap anonymous functions with the ``protect()`` method to store them as -parameters: - -.. code-block:: php - - $container['random_func'] = $container->protect(function () { - return rand(); - }); - -Modifying Services after Definition -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -In some cases you may want to modify a service definition after it has been -defined. You can use the ``extend()`` method to define additional code to be -run on your service just after it is created: - -.. code-block:: php - - $container['session_storage'] = function ($c) { - return new $c['session_storage_class']($c['cookie_name']); - }; - - $container->extend('session_storage', function ($storage, $c) { - $storage->...(); - - return $storage; - }); - -The first argument is the name of the service to extend, the second a function -that gets access to the object instance and the container. - -Extending a Container -~~~~~~~~~~~~~~~~~~~~~ - -If you use the same libraries over and over, you might want to reuse some -services from one project to the next one; package your services into a -**provider** by implementing ``Pimple\ServiceProviderInterface``: - -.. code-block:: php - - use Pimple\Container; - - class FooProvider implements Pimple\ServiceProviderInterface - { - public function register(Container $pimple) - { - // register some services and parameters - // on $pimple - } - } - -Then, register the provider on a Container: - -.. code-block:: php - - $pimple->register(new FooProvider()); - -Fetching the Service Creation Function -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -When you access an object, Pimple automatically calls the anonymous function -that you defined, which creates the service object for you. If you want to get -raw access to this function, you can use the ``raw()`` method: - -.. code-block:: php - - $container['session'] = function ($c) { - return new Session($c['session_storage']); - }; - - $sessionFunction = $container->raw('session'); - -.. _Pimple 1.x documentation: https://github.com/silexphp/Pimple/tree/1.1 diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/composer.json b/samples/server/petstore/php-slim/vendor/pimple/pimple/composer.json deleted file mode 100644 index a5268f16118..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "pimple/pimple", - "type": "library", - "description": "Pimple, a simple Dependency Injection Container", - "keywords": ["dependency injection", "container"], - "homepage": "http://pimple.sensiolabs.org", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "require": { - "php": ">=5.3.0" - }, - "autoload": { - "psr-0": { "Pimple": "src/" } - }, - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - } -} diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/.gitignore b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/.gitignore deleted file mode 100644 index 1861088ac1f..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -*.sw* -.deps -Makefile -Makefile.fragments -Makefile.global -Makefile.objects -acinclude.m4 -aclocal.m4 -build/ -config.cache -config.guess -config.h -config.h.in -config.log -config.nice -config.status -config.sub -configure -configure.in -install-sh -libtool -ltmain.sh -missing -mkinstalldirs -run-tests.php -*.loT -.libs/ -modules/ -*.la -*.lo diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/README.md b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/README.md deleted file mode 100644 index 7b39eb2929e..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/README.md +++ /dev/null @@ -1,12 +0,0 @@ -This is Pimple 2 implemented in C - -* PHP >= 5.3 -* Not tested under Windows, might work - -Install -======= - - > phpize - > ./configure - > make - > make install diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/config.m4 b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/config.m4 deleted file mode 100644 index c9ba17ddbd5..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/config.m4 +++ /dev/null @@ -1,63 +0,0 @@ -dnl $Id$ -dnl config.m4 for extension pimple - -dnl Comments in this file start with the string 'dnl'. -dnl Remove where necessary. This file will not work -dnl without editing. - -dnl If your extension references something external, use with: - -dnl PHP_ARG_WITH(pimple, for pimple support, -dnl Make sure that the comment is aligned: -dnl [ --with-pimple Include pimple support]) - -dnl Otherwise use enable: - -PHP_ARG_ENABLE(pimple, whether to enable pimple support, -dnl Make sure that the comment is aligned: -[ --enable-pimple Enable pimple support]) - -if test "$PHP_PIMPLE" != "no"; then - dnl Write more examples of tests here... - - dnl # --with-pimple -> check with-path - dnl SEARCH_PATH="/usr/local /usr" # you might want to change this - dnl SEARCH_FOR="/include/pimple.h" # you most likely want to change this - dnl if test -r $PHP_PIMPLE/$SEARCH_FOR; then # path given as parameter - dnl PIMPLE_DIR=$PHP_PIMPLE - dnl else # search default path list - dnl AC_MSG_CHECKING([for pimple files in default path]) - dnl for i in $SEARCH_PATH ; do - dnl if test -r $i/$SEARCH_FOR; then - dnl PIMPLE_DIR=$i - dnl AC_MSG_RESULT(found in $i) - dnl fi - dnl done - dnl fi - dnl - dnl if test -z "$PIMPLE_DIR"; then - dnl AC_MSG_RESULT([not found]) - dnl AC_MSG_ERROR([Please reinstall the pimple distribution]) - dnl fi - - dnl # --with-pimple -> add include path - dnl PHP_ADD_INCLUDE($PIMPLE_DIR/include) - - dnl # --with-pimple -> check for lib and symbol presence - dnl LIBNAME=pimple # you may want to change this - dnl LIBSYMBOL=pimple # you most likely want to change this - - dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL, - dnl [ - dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $PIMPLE_DIR/lib, PIMPLE_SHARED_LIBADD) - dnl AC_DEFINE(HAVE_PIMPLELIB,1,[ ]) - dnl ],[ - dnl AC_MSG_ERROR([wrong pimple lib version or lib not found]) - dnl ],[ - dnl -L$PIMPLE_DIR/lib -lm - dnl ]) - dnl - dnl PHP_SUBST(PIMPLE_SHARED_LIBADD) - - PHP_NEW_EXTENSION(pimple, pimple.c, $ext_shared) -fi diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/config.w32 b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/config.w32 deleted file mode 100644 index 39857b3254b..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/config.w32 +++ /dev/null @@ -1,13 +0,0 @@ -// $Id$ -// vim:ft=javascript - -// If your extension references something external, use ARG_WITH -// ARG_WITH("pimple", "for pimple support", "no"); - -// Otherwise, use ARG_ENABLE -// ARG_ENABLE("pimple", "enable pimple support", "no"); - -if (PHP_PIMPLE != "no") { - EXTENSION("pimple", "pimple.c"); -} - diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/php_pimple.h b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/php_pimple.h deleted file mode 100644 index 49431f08a84..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/php_pimple.h +++ /dev/null @@ -1,121 +0,0 @@ - -/* - * This file is part of Pimple. - * - * Copyright (c) 2014 Fabien Potencier - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished - * to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef PHP_PIMPLE_H -#define PHP_PIMPLE_H - -extern zend_module_entry pimple_module_entry; -#define phpext_pimple_ptr &pimple_module_entry - -#ifdef PHP_WIN32 -# define PHP_PIMPLE_API __declspec(dllexport) -#elif defined(__GNUC__) && __GNUC__ >= 4 -# define PHP_PIMPLE_API __attribute__ ((visibility("default"))) -#else -# define PHP_PIMPLE_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -#define PIMPLE_VERSION "3.0.2" -#define PIMPLE_NS "Pimple" - -#define PIMPLE_DEFAULT_ZVAL_CACHE_NUM 5 -#define PIMPLE_DEFAULT_ZVAL_VALUES_NUM 10 - -zend_module_entry *get_module(void); - -PHP_MINIT_FUNCTION(pimple); -PHP_MINFO_FUNCTION(pimple); - -PHP_METHOD(Pimple, __construct); -PHP_METHOD(Pimple, factory); -PHP_METHOD(Pimple, protect); -PHP_METHOD(Pimple, raw); -PHP_METHOD(Pimple, extend); -PHP_METHOD(Pimple, keys); -PHP_METHOD(Pimple, register); -PHP_METHOD(Pimple, offsetSet); -PHP_METHOD(Pimple, offsetUnset); -PHP_METHOD(Pimple, offsetGet); -PHP_METHOD(Pimple, offsetExists); - -PHP_METHOD(PimpleClosure, invoker); - -typedef struct _pimple_bucket_value { - zval *value; /* Must be the first element */ - zval *raw; - zend_object_handle handle_num; - enum { - PIMPLE_IS_PARAM = 0, - PIMPLE_IS_SERVICE = 2 - } type; - zend_bool initialized; - zend_fcall_info_cache fcc; -} pimple_bucket_value; - -typedef struct _pimple_object { - zend_object zobj; - HashTable values; - HashTable factories; - HashTable protected; -} pimple_object; - -typedef struct _pimple_closure_object { - zend_object zobj; - zval *callable; - zval *factory; -} pimple_closure_object; - -static const char sensiolabs_logo[] = ""; - -static int pimple_zval_to_pimpleval(zval *_zval, pimple_bucket_value *_pimple_bucket_value TSRMLS_DC); -static int pimple_zval_is_valid_callback(zval *_zval, pimple_bucket_value *_pimple_bucket_value TSRMLS_DC); - -static void pimple_bucket_dtor(pimple_bucket_value *bucket); -static void pimple_free_bucket(pimple_bucket_value *bucket); - -static zval *pimple_object_read_dimension(zval *object, zval *offset, int type TSRMLS_DC); -static void pimple_object_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC); -static int pimple_object_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC); -static void pimple_object_unset_dimension(zval *object, zval *offset TSRMLS_DC); -static zend_object_value pimple_object_create(zend_class_entry *ce TSRMLS_DC); -static void pimple_free_object_storage(pimple_object *obj TSRMLS_DC); - -static void pimple_closure_free_object_storage(pimple_closure_object *obj TSRMLS_DC); -static zend_object_value pimple_closure_object_create(zend_class_entry *ce TSRMLS_DC); -static zend_function *pimple_closure_get_constructor(zval * TSRMLS_DC); -static int pimple_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, union _zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC); - -#ifdef ZTS -#define PIMPLE_G(v) TSRMG(pimple_globals_id, zend_pimple_globals *, v) -#else -#define PIMPLE_G(v) (pimple_globals.v) -#endif - -#endif /* PHP_PIMPLE_H */ - diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/pimple.c b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/pimple.c deleted file mode 100644 index 821365bf127..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/pimple.c +++ /dev/null @@ -1,922 +0,0 @@ - -/* - * This file is part of Pimple. - * - * Copyright (c) 2014 Fabien Potencier - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished - * to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_pimple.h" -#include "pimple_compat.h" -#include "zend_interfaces.h" -#include "zend.h" -#include "Zend/zend_closures.h" -#include "ext/spl/spl_exceptions.h" -#include "Zend/zend_exceptions.h" -#include "main/php_output.h" -#include "SAPI.h" - -static zend_class_entry *pimple_ce; -static zend_object_handlers pimple_object_handlers; -static zend_class_entry *pimple_closure_ce; -static zend_class_entry *pimple_serviceprovider_ce; -static zend_object_handlers pimple_closure_object_handlers; -static zend_internal_function pimple_closure_invoker_function; - -#define FETCH_DIM_HANDLERS_VARS pimple_object *pimple_obj = NULL; \ - ulong index; \ - pimple_obj = (pimple_object *)zend_object_store_get_object(object TSRMLS_CC); \ - -#define PIMPLE_OBJECT_HANDLE_INHERITANCE_OBJECT_HANDLERS do { \ - if (ce != pimple_ce) { \ - zend_hash_find(&ce->function_table, ZEND_STRS("offsetget"), (void **)&function); \ - if (function->common.scope != ce) { /* if the function is not defined in this actual class */ \ - pimple_object_handlers.read_dimension = pimple_object_read_dimension; /* then overwrite the handler to use custom one */ \ - } \ - zend_hash_find(&ce->function_table, ZEND_STRS("offsetset"), (void **)&function); \ - if (function->common.scope != ce) { \ - pimple_object_handlers.write_dimension = pimple_object_write_dimension; \ - } \ - zend_hash_find(&ce->function_table, ZEND_STRS("offsetexists"), (void **)&function); \ - if (function->common.scope != ce) { \ - pimple_object_handlers.has_dimension = pimple_object_has_dimension; \ - } \ - zend_hash_find(&ce->function_table, ZEND_STRS("offsetunset"), (void **)&function); \ - if (function->common.scope != ce) { \ - pimple_object_handlers.unset_dimension = pimple_object_unset_dimension; \ - } \ - } else { \ - pimple_object_handlers.read_dimension = pimple_object_read_dimension; \ - pimple_object_handlers.write_dimension = pimple_object_write_dimension; \ - pimple_object_handlers.has_dimension = pimple_object_has_dimension; \ - pimple_object_handlers.unset_dimension = pimple_object_unset_dimension; \ - }\ - } while(0); - -#define PIMPLE_CALL_CB do { \ - zend_fcall_info_argn(&fci TSRMLS_CC, 1, &object); \ - fci.size = sizeof(fci); \ - fci.object_ptr = retval->fcc.object_ptr; \ - fci.function_name = retval->value; \ - fci.no_separation = 1; \ - fci.retval_ptr_ptr = &retval_ptr_ptr; \ -\ - zend_call_function(&fci, &retval->fcc TSRMLS_CC); \ - efree(fci.params); \ - if (EG(exception)) { \ - return EG(uninitialized_zval_ptr); \ - } \ - } while(0); - -ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, 0, 0, 0) -ZEND_ARG_ARRAY_INFO(0, value, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetset, 0, 0, 2) -ZEND_ARG_INFO(0, offset) -ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetget, 0, 0, 1) -ZEND_ARG_INFO(0, offset) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetexists, 0, 0, 1) -ZEND_ARG_INFO(0, offset) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetunset, 0, 0, 1) -ZEND_ARG_INFO(0, offset) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_factory, 0, 0, 1) -ZEND_ARG_INFO(0, callable) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_protect, 0, 0, 1) -ZEND_ARG_INFO(0, callable) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_raw, 0, 0, 1) -ZEND_ARG_INFO(0, id) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_extend, 0, 0, 2) -ZEND_ARG_INFO(0, id) -ZEND_ARG_INFO(0, callable) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_keys, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_register, 0, 0, 1) -ZEND_ARG_OBJ_INFO(0, provider, Pimple\\ServiceProviderInterface, 0) -ZEND_ARG_ARRAY_INFO(0, values, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_serviceprovider_register, 0, 0, 1) -ZEND_ARG_OBJ_INFO(0, pimple, Pimple\\Container, 0) -ZEND_END_ARG_INFO() - -static const zend_function_entry pimple_ce_functions[] = { - PHP_ME(Pimple, __construct, arginfo___construct, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, factory, arginfo_factory, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, protect, arginfo_protect, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, raw, arginfo_raw, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, extend, arginfo_extend, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, keys, arginfo_keys, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, register, arginfo_register, ZEND_ACC_PUBLIC) - - PHP_ME(Pimple, offsetSet, arginfo_offsetset, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, offsetGet, arginfo_offsetget, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, offsetExists, arginfo_offsetexists, ZEND_ACC_PUBLIC) - PHP_ME(Pimple, offsetUnset, arginfo_offsetunset, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - -static const zend_function_entry pimple_serviceprovider_iface_ce_functions[] = { - PHP_ABSTRACT_ME(ServiceProviderInterface, register, arginfo_serviceprovider_register) - PHP_FE_END -}; - -static void pimple_closure_free_object_storage(pimple_closure_object *obj TSRMLS_DC) -{ - zend_object_std_dtor(&obj->zobj TSRMLS_CC); - if (obj->factory) { - zval_ptr_dtor(&obj->factory); - } - if (obj->callable) { - zval_ptr_dtor(&obj->callable); - } - efree(obj); -} - -static void pimple_free_object_storage(pimple_object *obj TSRMLS_DC) -{ - zend_hash_destroy(&obj->factories); - zend_hash_destroy(&obj->protected); - zend_hash_destroy(&obj->values); - zend_object_std_dtor(&obj->zobj TSRMLS_CC); - efree(obj); -} - -static void pimple_free_bucket(pimple_bucket_value *bucket) -{ - if (bucket->raw) { - zval_ptr_dtor(&bucket->raw); - } -} - -static zend_object_value pimple_closure_object_create(zend_class_entry *ce TSRMLS_DC) -{ - zend_object_value retval; - pimple_closure_object *pimple_closure_obj = NULL; - - pimple_closure_obj = ecalloc(1, sizeof(pimple_closure_object)); - ZEND_OBJ_INIT(&pimple_closure_obj->zobj, ce); - - pimple_closure_object_handlers.get_constructor = pimple_closure_get_constructor; - retval.handlers = &pimple_closure_object_handlers; - retval.handle = zend_objects_store_put(pimple_closure_obj, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) pimple_closure_free_object_storage, NULL TSRMLS_CC); - - return retval; -} - -static zend_function *pimple_closure_get_constructor(zval *obj TSRMLS_DC) -{ - zend_error(E_ERROR, "Pimple\\ContainerClosure is an internal class and cannot be instantiated"); - - return NULL; -} - -static int pimple_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, union _zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC) -{ - *zobj_ptr = obj; - *ce_ptr = Z_OBJCE_P(obj); - *fptr_ptr = (zend_function *)&pimple_closure_invoker_function; - - return SUCCESS; -} - -static zend_object_value pimple_object_create(zend_class_entry *ce TSRMLS_DC) -{ - zend_object_value retval; - pimple_object *pimple_obj = NULL; - zend_function *function = NULL; - - pimple_obj = emalloc(sizeof(pimple_object)); - ZEND_OBJ_INIT(&pimple_obj->zobj, ce); - - PIMPLE_OBJECT_HANDLE_INHERITANCE_OBJECT_HANDLERS - - retval.handlers = &pimple_object_handlers; - retval.handle = zend_objects_store_put(pimple_obj, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) pimple_free_object_storage, NULL TSRMLS_CC); - - zend_hash_init(&pimple_obj->factories, PIMPLE_DEFAULT_ZVAL_CACHE_NUM, NULL, (dtor_func_t)pimple_bucket_dtor, 0); - zend_hash_init(&pimple_obj->protected, PIMPLE_DEFAULT_ZVAL_CACHE_NUM, NULL, (dtor_func_t)pimple_bucket_dtor, 0); - zend_hash_init(&pimple_obj->values, PIMPLE_DEFAULT_ZVAL_VALUES_NUM, NULL, (dtor_func_t)pimple_bucket_dtor, 0); - - return retval; -} - -static void pimple_object_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) -{ - FETCH_DIM_HANDLERS_VARS - - pimple_bucket_value pimple_value = {0}, *found_value = NULL; - ulong hash; - - pimple_zval_to_pimpleval(value, &pimple_value TSRMLS_CC); - - if (!offset) {/* $p[] = 'foo' when not overloaded */ - zend_hash_next_index_insert(&pimple_obj->values, (void *)&pimple_value, sizeof(pimple_bucket_value), NULL); - Z_ADDREF_P(value); - return; - } - - switch (Z_TYPE_P(offset)) { - case IS_STRING: - hash = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - zend_hash_quick_find(&pimple_obj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hash, (void **)&found_value); - if (found_value && found_value->type == PIMPLE_IS_SERVICE && found_value->initialized == 1) { - pimple_free_bucket(&pimple_value); - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot override frozen service \"%s\".", Z_STRVAL_P(offset)); - return; - } - if (zend_hash_quick_update(&pimple_obj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hash, (void *)&pimple_value, sizeof(pimple_bucket_value), NULL) == FAILURE) { - pimple_free_bucket(&pimple_value); - return; - } - Z_ADDREF_P(value); - break; - case IS_DOUBLE: - case IS_BOOL: - case IS_LONG: - if (Z_TYPE_P(offset) == IS_DOUBLE) { - index = (ulong)Z_DVAL_P(offset); - } else { - index = Z_LVAL_P(offset); - } - zend_hash_index_find(&pimple_obj->values, index, (void **)&found_value); - if (found_value && found_value->type == PIMPLE_IS_SERVICE && found_value->initialized == 1) { - pimple_free_bucket(&pimple_value); - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot override frozen service \"%ld\".", index); - return; - } - if (zend_hash_index_update(&pimple_obj->values, index, (void *)&pimple_value, sizeof(pimple_bucket_value), NULL) == FAILURE) { - pimple_free_bucket(&pimple_value); - return; - } - Z_ADDREF_P(value); - break; - case IS_NULL: /* $p[] = 'foo' when overloaded */ - zend_hash_next_index_insert(&pimple_obj->values, (void *)&pimple_value, sizeof(pimple_bucket_value), NULL); - Z_ADDREF_P(value); - break; - default: - pimple_free_bucket(&pimple_value); - zend_error(E_WARNING, "Unsupported offset type"); - } -} - -static void pimple_object_unset_dimension(zval *object, zval *offset TSRMLS_DC) -{ - FETCH_DIM_HANDLERS_VARS - - switch (Z_TYPE_P(offset)) { - case IS_STRING: - zend_symtable_del(&pimple_obj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - zend_symtable_del(&pimple_obj->factories, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - zend_symtable_del(&pimple_obj->protected, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - break; - case IS_DOUBLE: - case IS_BOOL: - case IS_LONG: - if (Z_TYPE_P(offset) == IS_DOUBLE) { - index = (ulong)Z_DVAL_P(offset); - } else { - index = Z_LVAL_P(offset); - } - zend_hash_index_del(&pimple_obj->values, index); - zend_hash_index_del(&pimple_obj->factories, index); - zend_hash_index_del(&pimple_obj->protected, index); - break; - default: - zend_error(E_WARNING, "Unsupported offset type"); - } -} - -static int pimple_object_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC) -{ - FETCH_DIM_HANDLERS_VARS - - pimple_bucket_value *retval = NULL; - - switch (Z_TYPE_P(offset)) { - case IS_STRING: - if (zend_symtable_find(&pimple_obj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **)&retval) == SUCCESS) { - switch (check_empty) { - case 0: /* isset */ - return 1; /* Differs from PHP behavior (Z_TYPE_P(retval->value) != IS_NULL;) */ - case 1: /* empty */ - default: - return zend_is_true(retval->value); - } - } - return 0; - break; - case IS_DOUBLE: - case IS_BOOL: - case IS_LONG: - if (Z_TYPE_P(offset) == IS_DOUBLE) { - index = (ulong)Z_DVAL_P(offset); - } else { - index = Z_LVAL_P(offset); - } - if (zend_hash_index_find(&pimple_obj->values, index, (void **)&retval) == SUCCESS) { - switch (check_empty) { - case 0: /* isset */ - return 1; /* Differs from PHP behavior (Z_TYPE_P(retval->value) != IS_NULL;)*/ - case 1: /* empty */ - default: - return zend_is_true(retval->value); - } - } - return 0; - break; - default: - zend_error(E_WARNING, "Unsupported offset type"); - return 0; - } -} - -static zval *pimple_object_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) -{ - FETCH_DIM_HANDLERS_VARS - - pimple_bucket_value *retval = NULL; - zend_fcall_info fci = {0}; - zval *retval_ptr_ptr = NULL; - - switch (Z_TYPE_P(offset)) { - case IS_STRING: - if (zend_symtable_find(&pimple_obj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **)&retval) == FAILURE) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Identifier \"%s\" is not defined.", Z_STRVAL_P(offset)); - return EG(uninitialized_zval_ptr); - } - break; - case IS_DOUBLE: - case IS_BOOL: - case IS_LONG: - if (Z_TYPE_P(offset) == IS_DOUBLE) { - index = (ulong)Z_DVAL_P(offset); - } else { - index = Z_LVAL_P(offset); - } - if (zend_hash_index_find(&pimple_obj->values, index, (void **)&retval) == FAILURE) { - return EG(uninitialized_zval_ptr); - } - break; - case IS_NULL: /* $p[][3] = 'foo' first dim access */ - return EG(uninitialized_zval_ptr); - break; - default: - zend_error(E_WARNING, "Unsupported offset type"); - return EG(uninitialized_zval_ptr); - } - - if(retval->type == PIMPLE_IS_PARAM) { - return retval->value; - } - - if (zend_hash_index_exists(&pimple_obj->protected, retval->handle_num)) { - /* Service is protected, return the value every time */ - return retval->value; - } - - if (zend_hash_index_exists(&pimple_obj->factories, retval->handle_num)) { - /* Service is a factory, call it every time and never cache its result */ - PIMPLE_CALL_CB - Z_DELREF_P(retval_ptr_ptr); /* fetch dim addr will increment refcount */ - return retval_ptr_ptr; - } - - if (retval->initialized == 1) { - /* Service has already been called, return its cached value */ - return retval->value; - } - - ALLOC_INIT_ZVAL(retval->raw); - MAKE_COPY_ZVAL(&retval->value, retval->raw); - - PIMPLE_CALL_CB - - retval->initialized = 1; - zval_ptr_dtor(&retval->value); - retval->value = retval_ptr_ptr; - - return retval->value; -} - -static int pimple_zval_is_valid_callback(zval *_zval, pimple_bucket_value *_pimple_bucket_value TSRMLS_DC) -{ - if (Z_TYPE_P(_zval) != IS_OBJECT) { - return FAILURE; - } - - if (_pimple_bucket_value->fcc.called_scope) { - return SUCCESS; - } - - if (Z_OBJ_HANDLER_P(_zval, get_closure) && Z_OBJ_HANDLER_P(_zval, get_closure)(_zval, &_pimple_bucket_value->fcc.calling_scope, &_pimple_bucket_value->fcc.function_handler, &_pimple_bucket_value->fcc.object_ptr TSRMLS_CC) == SUCCESS) { - _pimple_bucket_value->fcc.called_scope = _pimple_bucket_value->fcc.calling_scope; - return SUCCESS; - } else { - return FAILURE; - } -} - -static int pimple_zval_to_pimpleval(zval *_zval, pimple_bucket_value *_pimple_bucket_value TSRMLS_DC) -{ - _pimple_bucket_value->value = _zval; - - if (Z_TYPE_P(_zval) != IS_OBJECT) { - return PIMPLE_IS_PARAM; - } - - if (pimple_zval_is_valid_callback(_zval, _pimple_bucket_value TSRMLS_CC) == SUCCESS) { - _pimple_bucket_value->type = PIMPLE_IS_SERVICE; - _pimple_bucket_value->handle_num = Z_OBJ_HANDLE_P(_zval); - } - - return PIMPLE_IS_SERVICE; -} - -static void pimple_bucket_dtor(pimple_bucket_value *bucket) -{ - zval_ptr_dtor(&bucket->value); - pimple_free_bucket(bucket); -} - -PHP_METHOD(Pimple, protect) -{ - zval *protected = NULL; - pimple_object *pobj = NULL; - pimple_bucket_value bucket = {0}; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &protected) == FAILURE) { - return; - } - - if (pimple_zval_is_valid_callback(protected, &bucket TSRMLS_CC) == FAILURE) { - pimple_free_bucket(&bucket); - zend_throw_exception(spl_ce_InvalidArgumentException, "Callable is not a Closure or invokable object.", 0 TSRMLS_CC); - return; - } - - pimple_zval_to_pimpleval(protected, &bucket TSRMLS_CC); - pobj = (pimple_object *)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_hash_index_update(&pobj->protected, bucket.handle_num, (void *)&bucket, sizeof(pimple_bucket_value), NULL) == SUCCESS) { - Z_ADDREF_P(protected); - RETURN_ZVAL(protected, 1 , 0); - } else { - pimple_free_bucket(&bucket); - } - RETURN_FALSE; -} - -PHP_METHOD(Pimple, raw) -{ - zval *offset = NULL; - pimple_object *pobj = NULL; - pimple_bucket_value *value = NULL; - ulong index; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &offset) == FAILURE) { - return; - } - - pobj = zend_object_store_get_object(getThis() TSRMLS_CC); - - switch (Z_TYPE_P(offset)) { - case IS_STRING: - if (zend_symtable_find(&pobj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void *)&value) == FAILURE) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Identifier \"%s\" is not defined.", Z_STRVAL_P(offset)); - RETURN_NULL(); - } - break; - case IS_DOUBLE: - case IS_BOOL: - case IS_LONG: - if (Z_TYPE_P(offset) == IS_DOUBLE) { - index = (ulong)Z_DVAL_P(offset); - } else { - index = Z_LVAL_P(offset); - } - if (zend_hash_index_find(&pobj->values, index, (void *)&value) == FAILURE) { - RETURN_NULL(); - } - break; - case IS_NULL: - default: - zend_error(E_WARNING, "Unsupported offset type"); - } - - if (value->raw) { - RETVAL_ZVAL(value->raw, 1, 0); - } else { - RETVAL_ZVAL(value->value, 1, 0); - } -} - -PHP_METHOD(Pimple, extend) -{ - zval *offset = NULL, *callable = NULL, *pimple_closure_obj = NULL; - pimple_bucket_value bucket = {0}, *value = NULL; - pimple_object *pobj = NULL; - pimple_closure_object *pcobj = NULL; - ulong index; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &offset, &callable) == FAILURE) { - return; - } - - pobj = zend_object_store_get_object(getThis() TSRMLS_CC); - - switch (Z_TYPE_P(offset)) { - case IS_STRING: - if (zend_symtable_find(&pobj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void *)&value) == FAILURE) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Identifier \"%s\" is not defined.", Z_STRVAL_P(offset)); - RETURN_NULL(); - } - if (value->type != PIMPLE_IS_SERVICE) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Identifier \"%s\" does not contain an object definition.", Z_STRVAL_P(offset)); - RETURN_NULL(); - } - break; - case IS_DOUBLE: - case IS_BOOL: - case IS_LONG: - if (Z_TYPE_P(offset) == IS_DOUBLE) { - index = (ulong)Z_DVAL_P(offset); - } else { - index = Z_LVAL_P(offset); - } - if (zend_hash_index_find(&pobj->values, index, (void *)&value) == FAILURE) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Identifier \"%ld\" is not defined.", index); - RETURN_NULL(); - } - if (value->type != PIMPLE_IS_SERVICE) { - zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Identifier \"%ld\" does not contain an object definition.", index); - RETURN_NULL(); - } - break; - case IS_NULL: - default: - zend_error(E_WARNING, "Unsupported offset type"); - } - - if (pimple_zval_is_valid_callback(callable, &bucket TSRMLS_CC) == FAILURE) { - pimple_free_bucket(&bucket); - zend_throw_exception(spl_ce_InvalidArgumentException, "Extension service definition is not a Closure or invokable object.", 0 TSRMLS_CC); - RETURN_NULL(); - } - pimple_free_bucket(&bucket); - - ALLOC_INIT_ZVAL(pimple_closure_obj); - object_init_ex(pimple_closure_obj, pimple_closure_ce); - - pcobj = zend_object_store_get_object(pimple_closure_obj TSRMLS_CC); - pcobj->callable = callable; - pcobj->factory = value->value; - Z_ADDREF_P(callable); - Z_ADDREF_P(value->value); - - if (zend_hash_index_exists(&pobj->factories, value->handle_num)) { - pimple_zval_to_pimpleval(pimple_closure_obj, &bucket TSRMLS_CC); - zend_hash_index_del(&pobj->factories, value->handle_num); - zend_hash_index_update(&pobj->factories, bucket.handle_num, (void *)&bucket, sizeof(pimple_bucket_value), NULL); - Z_ADDREF_P(pimple_closure_obj); - } - - pimple_object_write_dimension(getThis(), offset, pimple_closure_obj TSRMLS_CC); - - RETVAL_ZVAL(pimple_closure_obj, 1, 1); -} - -PHP_METHOD(Pimple, keys) -{ - HashPosition pos; - pimple_object *pobj = NULL; - zval **value = NULL; - zval *endval = NULL; - char *str_index = NULL; - int str_len; - ulong num_index; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - pobj = zend_object_store_get_object(getThis() TSRMLS_CC); - array_init_size(return_value, zend_hash_num_elements(&pobj->values)); - - zend_hash_internal_pointer_reset_ex(&pobj->values, &pos); - - while(zend_hash_get_current_data_ex(&pobj->values, (void **)&value, &pos) == SUCCESS) { - MAKE_STD_ZVAL(endval); - switch (zend_hash_get_current_key_ex(&pobj->values, &str_index, (uint *)&str_len, &num_index, 0, &pos)) { - case HASH_KEY_IS_STRING: - ZVAL_STRINGL(endval, str_index, str_len - 1, 1); - zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &endval, sizeof(zval *), NULL); - break; - case HASH_KEY_IS_LONG: - ZVAL_LONG(endval, num_index); - zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &endval, sizeof(zval *), NULL); - break; - } - zend_hash_move_forward_ex(&pobj->values, &pos); - } -} - -PHP_METHOD(Pimple, factory) -{ - zval *factory = NULL; - pimple_object *pobj = NULL; - pimple_bucket_value bucket = {0}; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &factory) == FAILURE) { - return; - } - - if (pimple_zval_is_valid_callback(factory, &bucket TSRMLS_CC) == FAILURE) { - pimple_free_bucket(&bucket); - zend_throw_exception(spl_ce_InvalidArgumentException, "Service definition is not a Closure or invokable object.", 0 TSRMLS_CC); - return; - } - - pimple_zval_to_pimpleval(factory, &bucket TSRMLS_CC); - pobj = (pimple_object *)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_hash_index_update(&pobj->factories, bucket.handle_num, (void *)&bucket, sizeof(pimple_bucket_value), NULL) == SUCCESS) { - Z_ADDREF_P(factory); - RETURN_ZVAL(factory, 1 , 0); - } else { - pimple_free_bucket(&bucket); - } - - RETURN_FALSE; -} - -PHP_METHOD(Pimple, offsetSet) -{ - zval *offset = NULL, *value = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &offset, &value) == FAILURE) { - return; - } - - pimple_object_write_dimension(getThis(), offset, value TSRMLS_CC); -} - -PHP_METHOD(Pimple, offsetGet) -{ - zval *offset = NULL, *retval = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &offset) == FAILURE) { - return; - } - - retval = pimple_object_read_dimension(getThis(), offset, 0 TSRMLS_CC); - - RETVAL_ZVAL(retval, 1, 0); -} - -PHP_METHOD(Pimple, offsetUnset) -{ - zval *offset = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &offset) == FAILURE) { - return; - } - - pimple_object_unset_dimension(getThis(), offset TSRMLS_CC); -} - -PHP_METHOD(Pimple, offsetExists) -{ - zval *offset = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &offset) == FAILURE) { - return; - } - - RETVAL_BOOL(pimple_object_has_dimension(getThis(), offset, 1 TSRMLS_CC)); -} - -PHP_METHOD(Pimple, register) -{ - zval *provider; - zval **data; - zval *retval = NULL; - zval key; - - HashTable *array = NULL; - HashPosition pos; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|h", &provider, pimple_serviceprovider_ce, &array) == FAILURE) { - return; - } - - RETVAL_ZVAL(getThis(), 1, 0); - - zend_call_method_with_1_params(&provider, Z_OBJCE_P(provider), NULL, "register", &retval, getThis()); - - if (retval) { - zval_ptr_dtor(&retval); - } - - if (!array) { - return; - } - - zend_hash_internal_pointer_reset_ex(array, &pos); - - while(zend_hash_get_current_data_ex(array, (void **)&data, &pos) == SUCCESS) { - zend_hash_get_current_key_zval_ex(array, &key, &pos); - pimple_object_write_dimension(getThis(), &key, *data TSRMLS_CC); - zend_hash_move_forward_ex(array, &pos); - } -} - -PHP_METHOD(Pimple, __construct) -{ - zval *values = NULL, **pData = NULL, offset; - HashPosition pos; - char *str_index = NULL; - zend_uint str_length; - ulong num_index; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!", &values) == FAILURE || !values) { - return; - } - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(values), &pos); - while (zend_hash_has_more_elements_ex(Z_ARRVAL_P(values), &pos) == SUCCESS) { - zend_hash_get_current_data_ex(Z_ARRVAL_P(values), (void **)&pData, &pos); - zend_hash_get_current_key_ex(Z_ARRVAL_P(values), &str_index, &str_length, &num_index, 0, &pos); - INIT_ZVAL(offset); - if (zend_hash_get_current_key_type_ex(Z_ARRVAL_P(values), &pos) == HASH_KEY_IS_LONG) { - ZVAL_LONG(&offset, num_index); - } else { - ZVAL_STRINGL(&offset, str_index, (str_length - 1), 0); - } - pimple_object_write_dimension(getThis(), &offset, *pData TSRMLS_CC); - zend_hash_move_forward_ex(Z_ARRVAL_P(values), &pos); - } -} - -/* - * This is PHP code snippet handling extend()s calls : - - $extended = function ($c) use ($callable, $factory) { - return $callable($factory($c), $c); - }; - - */ -PHP_METHOD(PimpleClosure, invoker) -{ - pimple_closure_object *pcobj = NULL; - zval *arg = NULL, *retval = NULL, *newretval = NULL; - zend_fcall_info fci = {0}; - zval **args[2]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { - return; - } - - pcobj = zend_object_store_get_object(getThis() TSRMLS_CC); - - fci.function_name = pcobj->factory; - args[0] = &arg; - zend_fcall_info_argp(&fci TSRMLS_CC, 1, args); - fci.retval_ptr_ptr = &retval; - fci.size = sizeof(fci); - - if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE || EG(exception)) { - efree(fci.params); - return; /* Should here return default zval */ - } - - efree(fci.params); - memset(&fci, 0, sizeof(fci)); - fci.size = sizeof(fci); - - fci.function_name = pcobj->callable; - args[0] = &retval; - args[1] = &arg; - zend_fcall_info_argp(&fci TSRMLS_CC, 2, args); - fci.retval_ptr_ptr = &newretval; - - if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE || EG(exception)) { - efree(fci.params); - zval_ptr_dtor(&retval); - return; - } - - efree(fci.params); - zval_ptr_dtor(&retval); - - RETVAL_ZVAL(newretval, 1 ,1); -} - -PHP_MINIT_FUNCTION(pimple) -{ - zend_class_entry tmp_pimple_ce, tmp_pimple_closure_ce, tmp_pimple_serviceprovider_iface_ce; - INIT_NS_CLASS_ENTRY(tmp_pimple_ce, PIMPLE_NS, "Container", pimple_ce_functions); - INIT_NS_CLASS_ENTRY(tmp_pimple_closure_ce, PIMPLE_NS, "ContainerClosure", NULL); - INIT_NS_CLASS_ENTRY(tmp_pimple_serviceprovider_iface_ce, PIMPLE_NS, "ServiceProviderInterface", pimple_serviceprovider_iface_ce_functions); - - tmp_pimple_ce.create_object = pimple_object_create; - tmp_pimple_closure_ce.create_object = pimple_closure_object_create; - - pimple_ce = zend_register_internal_class(&tmp_pimple_ce TSRMLS_CC); - zend_class_implements(pimple_ce TSRMLS_CC, 1, zend_ce_arrayaccess); - - pimple_closure_ce = zend_register_internal_class(&tmp_pimple_closure_ce TSRMLS_CC); - pimple_closure_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; - - pimple_serviceprovider_ce = zend_register_internal_interface(&tmp_pimple_serviceprovider_iface_ce TSRMLS_CC); - - memcpy(&pimple_closure_object_handlers, zend_get_std_object_handlers(), sizeof(*zend_get_std_object_handlers())); - pimple_object_handlers = std_object_handlers; - pimple_closure_object_handlers.get_closure = pimple_closure_get_closure; - - pimple_closure_invoker_function.function_name = "Pimple closure internal invoker"; - pimple_closure_invoker_function.fn_flags |= ZEND_ACC_CLOSURE; - pimple_closure_invoker_function.handler = ZEND_MN(PimpleClosure_invoker); - pimple_closure_invoker_function.num_args = 1; - pimple_closure_invoker_function.required_num_args = 1; - pimple_closure_invoker_function.scope = pimple_closure_ce; - pimple_closure_invoker_function.type = ZEND_INTERNAL_FUNCTION; - pimple_closure_invoker_function.module = &pimple_module_entry; - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(pimple) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "SensioLabs Pimple C support", "enabled"); - php_info_print_table_row(2, "Pimple supported version", PIMPLE_VERSION); - php_info_print_table_end(); - - php_info_print_box_start(0); - php_write((void *)ZEND_STRL("SensioLabs Pimple C support developed by Julien Pauli") TSRMLS_CC); - if (!sapi_module.phpinfo_as_text) { - php_write((void *)ZEND_STRL(sensiolabs_logo) TSRMLS_CC); - } - php_info_print_box_end(); -} - -zend_module_entry pimple_module_entry = { - STANDARD_MODULE_HEADER, - "pimple", - NULL, - PHP_MINIT(pimple), - NULL, - NULL, - NULL, - PHP_MINFO(pimple), - PIMPLE_VERSION, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_PIMPLE -ZEND_GET_MODULE(pimple) -#endif diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/pimple_compat.h b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/pimple_compat.h deleted file mode 100644 index d234e174d0a..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/pimple_compat.h +++ /dev/null @@ -1,81 +0,0 @@ - -/* - * This file is part of Pimple. - * - * Copyright (c) 2014 Fabien Potencier - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished - * to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef PIMPLE_COMPAT_H_ -#define PIMPLE_COMPAT_H_ - -#include "Zend/zend_extensions.h" /* for ZEND_EXTENSION_API_NO */ - -#define PHP_5_0_X_API_NO 220040412 -#define PHP_5_1_X_API_NO 220051025 -#define PHP_5_2_X_API_NO 220060519 -#define PHP_5_3_X_API_NO 220090626 -#define PHP_5_4_X_API_NO 220100525 -#define PHP_5_5_X_API_NO 220121212 -#define PHP_5_6_X_API_NO 220131226 - -#define IS_PHP_56 ZEND_EXTENSION_API_NO == PHP_5_6_X_API_NO -#define IS_AT_LEAST_PHP_56 ZEND_EXTENSION_API_NO >= PHP_5_6_X_API_NO - -#define IS_PHP_55 ZEND_EXTENSION_API_NO == PHP_5_5_X_API_NO -#define IS_AT_LEAST_PHP_55 ZEND_EXTENSION_API_NO >= PHP_5_5_X_API_NO - -#define IS_PHP_54 ZEND_EXTENSION_API_NO == PHP_5_4_X_API_NO -#define IS_AT_LEAST_PHP_54 ZEND_EXTENSION_API_NO >= PHP_5_4_X_API_NO - -#define IS_PHP_53 ZEND_EXTENSION_API_NO == PHP_5_3_X_API_NO -#define IS_AT_LEAST_PHP_53 ZEND_EXTENSION_API_NO >= PHP_5_3_X_API_NO - -#if IS_PHP_53 -#define object_properties_init(obj, ce) do { \ - zend_hash_copy(obj->properties, &ce->default_properties, zval_copy_property_ctor(ce), NULL, sizeof(zval *)); \ - } while (0); -#endif - -#define ZEND_OBJ_INIT(obj, ce) do { \ - zend_object_std_init(obj, ce TSRMLS_CC); \ - object_properties_init((obj), (ce)); \ - } while(0); - -#if IS_PHP_53 || IS_PHP_54 -static void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos) { - Bucket *p; - - p = pos ? (*pos) : ht->pInternalPointer; - - if (!p) { - Z_TYPE_P(key) = IS_NULL; - } else if (p->nKeyLength) { - Z_TYPE_P(key) = IS_STRING; - Z_STRVAL_P(key) = estrndup(p->arKey, p->nKeyLength - 1); - Z_STRLEN_P(key) = p->nKeyLength - 1; - } else { - Z_TYPE_P(key) = IS_LONG; - Z_LVAL_P(key) = p->h; - } -} -#endif - -#endif /* PIMPLE_COMPAT_H_ */ diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/001.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/001.phpt deleted file mode 100644 index 0809ea232b6..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/001.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test for read_dim/write_dim handlers ---SKIPIF-- - ---FILE-- - - ---EXPECTF-- -foo -42 -foo2 -foo99 -baz -strstr \ No newline at end of file diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/002.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/002.phpt deleted file mode 100644 index 7b56d2c1fe8..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/002.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Test for constructor ---SKIPIF-- - ---FILE-- -'foo')); -var_dump($p[42]); -?> ---EXPECT-- -NULL -string(3) "foo" diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/003.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/003.phpt deleted file mode 100644 index a22cfa352ea..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/003.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Test empty dimensions ---SKIPIF-- - ---FILE-- - ---EXPECT-- -int(42) -string(3) "bar" \ No newline at end of file diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/004.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/004.phpt deleted file mode 100644 index 1e1d2513679..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/004.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Test has/unset dim handlers ---SKIPIF-- - ---FILE-- - ---EXPECT-- -int(42) -NULL -bool(true) -bool(false) -bool(true) -bool(true) \ No newline at end of file diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/005.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/005.phpt deleted file mode 100644 index 0479ee055de..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/005.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test simple class inheritance ---SKIPIF-- - ---FILE-- -someAttr; -?> ---EXPECT-- -string(3) "hit" -foo -fooAttr \ No newline at end of file diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/006.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/006.phpt deleted file mode 100644 index cfe8a119e63..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/006.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -Test complex class inheritance ---SKIPIF-- - ---FILE-- - 'bar', 88 => 'baz'); - -$p = new TestPimple($defaultValues); -$p[42] = 'foo'; -var_dump($p[42]); -var_dump($p[0]); -?> ---EXPECT-- -string(13) "hit offsetset" -string(27) "hit offsetget in TestPimple" -string(25) "hit offsetget in MyPimple" -string(3) "foo" -string(27) "hit offsetget in TestPimple" -string(25) "hit offsetget in MyPimple" -string(3) "baz" \ No newline at end of file diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/007.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/007.phpt deleted file mode 100644 index 5aac6838064..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/007.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Test for read_dim/write_dim handlers ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -foo -42 \ No newline at end of file diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/008.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/008.phpt deleted file mode 100644 index db7eeec4a11..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/008.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Test frozen services ---SKIPIF-- - ---FILE-- - ---EXPECTF-- diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/009.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/009.phpt deleted file mode 100644 index bb05ea29648..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/009.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Test service is called as callback, and only once ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(true) \ No newline at end of file diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/010.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/010.phpt deleted file mode 100644 index badce0146a9..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/010.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Test service is called as callback for every callback type ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -callme -called -Foo::bar -array(2) { - [0]=> - string(3) "Foo" - [1]=> - string(3) "bar" -} \ No newline at end of file diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/011.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/011.phpt deleted file mode 100644 index 6682ab8ebdb..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/011.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Test service callback throwing an exception ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -all right! \ No newline at end of file diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/012.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/012.phpt deleted file mode 100644 index 4c6ac486dc7..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/012.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Test service factory ---SKIPIF-- - ---FILE-- -factory($f = function() { var_dump('called-1'); return 'ret-1';}); - -$p[] = $f; - -$p[] = function () { var_dump('called-2'); return 'ret-2'; }; - -var_dump($p[0]); -var_dump($p[0]); -var_dump($p[1]); -var_dump($p[1]); -?> ---EXPECTF-- -string(8) "called-1" -string(5) "ret-1" -string(8) "called-1" -string(5) "ret-1" -string(8) "called-2" -string(5) "ret-2" -string(5) "ret-2" \ No newline at end of file diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/013.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/013.phpt deleted file mode 100644 index f419958c5fa..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/013.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Test keys() ---SKIPIF-- - ---FILE-- -keys()); - -$p['foo'] = 'bar'; -$p[] = 'foo'; - -var_dump($p->keys()); - -unset($p['foo']); - -var_dump($p->keys()); -?> ---EXPECTF-- -array(0) { -} -array(2) { - [0]=> - string(3) "foo" - [1]=> - int(0) -} -array(1) { - [0]=> - int(0) -} \ No newline at end of file diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/014.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/014.phpt deleted file mode 100644 index ac937213ac0..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/014.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Test raw() ---SKIPIF-- - ---FILE-- -raw('foo')); -var_dump($p[42]); - -unset($p['foo']); - -try { - $p->raw('foo'); - echo "expected exception"; -} catch (InvalidArgumentException $e) { } ---EXPECTF-- -string(8) "called-2" -string(5) "ret-2" -object(Closure)#%i (0) { -} -string(8) "called-2" -string(5) "ret-2" \ No newline at end of file diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/015.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/015.phpt deleted file mode 100644 index 314f008ac1b..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/015.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Test protect() ---SKIPIF-- - ---FILE-- -protect($f); - -var_dump($p['foo']); ---EXPECTF-- -object(Closure)#%i (0) { -} \ No newline at end of file diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/016.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/016.phpt deleted file mode 100644 index e55edb0a7a1..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/016.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Test extend() ---SKIPIF-- - ---FILE-- -extend(12, function ($w) { var_dump($w); return 'bar'; }); /* $callable in code above */ - -var_dump($c('param')); ---EXPECTF-- -string(5) "param" -string(3) "foo" -string(3) "bar" \ No newline at end of file diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/017.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/017.phpt deleted file mode 100644 index bac23ce09a9..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/017.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Test extend() with exception in service extension ---SKIPIF-- - ---FILE-- -extend(12, function ($w) { throw new BadMethodCallException; }); - -try { - $p[12]; - echo "Exception expected"; -} catch (BadMethodCallException $e) { } ---EXPECTF-- diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/017_1.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/017_1.phpt deleted file mode 100644 index 8f881d6ebf8..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/017_1.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Test extend() with exception in service factory ---SKIPIF-- - ---FILE-- -extend(12, function ($w) { return 'foobar'; }); - -try { - $p[12]; - echo "Exception expected"; -} catch (BadMethodCallException $e) { } ---EXPECTF-- diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/018.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/018.phpt deleted file mode 100644 index 27c12a14e79..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/018.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Test register() ---SKIPIF-- - ---FILE-- -register(new Foo, array(42 => 'bar')); - -var_dump($p[42]); ---EXPECTF-- -object(Pimple\Container)#1 (0) { -} -string(3) "bar" \ No newline at end of file diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/019.phpt b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/019.phpt deleted file mode 100644 index 28a9aecac7f..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/019.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Test register() returns static and is a fluent interface ---SKIPIF-- - ---FILE-- -register(new Foo)); ---EXPECTF-- -bool(true) diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/bench.phpb b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/bench.phpb deleted file mode 100644 index 8f983e656b5..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/bench.phpb +++ /dev/null @@ -1,51 +0,0 @@ -factory($factory); - -$p['factory'] = $factory; - -echo $p['factory']; -echo $p['factory']; -echo $p['factory']; - -} - -echo microtime(true) - $time; diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/bench_shared.phpb b/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/bench_shared.phpb deleted file mode 100644 index aec541f0bc8..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/ext/pimple/tests/bench_shared.phpb +++ /dev/null @@ -1,25 +0,0 @@ - diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/phpunit.xml.dist b/samples/server/petstore/php-slim/vendor/pimple/pimple/phpunit.xml.dist deleted file mode 100644 index 5c8d487fea9..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/phpunit.xml.dist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - ./src/Pimple/Tests - - - diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Container.php b/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Container.php deleted file mode 100644 index c976431e99a..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Container.php +++ /dev/null @@ -1,282 +0,0 @@ -factories = new \SplObjectStorage(); - $this->protected = new \SplObjectStorage(); - - foreach ($values as $key => $value) { - $this->offsetSet($key, $value); - } - } - - /** - * Sets a parameter or an object. - * - * Objects must be defined as Closures. - * - * Allowing any PHP callable leads to difficult to debug problems - * as function names (strings) are callable (creating a function with - * the same name as an existing parameter would break your container). - * - * @param string $id The unique identifier for the parameter or object - * @param mixed $value The value of the parameter or a closure to define an object - * - * @throws \RuntimeException Prevent override of a frozen service - */ - public function offsetSet($id, $value) - { - if (isset($this->frozen[$id])) { - throw new \RuntimeException(sprintf('Cannot override frozen service "%s".', $id)); - } - - $this->values[$id] = $value; - $this->keys[$id] = true; - } - - /** - * Gets a parameter or an object. - * - * @param string $id The unique identifier for the parameter or object - * - * @return mixed The value of the parameter or an object - * - * @throws \InvalidArgumentException if the identifier is not defined - */ - public function offsetGet($id) - { - if (!isset($this->keys[$id])) { - throw new \InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $id)); - } - - if ( - isset($this->raw[$id]) - || !is_object($this->values[$id]) - || isset($this->protected[$this->values[$id]]) - || !method_exists($this->values[$id], '__invoke') - ) { - return $this->values[$id]; - } - - if (isset($this->factories[$this->values[$id]])) { - return $this->values[$id]($this); - } - - $raw = $this->values[$id]; - $val = $this->values[$id] = $raw($this); - $this->raw[$id] = $raw; - - $this->frozen[$id] = true; - - return $val; - } - - /** - * Checks if a parameter or an object is set. - * - * @param string $id The unique identifier for the parameter or object - * - * @return bool - */ - public function offsetExists($id) - { - return isset($this->keys[$id]); - } - - /** - * Unsets a parameter or an object. - * - * @param string $id The unique identifier for the parameter or object - */ - public function offsetUnset($id) - { - if (isset($this->keys[$id])) { - if (is_object($this->values[$id])) { - unset($this->factories[$this->values[$id]], $this->protected[$this->values[$id]]); - } - - unset($this->values[$id], $this->frozen[$id], $this->raw[$id], $this->keys[$id]); - } - } - - /** - * Marks a callable as being a factory service. - * - * @param callable $callable A service definition to be used as a factory - * - * @return callable The passed callable - * - * @throws \InvalidArgumentException Service definition has to be a closure of an invokable object - */ - public function factory($callable) - { - if (!method_exists($callable, '__invoke')) { - throw new \InvalidArgumentException('Service definition is not a Closure or invokable object.'); - } - - $this->factories->attach($callable); - - return $callable; - } - - /** - * Protects a callable from being interpreted as a service. - * - * This is useful when you want to store a callable as a parameter. - * - * @param callable $callable A callable to protect from being evaluated - * - * @return callable The passed callable - * - * @throws \InvalidArgumentException Service definition has to be a closure of an invokable object - */ - public function protect($callable) - { - if (!method_exists($callable, '__invoke')) { - throw new \InvalidArgumentException('Callable is not a Closure or invokable object.'); - } - - $this->protected->attach($callable); - - return $callable; - } - - /** - * Gets a parameter or the closure defining an object. - * - * @param string $id The unique identifier for the parameter or object - * - * @return mixed The value of the parameter or the closure defining an object - * - * @throws \InvalidArgumentException if the identifier is not defined - */ - public function raw($id) - { - if (!isset($this->keys[$id])) { - throw new \InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $id)); - } - - if (isset($this->raw[$id])) { - return $this->raw[$id]; - } - - return $this->values[$id]; - } - - /** - * Extends an object definition. - * - * Useful when you want to extend an existing object definition, - * without necessarily loading that object. - * - * @param string $id The unique identifier for the object - * @param callable $callable A service definition to extend the original - * - * @return callable The wrapped callable - * - * @throws \InvalidArgumentException if the identifier is not defined or not a service definition - */ - public function extend($id, $callable) - { - if (!isset($this->keys[$id])) { - throw new \InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $id)); - } - - if (!is_object($this->values[$id]) || !method_exists($this->values[$id], '__invoke')) { - throw new \InvalidArgumentException(sprintf('Identifier "%s" does not contain an object definition.', $id)); - } - - if (!is_object($callable) || !method_exists($callable, '__invoke')) { - throw new \InvalidArgumentException('Extension service definition is not a Closure or invokable object.'); - } - - $factory = $this->values[$id]; - - $extended = function ($c) use ($callable, $factory) { - return $callable($factory($c), $c); - }; - - if (isset($this->factories[$factory])) { - $this->factories->detach($factory); - $this->factories->attach($extended); - } - - return $this[$id] = $extended; - } - - /** - * Returns all defined value names. - * - * @return array An array of value names - */ - public function keys() - { - return array_keys($this->values); - } - - /** - * Registers a service provider. - * - * @param ServiceProviderInterface $provider A ServiceProviderInterface instance - * @param array $values An array of values that customizes the provider - * - * @return static - */ - public function register(ServiceProviderInterface $provider, array $values = array()) - { - $provider->register($this); - - foreach ($values as $key => $value) { - $this[$key] = $value; - } - - return $this; - } -} diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/ServiceProviderInterface.php b/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/ServiceProviderInterface.php deleted file mode 100644 index c004594baf0..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/ServiceProviderInterface.php +++ /dev/null @@ -1,46 +0,0 @@ -value = $value; - - return $service; - } -} diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php b/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php deleted file mode 100644 index 33cd4e54864..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php +++ /dev/null @@ -1,34 +0,0 @@ -factory(function () { - return new Service(); - }); - } -} diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php b/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php deleted file mode 100644 index d71b184ddf7..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ -class Service -{ - public $value; -} diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php b/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php deleted file mode 100644 index 8e5c4c73deb..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php +++ /dev/null @@ -1,76 +0,0 @@ - - */ -class PimpleServiceProviderInterfaceTest extends \PHPUnit_Framework_TestCase -{ - public function testProvider() - { - $pimple = new Container(); - - $pimpleServiceProvider = new Fixtures\PimpleServiceProvider(); - $pimpleServiceProvider->register($pimple); - - $this->assertEquals('value', $pimple['param']); - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['service']); - - $serviceOne = $pimple['factory']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - - $serviceTwo = $pimple['factory']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - - $this->assertNotSame($serviceOne, $serviceTwo); - } - - public function testProviderWithRegisterMethod() - { - $pimple = new Container(); - - $pimple->register(new Fixtures\PimpleServiceProvider(), array( - 'anotherParameter' => 'anotherValue', - )); - - $this->assertEquals('value', $pimple['param']); - $this->assertEquals('anotherValue', $pimple['anotherParameter']); - - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['service']); - - $serviceOne = $pimple['factory']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - - $serviceTwo = $pimple['factory']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - - $this->assertNotSame($serviceOne, $serviceTwo); - } -} diff --git a/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php b/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php deleted file mode 100644 index 918f620d884..00000000000 --- a/samples/server/petstore/php-slim/vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php +++ /dev/null @@ -1,440 +0,0 @@ - - */ -class PimpleTest extends \PHPUnit_Framework_TestCase -{ - public function testWithString() - { - $pimple = new Container(); - $pimple['param'] = 'value'; - - $this->assertEquals('value', $pimple['param']); - } - - public function testWithClosure() - { - $pimple = new Container(); - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['service']); - } - - public function testServicesShouldBeDifferent() - { - $pimple = new Container(); - $pimple['service'] = $pimple->factory(function () { - return new Fixtures\Service(); - }); - - $serviceOne = $pimple['service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - - $serviceTwo = $pimple['service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - - $this->assertNotSame($serviceOne, $serviceTwo); - } - - public function testShouldPassContainerAsParameter() - { - $pimple = new Container(); - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - $pimple['container'] = function ($container) { - return $container; - }; - - $this->assertNotSame($pimple, $pimple['service']); - $this->assertSame($pimple, $pimple['container']); - } - - public function testIsset() - { - $pimple = new Container(); - $pimple['param'] = 'value'; - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - - $pimple['null'] = null; - - $this->assertTrue(isset($pimple['param'])); - $this->assertTrue(isset($pimple['service'])); - $this->assertTrue(isset($pimple['null'])); - $this->assertFalse(isset($pimple['non_existent'])); - } - - public function testConstructorInjection() - { - $params = array('param' => 'value'); - $pimple = new Container($params); - - $this->assertSame($params['param'], $pimple['param']); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Identifier "foo" is not defined. - */ - public function testOffsetGetValidatesKeyIsPresent() - { - $pimple = new Container(); - echo $pimple['foo']; - } - - public function testOffsetGetHonorsNullValues() - { - $pimple = new Container(); - $pimple['foo'] = null; - $this->assertNull($pimple['foo']); - } - - public function testUnset() - { - $pimple = new Container(); - $pimple['param'] = 'value'; - $pimple['service'] = function () { - return new Fixtures\Service(); - }; - - unset($pimple['param'], $pimple['service']); - $this->assertFalse(isset($pimple['param'])); - $this->assertFalse(isset($pimple['service'])); - } - - /** - * @dataProvider serviceDefinitionProvider - */ - public function testShare($service) - { - $pimple = new Container(); - $pimple['shared_service'] = $service; - - $serviceOne = $pimple['shared_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - - $serviceTwo = $pimple['shared_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - - $this->assertSame($serviceOne, $serviceTwo); - } - - /** - * @dataProvider serviceDefinitionProvider - */ - public function testProtect($service) - { - $pimple = new Container(); - $pimple['protected'] = $pimple->protect($service); - - $this->assertSame($service, $pimple['protected']); - } - - public function testGlobalFunctionNameAsParameterValue() - { - $pimple = new Container(); - $pimple['global_function'] = 'strlen'; - $this->assertSame('strlen', $pimple['global_function']); - } - - public function testRaw() - { - $pimple = new Container(); - $pimple['service'] = $definition = $pimple->factory(function () { return 'foo'; }); - $this->assertSame($definition, $pimple->raw('service')); - } - - public function testRawHonorsNullValues() - { - $pimple = new Container(); - $pimple['foo'] = null; - $this->assertNull($pimple->raw('foo')); - } - - public function testFluentRegister() - { - $pimple = new Container(); - $this->assertSame($pimple, $pimple->register($this->getMock('Pimple\ServiceProviderInterface'))); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Identifier "foo" is not defined. - */ - public function testRawValidatesKeyIsPresent() - { - $pimple = new Container(); - $pimple->raw('foo'); - } - - /** - * @dataProvider serviceDefinitionProvider - */ - public function testExtend($service) - { - $pimple = new Container(); - $pimple['shared_service'] = function () { - return new Fixtures\Service(); - }; - $pimple['factory_service'] = $pimple->factory(function () { - return new Fixtures\Service(); - }); - - $pimple->extend('shared_service', $service); - $serviceOne = $pimple['shared_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - $serviceTwo = $pimple['shared_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - $this->assertSame($serviceOne, $serviceTwo); - $this->assertSame($serviceOne->value, $serviceTwo->value); - - $pimple->extend('factory_service', $service); - $serviceOne = $pimple['factory_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne); - $serviceTwo = $pimple['factory_service']; - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo); - $this->assertNotSame($serviceOne, $serviceTwo); - $this->assertNotSame($serviceOne->value, $serviceTwo->value); - } - - public function testExtendDoesNotLeakWithFactories() - { - if (extension_loaded('pimple')) { - $this->markTestSkipped('Pimple extension does not support this test'); - } - $pimple = new Container(); - - $pimple['foo'] = $pimple->factory(function () { return; }); - $pimple['foo'] = $pimple->extend('foo', function ($foo, $pimple) { return; }); - unset($pimple['foo']); - - $p = new \ReflectionProperty($pimple, 'values'); - $p->setAccessible(true); - $this->assertEmpty($p->getValue($pimple)); - - $p = new \ReflectionProperty($pimple, 'factories'); - $p->setAccessible(true); - $this->assertCount(0, $p->getValue($pimple)); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Identifier "foo" is not defined. - */ - public function testExtendValidatesKeyIsPresent() - { - $pimple = new Container(); - $pimple->extend('foo', function () {}); - } - - public function testKeys() - { - $pimple = new Container(); - $pimple['foo'] = 123; - $pimple['bar'] = 123; - - $this->assertEquals(array('foo', 'bar'), $pimple->keys()); - } - - /** @test */ - public function settingAnInvokableObjectShouldTreatItAsFactory() - { - $pimple = new Container(); - $pimple['invokable'] = new Fixtures\Invokable(); - - $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['invokable']); - } - - /** @test */ - public function settingNonInvokableObjectShouldTreatItAsParameter() - { - $pimple = new Container(); - $pimple['non_invokable'] = new Fixtures\NonInvokable(); - - $this->assertInstanceOf('Pimple\Tests\Fixtures\NonInvokable', $pimple['non_invokable']); - } - - /** - * @dataProvider badServiceDefinitionProvider - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Service definition is not a Closure or invokable object. - */ - public function testFactoryFailsForInvalidServiceDefinitions($service) - { - $pimple = new Container(); - $pimple->factory($service); - } - - /** - * @dataProvider badServiceDefinitionProvider - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Callable is not a Closure or invokable object. - */ - public function testProtectFailsForInvalidServiceDefinitions($service) - { - $pimple = new Container(); - $pimple->protect($service); - } - - /** - * @dataProvider badServiceDefinitionProvider - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Identifier "foo" does not contain an object definition. - */ - public function testExtendFailsForKeysNotContainingServiceDefinitions($service) - { - $pimple = new Container(); - $pimple['foo'] = $service; - $pimple->extend('foo', function () {}); - } - - /** - * @dataProvider badServiceDefinitionProvider - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Extension service definition is not a Closure or invokable object. - */ - public function testExtendFailsForInvalidServiceDefinitions($service) - { - $pimple = new Container(); - $pimple['foo'] = function () {}; - $pimple->extend('foo', $service); - } - - /** - * Provider for invalid service definitions. - */ - public function badServiceDefinitionProvider() - { - return array( - array(123), - array(new Fixtures\NonInvokable()), - ); - } - - /** - * Provider for service definitions. - */ - public function serviceDefinitionProvider() - { - return array( - array(function ($value) { - $service = new Fixtures\Service(); - $service->value = $value; - - return $service; - }), - array(new Fixtures\Invokable()), - ); - } - - public function testDefiningNewServiceAfterFreeze() - { - $pimple = new Container(); - $pimple['foo'] = function () { - return 'foo'; - }; - $foo = $pimple['foo']; - - $pimple['bar'] = function () { - return 'bar'; - }; - $this->assertSame('bar', $pimple['bar']); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Cannot override frozen service "foo". - */ - public function testOverridingServiceAfterFreeze() - { - $pimple = new Container(); - $pimple['foo'] = function () { - return 'foo'; - }; - $foo = $pimple['foo']; - - $pimple['foo'] = function () { - return 'bar'; - }; - } - - public function testRemovingServiceAfterFreeze() - { - $pimple = new Container(); - $pimple['foo'] = function () { - return 'foo'; - }; - $foo = $pimple['foo']; - - unset($pimple['foo']); - $pimple['foo'] = function () { - return 'bar'; - }; - $this->assertSame('bar', $pimple['foo']); - } - - public function testExtendingService() - { - $pimple = new Container(); - $pimple['foo'] = function () { - return 'foo'; - }; - $pimple['foo'] = $pimple->extend('foo', function ($foo, $app) { - return "$foo.bar"; - }); - $pimple['foo'] = $pimple->extend('foo', function ($foo, $app) { - return "$foo.baz"; - }); - $this->assertSame('foo.bar.baz', $pimple['foo']); - } - - public function testExtendingServiceAfterOtherServiceFreeze() - { - $pimple = new Container(); - $pimple['foo'] = function () { - return 'foo'; - }; - $pimple['bar'] = function () { - return 'bar'; - }; - $foo = $pimple['foo']; - - $pimple['bar'] = $pimple->extend('bar', function ($bar, $app) { - return "$bar.baz"; - }); - $this->assertSame('bar.baz', $pimple['bar']); - } -} diff --git a/samples/server/petstore/php-slim/vendor/psr/http-message/README.md b/samples/server/petstore/php-slim/vendor/psr/http-message/README.md deleted file mode 100644 index 28185338f72..00000000000 --- a/samples/server/petstore/php-slim/vendor/psr/http-message/README.md +++ /dev/null @@ -1,13 +0,0 @@ -PSR Http Message -================ - -This repository holds all interfaces/classes/traits related to -[PSR-7](http://www.php-fig.org/psr/psr-7/). - -Note that this is not a HTTP message implementation of its own. It is merely an -interface that describes a HTTP message. See the specification for more details. - -Usage ------ - -We'll certainly need some stuff in here. \ No newline at end of file diff --git a/samples/server/petstore/php-slim/vendor/psr/http-message/composer.json b/samples/server/petstore/php-slim/vendor/psr/http-message/composer.json deleted file mode 100644 index 4774b612627..00000000000 --- a/samples/server/petstore/php-slim/vendor/psr/http-message/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "psr/http-message", - "description": "Common interface for HTTP messages", - "keywords": ["psr", "psr-7", "http", "http-message", "request", "response"], - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "require": { - "php": ">=5.3.0" - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/samples/server/petstore/php-slim/vendor/psr/http-message/src/MessageInterface.php b/samples/server/petstore/php-slim/vendor/psr/http-message/src/MessageInterface.php deleted file mode 100644 index 8f67a050e8c..00000000000 --- a/samples/server/petstore/php-slim/vendor/psr/http-message/src/MessageInterface.php +++ /dev/null @@ -1,187 +0,0 @@ -getHeaders() as $name => $values) { - * echo $name . ": " . implode(", ", $values); - * } - * - * // Emit headers iteratively: - * foreach ($message->getHeaders() as $name => $values) { - * foreach ($values as $value) { - * header(sprintf('%s: %s', $name, $value), false); - * } - * } - * - * While header names are not case-sensitive, getHeaders() will preserve the - * exact case in which headers were originally specified. - * - * @return array Returns an associative array of the message's headers. Each - * key MUST be a header name, and each value MUST be an array of strings - * for that header. - */ - public function getHeaders(); - - /** - * Checks if a header exists by the given case-insensitive name. - * - * @param string $name Case-insensitive header field name. - * @return bool Returns true if any header names match the given header - * name using a case-insensitive string comparison. Returns false if - * no matching header name is found in the message. - */ - public function hasHeader($name); - - /** - * Retrieves a message header value by the given case-insensitive name. - * - * This method returns an array of all the header values of the given - * case-insensitive header name. - * - * If the header does not appear in the message, this method MUST return an - * empty array. - * - * @param string $name Case-insensitive header field name. - * @return string[] An array of string values as provided for the given - * header. If the header does not appear in the message, this method MUST - * return an empty array. - */ - public function getHeader($name); - - /** - * Retrieves a comma-separated string of the values for a single header. - * - * This method returns all of the header values of the given - * case-insensitive header name as a string concatenated together using - * a comma. - * - * NOTE: Not all header values may be appropriately represented using - * comma concatenation. For such headers, use getHeader() instead - * and supply your own delimiter when concatenating. - * - * If the header does not appear in the message, this method MUST return - * an empty string. - * - * @param string $name Case-insensitive header field name. - * @return string A string of values as provided for the given header - * concatenated together using a comma. If the header does not appear in - * the message, this method MUST return an empty string. - */ - public function getHeaderLine($name); - - /** - * Return an instance with the provided value replacing the specified header. - * - * While header names are case-insensitive, the casing of the header will - * be preserved by this function, and returned from getHeaders(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new and/or updated header and value. - * - * @param string $name Case-insensitive header field name. - * @param string|string[] $value Header value(s). - * @return self - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withHeader($name, $value); - - /** - * Return an instance with the specified header appended with the given value. - * - * Existing values for the specified header will be maintained. The new - * value(s) will be appended to the existing list. If the header did not - * exist previously, it will be added. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new header and/or value. - * - * @param string $name Case-insensitive header field name to add. - * @param string|string[] $value Header value(s). - * @return self - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withAddedHeader($name, $value); - - /** - * Return an instance without the specified header. - * - * Header resolution MUST be done without case-sensitivity. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the named header. - * - * @param string $name Case-insensitive header field name to remove. - * @return self - */ - public function withoutHeader($name); - - /** - * Gets the body of the message. - * - * @return StreamInterface Returns the body as a stream. - */ - public function getBody(); - - /** - * Return an instance with the specified message body. - * - * The body MUST be a StreamInterface object. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return a new instance that has the - * new body stream. - * - * @param StreamInterface $body Body. - * @return self - * @throws \InvalidArgumentException When the body is not valid. - */ - public function withBody(StreamInterface $body); -} diff --git a/samples/server/petstore/php-slim/vendor/psr/http-message/src/RequestInterface.php b/samples/server/petstore/php-slim/vendor/psr/http-message/src/RequestInterface.php deleted file mode 100644 index 75c802e2927..00000000000 --- a/samples/server/petstore/php-slim/vendor/psr/http-message/src/RequestInterface.php +++ /dev/null @@ -1,129 +0,0 @@ -getQuery()` - * or from the `QUERY_STRING` server param. - * - * @return array - */ - public function getQueryParams(); - - /** - * Return an instance with the specified query string arguments. - * - * These values SHOULD remain immutable over the course of the incoming - * request. They MAY be injected during instantiation, such as from PHP's - * $_GET superglobal, or MAY be derived from some other value such as the - * URI. In cases where the arguments are parsed from the URI, the data - * MUST be compatible with what PHP's parse_str() would return for - * purposes of how duplicate query parameters are handled, and how nested - * sets are handled. - * - * Setting query string arguments MUST NOT change the URI stored by the - * request, nor the values in the server params. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated query string arguments. - * - * @param array $query Array of query string arguments, typically from - * $_GET. - * @return self - */ - public function withQueryParams(array $query); - - /** - * Retrieve normalized file upload data. - * - * This method returns upload metadata in a normalized tree, with each leaf - * an instance of Psr\Http\Message\UploadedFileInterface. - * - * These values MAY be prepared from $_FILES or the message body during - * instantiation, or MAY be injected via withUploadedFiles(). - * - * @return array An array tree of UploadedFileInterface instances; an empty - * array MUST be returned if no data is present. - */ - public function getUploadedFiles(); - - /** - * Create a new instance with the specified uploaded files. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param array An array tree of UploadedFileInterface instances. - * @return self - * @throws \InvalidArgumentException if an invalid structure is provided. - */ - public function withUploadedFiles(array $uploadedFiles); - - /** - * Retrieve any parameters provided in the request body. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, this method MUST - * return the contents of $_POST. - * - * Otherwise, this method may return any results of deserializing - * the request body content; as parsing returns structured content, the - * potential types MUST be arrays or objects only. A null value indicates - * the absence of body content. - * - * @return null|array|object The deserialized body parameters, if any. - * These will typically be an array or object. - */ - public function getParsedBody(); - - /** - * Return an instance with the specified body parameters. - * - * These MAY be injected during instantiation. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, use this method - * ONLY to inject the contents of $_POST. - * - * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of - * deserializing the request body content. Deserialization/parsing returns - * structured data, and, as such, this method ONLY accepts arrays or objects, - * or a null value if nothing was available to parse. - * - * As an example, if content negotiation determines that the request data - * is a JSON payload, this method could be used to create a request - * instance with the deserialized parameters. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param null|array|object $data The deserialized body data. This will - * typically be in an array or object. - * @return self - * @throws \InvalidArgumentException if an unsupported argument type is - * provided. - */ - public function withParsedBody($data); - - /** - * Retrieve attributes derived from the request. - * - * The request "attributes" may be used to allow injection of any - * parameters derived from the request: e.g., the results of path - * match operations; the results of decrypting cookies; the results of - * deserializing non-form-encoded message bodies; etc. Attributes - * will be application and request specific, and CAN be mutable. - * - * @return array Attributes derived from the request. - */ - public function getAttributes(); - - /** - * Retrieve a single derived request attribute. - * - * Retrieves a single derived request attribute as described in - * getAttributes(). If the attribute has not been previously set, returns - * the default value as provided. - * - * This method obviates the need for a hasAttribute() method, as it allows - * specifying a default value to return if the attribute is not found. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $default Default value to return if the attribute does not exist. - * @return mixed - */ - public function getAttribute($name, $default = null); - - /** - * Return an instance with the specified derived request attribute. - * - * This method allows setting a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $value The value of the attribute. - * @return self - */ - public function withAttribute($name, $value); - - /** - * Return an instance that removes the specified derived request attribute. - * - * This method allows removing a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @return self - */ - public function withoutAttribute($name); -} diff --git a/samples/server/petstore/php-slim/vendor/psr/http-message/src/StreamInterface.php b/samples/server/petstore/php-slim/vendor/psr/http-message/src/StreamInterface.php deleted file mode 100644 index f68f391269b..00000000000 --- a/samples/server/petstore/php-slim/vendor/psr/http-message/src/StreamInterface.php +++ /dev/null @@ -1,158 +0,0 @@ - - * [user-info@]host[:port] - * - * - * If the port component is not set or is the standard port for the current - * scheme, it SHOULD NOT be included. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.2 - * @return string The URI authority, in "[user-info@]host[:port]" format. - */ - public function getAuthority(); - - /** - * Retrieve the user information component of the URI. - * - * If no user information is present, this method MUST return an empty - * string. - * - * If a user is present in the URI, this will return that value; - * additionally, if the password is also present, it will be appended to the - * user value, with a colon (":") separating the values. - * - * The trailing "@" character is not part of the user information and MUST - * NOT be added. - * - * @return string The URI user information, in "username[:password]" format. - */ - public function getUserInfo(); - - /** - * Retrieve the host component of the URI. - * - * If no host is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.2.2. - * - * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 - * @return string The URI host. - */ - public function getHost(); - - /** - * Retrieve the port component of the URI. - * - * If a port is present, and it is non-standard for the current scheme, - * this method MUST return it as an integer. If the port is the standard port - * used with the current scheme, this method SHOULD return null. - * - * If no port is present, and no scheme is present, this method MUST return - * a null value. - * - * If no port is present, but a scheme is present, this method MAY return - * the standard port for that scheme, but SHOULD return null. - * - * @return null|int The URI port. - */ - public function getPort(); - - /** - * Retrieve the path component of the URI. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * Normally, the empty path "" and absolute path "/" are considered equal as - * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically - * do this normalization because in contexts with a trimmed base path, e.g. - * the front controller, this difference becomes significant. It's the task - * of the user to handle both "" and "/". - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.3. - * - * As an example, if the value should include a slash ("/") not intended as - * delimiter between path segments, that value MUST be passed in encoded - * form (e.g., "%2F") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.3 - * @return string The URI path. - */ - public function getPath(); - - /** - * Retrieve the query string of the URI. - * - * If no query string is present, this method MUST return an empty string. - * - * The leading "?" character is not part of the query and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.4. - * - * As an example, if a value in a key/value pair of the query string should - * include an ampersand ("&") not intended as a delimiter between values, - * that value MUST be passed in encoded form (e.g., "%26") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.4 - * @return string The URI query string. - */ - public function getQuery(); - - /** - * Retrieve the fragment component of the URI. - * - * If no fragment is present, this method MUST return an empty string. - * - * The leading "#" character is not part of the fragment and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.5. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.5 - * @return string The URI fragment. - */ - public function getFragment(); - - /** - * Return an instance with the specified scheme. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified scheme. - * - * Implementations MUST support the schemes "http" and "https" case - * insensitively, and MAY accommodate other schemes if required. - * - * An empty scheme is equivalent to removing the scheme. - * - * @param string $scheme The scheme to use with the new instance. - * @return self A new instance with the specified scheme. - * @throws \InvalidArgumentException for invalid or unsupported schemes. - */ - public function withScheme($scheme); - - /** - * Return an instance with the specified user information. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified user information. - * - * Password is optional, but the user information MUST include the - * user; an empty string for the user is equivalent to removing user - * information. - * - * @param string $user The user name to use for authority. - * @param null|string $password The password associated with $user. - * @return self A new instance with the specified user information. - */ - public function withUserInfo($user, $password = null); - - /** - * Return an instance with the specified host. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified host. - * - * An empty host value is equivalent to removing the host. - * - * @param string $host The hostname to use with the new instance. - * @return self A new instance with the specified host. - * @throws \InvalidArgumentException for invalid hostnames. - */ - public function withHost($host); - - /** - * Return an instance with the specified port. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified port. - * - * Implementations MUST raise an exception for ports outside the - * established TCP and UDP port ranges. - * - * A null value provided for the port is equivalent to removing the port - * information. - * - * @param null|int $port The port to use with the new instance; a null value - * removes the port information. - * @return self A new instance with the specified port. - * @throws \InvalidArgumentException for invalid ports. - */ - public function withPort($port); - - /** - * Return an instance with the specified path. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified path. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * If the path is intended to be domain-relative rather than path relative then - * it must begin with a slash ("/"). Paths not starting with a slash ("/") - * are assumed to be relative to some base path known to the application or - * consumer. - * - * Users can provide both encoded and decoded path characters. - * Implementations ensure the correct encoding as outlined in getPath(). - * - * @param string $path The path to use with the new instance. - * @return self A new instance with the specified path. - * @throws \InvalidArgumentException for invalid paths. - */ - public function withPath($path); - - /** - * Return an instance with the specified query string. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified query string. - * - * Users can provide both encoded and decoded query characters. - * Implementations ensure the correct encoding as outlined in getQuery(). - * - * An empty query string value is equivalent to removing the query string. - * - * @param string $query The query string to use with the new instance. - * @return self A new instance with the specified query string. - * @throws \InvalidArgumentException for invalid query strings. - */ - public function withQuery($query); - - /** - * Return an instance with the specified URI fragment. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified URI fragment. - * - * Users can provide both encoded and decoded fragment characters. - * Implementations ensure the correct encoding as outlined in getFragment(). - * - * An empty fragment value is equivalent to removing the fragment. - * - * @param string $fragment The fragment to use with the new instance. - * @return self A new instance with the specified fragment. - */ - public function withFragment($fragment); - - /** - * Return the string representation as a URI reference. - * - * Depending on which components of the URI are present, the resulting - * string is either a full URI or relative reference according to RFC 3986, - * Section 4.1. The method concatenates the various components of the URI, - * using the appropriate delimiters: - * - * - If a scheme is present, it MUST be suffixed by ":". - * - If an authority is present, it MUST be prefixed by "//". - * - The path can be concatenated without delimiters. But there are two - * cases where the path has to be adjusted to make the URI reference - * valid as PHP does not allow to throw an exception in __toString(): - * - If the path is rootless and an authority is present, the path MUST - * be prefixed by "/". - * - If the path is starting with more than one "/" and no authority is - * present, the starting slashes MUST be reduced to one. - * - If a query is present, it MUST be prefixed by "?". - * - If a fragment is present, it MUST be prefixed by "#". - * - * @see http://tools.ietf.org/html/rfc3986#section-4.1 - * @return string - */ - public function __toString(); -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/CONTRIBUTING.md b/samples/server/petstore/php-slim/vendor/slim/slim/CONTRIBUTING.md deleted file mode 100644 index 9bbb6b17ca2..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/CONTRIBUTING.md +++ /dev/null @@ -1,20 +0,0 @@ -# How to Contribute - -## Pull Requests - -1. Fork the Slim Framework repository -2. Create a new branch for each feature or improvement -3. Send a pull request from each feature branch to the **develop** branch - -It is very important to separate new features or improvements into separate feature branches, and to send a -pull request for each branch. This allows me to review and pull in new features or improvements individually. - -## Style Guide - -All pull requests must adhere to the [PSR-2 standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md). - -## Unit Testing - -All pull requests must be accompanied by passing unit tests and complete code coverage. The Slim Framework uses phpunit for testing. - -[Learn about PHPUnit](https://github.com/sebastianbergmann/phpunit/) diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/LICENSE.md b/samples/server/petstore/php-slim/vendor/slim/slim/LICENSE.md deleted file mode 100644 index 0875f84f905..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/LICENSE.md +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011-2016 Josh Lockhart - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/README.md b/samples/server/petstore/php-slim/vendor/slim/slim/README.md deleted file mode 100644 index d20f3939d1c..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/README.md +++ /dev/null @@ -1,84 +0,0 @@ -# Slim Framework - -[![Build Status](https://travis-ci.org/slimphp/Slim.svg?branch=develop)](https://travis-ci.org/slimphp/Slim) -[![Coverage Status](https://coveralls.io/repos/slimphp/Slim/badge.svg)](https://coveralls.io/r/slimphp/Slim) -[![Total Downloads](https://poser.pugx.org/slim/slim/downloads)](https://packagist.org/packages/slim/slim) -[![License](https://poser.pugx.org/slim/slim/license)](https://packagist.org/packages/slim/slim) - -Slim is a PHP micro-framework that helps you quickly write simple yet powerful web applications and APIs. - -## Installation - -It's recommended that you use [Composer](https://getcomposer.org/) to install Slim. - -```bash -$ composer require slim/slim "^3.0" -``` - -This will install Slim and all required dependencies. Slim requires PHP 5.5.0 or newer. - -## Usage - -Create an index.php file with the following contents: - -```php -get('/hello/{name}', function ($request, $response, $args) { - $response->write("Hello, " . $args['name']); - return $response; -}); - -$app->run(); -``` - -You may quickly test this using the built-in PHP server: -```bash -$ php -S localhost:8000 -``` - -Going to http://localhost:8000/hello/world will now display "Hello, world". - -For more information on how to configure your web server, see the [Documentation](http://www.slimframework.com/docs/start/web-servers.html). - -## Tests - -To execute the test suite, you'll need phpunit. - -```bash -$ phpunit -``` - -## Contributing - -Please see [CONTRIBUTING](CONTRIBUTING.md) for details. - -## Learn More - -Learn more at these links: - -- [Website](http://www.slimframework.com) -- [Documentation](http://www.slimframework.com/docs/start/installation.html) -- [Support Forum](http://help.slimframework.com) -- [Twitter](https://twitter.com/slimphp) -- [Resources](https://github.com/xssc/awesome-slim) - -## Security - -If you discover security related issues, please email security@slimframework.com instead of using the issue tracker. - -## Credits - -- [Josh Lockhart](https://github.com/codeguy) -- [Andrew Smith](https://github.com/silentworks) -- [Rob Allen](https://github.com/akrabat) -- [Gabriel Manricks](https://github.com/gmanricks) -- [All Contributors](../../contributors) - -## License - -The Slim Framework is licensed under the MIT license. See [License File](LICENSE.md) for more information. diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/App.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/App.php deleted file mode 100644 index 639d9b9b470..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/App.php +++ /dev/null @@ -1,644 +0,0 @@ -container = $container; - } - - /** - * Enable access to the DI container by consumers of $app - * - * @return ContainerInterface - */ - public function getContainer() - { - return $this->container; - } - - /** - * Add middleware - * - * This method prepends new middleware to the app's middleware stack. - * - * @param callable|string $callable The callback routine - * - * @return static - */ - public function add($callable) - { - return $this->addMiddleware(new DeferredCallable($callable, $this->container)); - } - - /** - * Calling a non-existent method on App checks to see if there's an item - * in the container that is callable and if so, calls it. - * - * @param string $method - * @param array $args - * @return mixed - */ - public function __call($method, $args) - { - if ($this->container->has($method)) { - $obj = $this->container->get($method); - if (is_callable($obj)) { - return call_user_func_array($obj, $args); - } - } - - throw new \BadMethodCallException("Method $method is not a valid method"); - } - - /******************************************************************************** - * Router proxy methods - *******************************************************************************/ - - /** - * Add GET route - * - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * - * @return \Slim\Interfaces\RouteInterface - */ - public function get($pattern, $callable) - { - return $this->map(['GET'], $pattern, $callable); - } - - /** - * Add POST route - * - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * - * @return \Slim\Interfaces\RouteInterface - */ - public function post($pattern, $callable) - { - return $this->map(['POST'], $pattern, $callable); - } - - /** - * Add PUT route - * - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * - * @return \Slim\Interfaces\RouteInterface - */ - public function put($pattern, $callable) - { - return $this->map(['PUT'], $pattern, $callable); - } - - /** - * Add PATCH route - * - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * - * @return \Slim\Interfaces\RouteInterface - */ - public function patch($pattern, $callable) - { - return $this->map(['PATCH'], $pattern, $callable); - } - - /** - * Add DELETE route - * - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * - * @return \Slim\Interfaces\RouteInterface - */ - public function delete($pattern, $callable) - { - return $this->map(['DELETE'], $pattern, $callable); - } - - /** - * Add OPTIONS route - * - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * - * @return \Slim\Interfaces\RouteInterface - */ - public function options($pattern, $callable) - { - return $this->map(['OPTIONS'], $pattern, $callable); - } - - /** - * Add route for any HTTP method - * - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * - * @return \Slim\Interfaces\RouteInterface - */ - public function any($pattern, $callable) - { - return $this->map(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], $pattern, $callable); - } - - /** - * Add route with multiple methods - * - * @param string[] $methods Numeric array of HTTP method names - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * - * @return RouteInterface - */ - public function map(array $methods, $pattern, $callable) - { - if ($callable instanceof Closure) { - $callable = $callable->bindTo($this->container); - } - - $route = $this->container->get('router')->map($methods, $pattern, $callable); - if (is_callable([$route, 'setContainer'])) { - $route->setContainer($this->container); - } - - if (is_callable([$route, 'setOutputBuffering'])) { - $route->setOutputBuffering($this->container->get('settings')['outputBuffering']); - } - - return $route; - } - - /** - * Route Groups - * - * This method accepts a route pattern and a callback. All route - * declarations in the callback will be prepended by the group(s) - * that it is in. - * - * @param string $pattern - * @param callable $callable - * - * @return RouteGroupInterface - */ - public function group($pattern, $callable) - { - /** @var RouteGroup $group */ - $group = $this->container->get('router')->pushGroup($pattern, $callable); - $group->setContainer($this->container); - $group($this); - $this->container->get('router')->popGroup(); - return $group; - } - - /******************************************************************************** - * Runner - *******************************************************************************/ - - /** - * Run application - * - * This method traverses the application middleware stack and then sends the - * resultant Response object to the HTTP client. - * - * @param bool|false $silent - * @return ResponseInterface - * - * @throws Exception - * @throws MethodNotAllowedException - * @throws NotFoundException - */ - public function run($silent = false) - { - $request = $this->container->get('request'); - $response = $this->container->get('response'); - - $response = $this->process($request, $response); - - if (!$silent) { - $this->respond($response); - } - - return $response; - } - - /** - * Process a request - * - * This method traverses the application middleware stack and then returns the - * resultant Response object. - * - * @param ServerRequestInterface $request - * @param ResponseInterface $response - * @return ResponseInterface - * - * @throws Exception - * @throws MethodNotAllowedException - * @throws NotFoundException - */ - public function process(ServerRequestInterface $request, ResponseInterface $response) - { - // Ensure basePath is set - $router = $this->container->get('router'); - if (is_callable([$request->getUri(), 'getBasePath']) && is_callable([$router, 'setBasePath'])) { - $router->setBasePath($request->getUri()->getBasePath()); - } - - // Dispatch the Router first if the setting for this is on - if ($this->container->get('settings')['determineRouteBeforeAppMiddleware'] === true) { - // Dispatch router (note: you won't be able to alter routes after this) - $request = $this->dispatchRouterAndPrepareRoute($request, $router); - } - - // Traverse middleware stack - try { - $response = $this->callMiddlewareStack($request, $response); - } catch (Exception $e) { - $response = $this->handleException($e, $request, $response); - } catch (Throwable $e) { - $response = $this->handlePhpError($e, $request, $response); - } - - $response = $this->finalize($response); - - return $response; - } - - /** - * Send the response the client - * - * @param ResponseInterface $response - */ - public function respond(ResponseInterface $response) - { - // Send response - if (!headers_sent()) { - // Status - header(sprintf( - 'HTTP/%s %s %s', - $response->getProtocolVersion(), - $response->getStatusCode(), - $response->getReasonPhrase() - )); - - // Headers - foreach ($response->getHeaders() as $name => $values) { - foreach ($values as $value) { - header(sprintf('%s: %s', $name, $value), false); - } - } - } - - // Body - if (!$this->isEmptyResponse($response)) { - $body = $response->getBody(); - if ($body->isSeekable()) { - $body->rewind(); - } - $settings = $this->container->get('settings'); - $chunkSize = $settings['responseChunkSize']; - - $contentLength = $response->getHeaderLine('Content-Length'); - if (!$contentLength) { - $contentLength = $body->getSize(); - } - - - if (isset($contentLength)) { - $amountToRead = $contentLength; - while ($amountToRead > 0 && !$body->eof()) { - $data = $body->read(min($chunkSize, $amountToRead)); - echo $data; - - $amountToRead -= strlen($data); - - if (connection_status() != CONNECTION_NORMAL) { - break; - } - } - } else { - while (!$body->eof()) { - echo $body->read($chunkSize); - if (connection_status() != CONNECTION_NORMAL) { - break; - } - } - } - } - } - - /** - * Invoke application - * - * This method implements the middleware interface. It receives - * Request and Response objects, and it returns a Response object - * after compiling the routes registered in the Router and dispatching - * the Request object to the appropriate Route callback routine. - * - * @param ServerRequestInterface $request The most recent Request object - * @param ResponseInterface $response The most recent Response object - * - * @return ResponseInterface - * @throws MethodNotAllowedException - * @throws NotFoundException - */ - public function __invoke(ServerRequestInterface $request, ResponseInterface $response) - { - // Get the route info - $routeInfo = $request->getAttribute('routeInfo'); - - /** @var \Slim\Interfaces\RouterInterface $router */ - $router = $this->container->get('router'); - - // If router hasn't been dispatched or the URI changed then dispatch - if (null === $routeInfo || ($routeInfo['request'] !== [$request->getMethod(), (string) $request->getUri()])) { - $request = $this->dispatchRouterAndPrepareRoute($request, $router); - $routeInfo = $request->getAttribute('routeInfo'); - } - - if ($routeInfo[0] === Dispatcher::FOUND) { - $route = $router->lookupRoute($routeInfo[1]); - return $route->run($request, $response); - } elseif ($routeInfo[0] === Dispatcher::METHOD_NOT_ALLOWED) { - if (!$this->container->has('notAllowedHandler')) { - throw new MethodNotAllowedException($request, $response, $routeInfo[1]); - } - /** @var callable $notAllowedHandler */ - $notAllowedHandler = $this->container->get('notAllowedHandler'); - return $notAllowedHandler($request, $response, $routeInfo[1]); - } - - if (!$this->container->has('notFoundHandler')) { - throw new NotFoundException($request, $response); - } - /** @var callable $notFoundHandler */ - $notFoundHandler = $this->container->get('notFoundHandler'); - return $notFoundHandler($request, $response); - } - - /** - * Perform a sub-request from within an application route - * - * This method allows you to prepare and initiate a sub-request, run within - * the context of the current request. This WILL NOT issue a remote HTTP - * request. Instead, it will route the provided URL, method, headers, - * cookies, body, and server variables against the set of registered - * application routes. The result response object is returned. - * - * @param string $method The request method (e.g., GET, POST, PUT, etc.) - * @param string $path The request URI path - * @param string $query The request URI query string - * @param array $headers The request headers (key-value array) - * @param array $cookies The request cookies (key-value array) - * @param string $bodyContent The request body - * @param ResponseInterface $response The response object (optional) - * @return ResponseInterface - */ - public function subRequest( - $method, - $path, - $query = '', - array $headers = [], - array $cookies = [], - $bodyContent = '', - ResponseInterface $response = null - ) { - $env = $this->container->get('environment'); - $uri = Uri::createFromEnvironment($env)->withPath($path)->withQuery($query); - $headers = new Headers($headers); - $serverParams = $env->all(); - $body = new Body(fopen('php://temp', 'r+')); - $body->write($bodyContent); - $body->rewind(); - $request = new Request($method, $uri, $headers, $cookies, $serverParams, $body); - - if (!$response) { - $response = $this->container->get('response'); - } - - return $this($request, $response); - } - - /** - * Dispatch the router to find the route. Prepare the route for use. - * - * @param ServerRequestInterface $request - * @param RouterInterface $router - * @return ServerRequestInterface - */ - protected function dispatchRouterAndPrepareRoute(ServerRequestInterface $request, RouterInterface $router) - { - $routeInfo = $router->dispatch($request); - - if ($routeInfo[0] === Dispatcher::FOUND) { - $routeArguments = []; - foreach ($routeInfo[2] as $k => $v) { - $routeArguments[$k] = urldecode($v); - } - - $route = $router->lookupRoute($routeInfo[1]); - $route->prepare($request, $routeArguments); - - // add route to the request's attributes in case a middleware or handler needs access to the route - $request = $request->withAttribute('route', $route); - } - - $routeInfo['request'] = [$request->getMethod(), (string) $request->getUri()]; - - return $request->withAttribute('routeInfo', $routeInfo); - } - - /** - * Finalize response - * - * @param ResponseInterface $response - * @return ResponseInterface - */ - protected function finalize(ResponseInterface $response) - { - // stop PHP sending a Content-Type automatically - ini_set('default_mimetype', ''); - - if ($this->isEmptyResponse($response)) { - return $response->withoutHeader('Content-Type')->withoutHeader('Content-Length'); - } - - // Add Content-Length header if `addContentLengthHeader` setting is set - if (isset($this->container->get('settings')['addContentLengthHeader']) && - $this->container->get('settings')['addContentLengthHeader'] == true) { - if (ob_get_length() > 0) { - throw new \RuntimeException("Unexpected data in output buffer. " . - "Maybe you have characters before an opening getBody()->getSize(); - if ($size !== null && !$response->hasHeader('Content-Length')) { - $response = $response->withHeader('Content-Length', (string) $size); - } - } - - return $response; - } - - /** - * Helper method, which returns true if the provided response must not output a body and false - * if the response could have a body. - * - * @see https://tools.ietf.org/html/rfc7231 - * - * @param ResponseInterface $response - * @return bool - */ - protected function isEmptyResponse(ResponseInterface $response) - { - if (method_exists($response, 'isEmpty')) { - return $response->isEmpty(); - } - - return in_array($response->getStatusCode(), [204, 205, 304]); - } - - /** - * Call relevant handler from the Container if needed. If it doesn't exist, - * then just re-throw. - * - * @param Exception $e - * @param ServerRequestInterface $request - * @param ResponseInterface $response - * - * @return ResponseInterface - * @throws Exception if a handler is needed and not found - */ - protected function handleException(Exception $e, ServerRequestInterface $request, ResponseInterface $response) - { - if ($e instanceof MethodNotAllowedException) { - $handler = 'notAllowedHandler'; - $params = [$e->getRequest(), $e->getResponse(), $e->getAllowedMethods()]; - } elseif ($e instanceof NotFoundException) { - $handler = 'notFoundHandler'; - $params = [$e->getRequest(), $e->getResponse()]; - } elseif ($e instanceof SlimException) { - // This is a Stop exception and contains the response - return $e->getResponse(); - } else { - // Other exception, use $request and $response params - $handler = 'errorHandler'; - $params = [$request, $response, $e]; - } - - if ($this->container->has($handler)) { - $callable = $this->container->get($handler); - // Call the registered handler - return call_user_func_array($callable, $params); - } - - // No handlers found, so just throw the exception - throw $e; - } - - /** - * Call relevant handler from the Container if needed. If it doesn't exist, - * then just re-throw. - * - * @param Throwable $e - * @param ServerRequestInterface $request - * @param ResponseInterface $response - * @return ResponseInterface - * @throws Throwable - */ - protected function handlePhpError(Throwable $e, ServerRequestInterface $request, ResponseInterface $response) - { - $handler = 'phpErrorHandler'; - $params = [$request, $response, $e]; - - if ($this->container->has($handler)) { - $callable = $this->container->get($handler); - // Call the registered handler - return call_user_func_array($callable, $params); - } - - // No handlers found, so just throw the exception - throw $e; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/CallableResolver.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/CallableResolver.php deleted file mode 100644 index 705a9f207fe..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/CallableResolver.php +++ /dev/null @@ -1,87 +0,0 @@ -container = $container; - } - - /** - * Resolve toResolve into a closure that that the router can dispatch. - * - * If toResolve is of the format 'class:method', then try to extract 'class' - * from the container otherwise instantiate it and then dispatch 'method'. - * - * @param mixed $toResolve - * - * @return callable - * - * @throws RuntimeException if the callable does not exist - * @throws RuntimeException if the callable is not resolvable - */ - public function resolve($toResolve) - { - $resolved = $toResolve; - - if (!is_callable($toResolve) && is_string($toResolve)) { - // check for slim callable as "class:method" - $callablePattern = '!^([^\:]+)\:([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$!'; - if (preg_match($callablePattern, $toResolve, $matches)) { - $class = $matches[1]; - $method = $matches[2]; - - if ($this->container->has($class)) { - $resolved = [$this->container->get($class), $method]; - } else { - if (!class_exists($class)) { - throw new RuntimeException(sprintf('Callable %s does not exist', $class)); - } - $resolved = [new $class($this->container), $method]; - } - } else { - // check if string is something in the DIC that's callable or is a class name which - // has an __invoke() method - $class = $toResolve; - if ($this->container->has($class)) { - $resolved = $this->container->get($class); - } else { - if (!class_exists($class)) { - throw new RuntimeException(sprintf('Callable %s does not exist', $class)); - } - $resolved = new $class($this->container); - } - } - } - - if (!is_callable($resolved)) { - throw new RuntimeException(sprintf('%s is not resolvable', $toResolve)); - } - - return $resolved; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/CallableResolverAwareTrait.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/CallableResolverAwareTrait.php deleted file mode 100644 index f7ff485282d..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/CallableResolverAwareTrait.php +++ /dev/null @@ -1,47 +0,0 @@ -container instanceof ContainerInterface) { - return $callable; - } - - /** @var CallableResolverInterface $resolver */ - $resolver = $this->container->get('callableResolver'); - - return $resolver->resolve($callable); - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Collection.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Collection.php deleted file mode 100644 index d33acd9ce32..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Collection.php +++ /dev/null @@ -1,204 +0,0 @@ - $value) { - $this->set($key, $value); - } - } - - /******************************************************************************** - * Collection interface - *******************************************************************************/ - - /** - * Set collection item - * - * @param string $key The data key - * @param mixed $value The data value - */ - public function set($key, $value) - { - $this->data[$key] = $value; - } - - /** - * Get collection item for key - * - * @param string $key The data key - * @param mixed $default The default value to return if data key does not exist - * - * @return mixed The key's value, or the default value - */ - public function get($key, $default = null) - { - return $this->has($key) ? $this->data[$key] : $default; - } - - /** - * Add item to collection - * - * @param array $items Key-value array of data to append to this collection - */ - public function replace(array $items) - { - foreach ($items as $key => $value) { - $this->set($key, $value); - } - } - - /** - * Get all items in collection - * - * @return array The collection's source data - */ - public function all() - { - return $this->data; - } - - /** - * Get collection keys - * - * @return array The collection's source data keys - */ - public function keys() - { - return array_keys($this->data); - } - - /** - * Does this collection have a given key? - * - * @param string $key The data key - * - * @return bool - */ - public function has($key) - { - return array_key_exists($key, $this->data); - } - - /** - * Remove item from collection - * - * @param string $key The data key - */ - public function remove($key) - { - unset($this->data[$key]); - } - - /** - * Remove all items from collection - */ - public function clear() - { - $this->data = []; - } - - /******************************************************************************** - * ArrayAccess interface - *******************************************************************************/ - - /** - * Does this collection have a given key? - * - * @param string $key The data key - * - * @return bool - */ - public function offsetExists($key) - { - return $this->has($key); - } - - /** - * Get collection item for key - * - * @param string $key The data key - * - * @return mixed The key's value, or the default value - */ - public function offsetGet($key) - { - return $this->get($key); - } - - /** - * Set collection item - * - * @param string $key The data key - * @param mixed $value The data value - */ - public function offsetSet($key, $value) - { - $this->set($key, $value); - } - - /** - * Remove item from collection - * - * @param string $key The data key - */ - public function offsetUnset($key) - { - $this->remove($key); - } - - /** - * Get number of items in collection - * - * @return int - */ - public function count() - { - return count($this->data); - } - - /******************************************************************************** - * IteratorAggregate interface - *******************************************************************************/ - - /** - * Get collection iterator - * - * @return \ArrayIterator - */ - public function getIterator() - { - return new ArrayIterator($this->data); - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Container.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Container.php deleted file mode 100644 index c97f2b3fdf4..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Container.php +++ /dev/null @@ -1,181 +0,0 @@ - '1.1', - 'responseChunkSize' => 4096, - 'outputBuffering' => 'append', - 'determineRouteBeforeAppMiddleware' => false, - 'displayErrorDetails' => false, - 'addContentLengthHeader' => true, - 'routerCacheFile' => false, - ]; - - /** - * Create new container - * - * @param array $values The parameters or objects. - */ - public function __construct(array $values = []) - { - parent::__construct($values); - - $userSettings = isset($values['settings']) ? $values['settings'] : []; - $this->registerDefaultServices($userSettings); - } - - /** - * This function registers the default services that Slim needs to work. - * - * All services are shared - that is, they are registered such that the - * same instance is returned on subsequent calls. - * - * @param array $userSettings Associative array of application settings - * - * @return void - */ - private function registerDefaultServices($userSettings) - { - $defaultSettings = $this->defaultSettings; - - /** - * This service MUST return an array or an - * instance of \ArrayAccess. - * - * @return array|\ArrayAccess - */ - $this['settings'] = function () use ($userSettings, $defaultSettings) { - return new Collection(array_merge($defaultSettings, $userSettings)); - }; - - $defaultProvider = new DefaultServicesProvider(); - $defaultProvider->register($this); - } - - /******************************************************************************** - * Methods to satisfy Interop\Container\ContainerInterface - *******************************************************************************/ - - /** - * Finds an entry of the container by its identifier and returns it. - * - * @param string $id Identifier of the entry to look for. - * - * @throws ContainerValueNotFoundException No entry was found for this identifier. - * @throws ContainerException Error while retrieving the entry. - * - * @return mixed Entry. - */ - public function get($id) - { - if (!$this->offsetExists($id)) { - throw new ContainerValueNotFoundException(sprintf('Identifier "%s" is not defined.', $id)); - } - try { - return $this->offsetGet($id); - } catch (\InvalidArgumentException $exception) { - if ($this->exceptionThrownByContainer($exception)) { - throw new SlimContainerException( - sprintf('Container error while retrieving "%s"', $id), - null, - $exception - ); - } else { - throw $exception; - } - } - } - - /** - * Tests whether an exception needs to be recast for compliance with Container-Interop. This will be if the - * exception was thrown by Pimple. - * - * @param \InvalidArgumentException $exception - * - * @return bool - */ - private function exceptionThrownByContainer(\InvalidArgumentException $exception) - { - $trace = $exception->getTrace()[0]; - - return $trace['class'] === PimpleContainer::class && $trace['function'] === 'offsetGet'; - } - - /** - * Returns true if the container can return an entry for the given identifier. - * Returns false otherwise. - * - * @param string $id Identifier of the entry to look for. - * - * @return boolean - */ - public function has($id) - { - return $this->offsetExists($id); - } - - - /******************************************************************************** - * Magic methods for convenience - *******************************************************************************/ - - public function __get($name) - { - return $this->get($name); - } - - public function __isset($name) - { - return $this->has($name); - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/DefaultServicesProvider.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/DefaultServicesProvider.php deleted file mode 100644 index c18d8757204..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/DefaultServicesProvider.php +++ /dev/null @@ -1,204 +0,0 @@ -get('environment')); - }; - } - - if (!isset($container['response'])) { - /** - * PSR-7 Response object - * - * @param Container $container - * - * @return ResponseInterface - */ - $container['response'] = function ($container) { - $headers = new Headers(['Content-Type' => 'text/html; charset=UTF-8']); - $response = new Response(200, $headers); - - return $response->withProtocolVersion($container->get('settings')['httpVersion']); - }; - } - - if (!isset($container['router'])) { - /** - * This service MUST return a SHARED instance - * of \Slim\Interfaces\RouterInterface. - * - * @param Container $container - * - * @return RouterInterface - */ - $container['router'] = function ($container) { - $routerCacheFile = false; - if (isset($container->get('settings')['routerCacheFile'])) { - $routerCacheFile = $container->get('settings')['routerCacheFile']; - } - - return (new Router)->setCacheFile($routerCacheFile); - }; - } - - if (!isset($container['foundHandler'])) { - /** - * This service MUST return a SHARED instance - * of \Slim\Interfaces\InvocationStrategyInterface. - * - * @return InvocationStrategyInterface - */ - $container['foundHandler'] = function () { - return new RequestResponse; - }; - } - - if (!isset($container['phpErrorHandler'])) { - /** - * This service MUST return a callable - * that accepts three arguments: - * - * 1. Instance of \Psr\Http\Message\ServerRequestInterface - * 2. Instance of \Psr\Http\Message\ResponseInterface - * 3. Instance of \Error - * - * The callable MUST return an instance of - * \Psr\Http\Message\ResponseInterface. - * - * @param Container $container - * - * @return callable - */ - $container['phpErrorHandler'] = function ($container) { - return new PhpError($container->get('settings')['displayErrorDetails']); - }; - } - - if (!isset($container['errorHandler'])) { - /** - * This service MUST return a callable - * that accepts three arguments: - * - * 1. Instance of \Psr\Http\Message\ServerRequestInterface - * 2. Instance of \Psr\Http\Message\ResponseInterface - * 3. Instance of \Exception - * - * The callable MUST return an instance of - * \Psr\Http\Message\ResponseInterface. - * - * @param Container $container - * - * @return callable - */ - $container['errorHandler'] = function ($container) { - return new Error($container->get('settings')['displayErrorDetails']); - }; - } - - if (!isset($container['notFoundHandler'])) { - /** - * This service MUST return a callable - * that accepts two arguments: - * - * 1. Instance of \Psr\Http\Message\ServerRequestInterface - * 2. Instance of \Psr\Http\Message\ResponseInterface - * - * The callable MUST return an instance of - * \Psr\Http\Message\ResponseInterface. - * - * @return callable - */ - $container['notFoundHandler'] = function () { - return new NotFound; - }; - } - - if (!isset($container['notAllowedHandler'])) { - /** - * This service MUST return a callable - * that accepts three arguments: - * - * 1. Instance of \Psr\Http\Message\ServerRequestInterface - * 2. Instance of \Psr\Http\Message\ResponseInterface - * 3. Array of allowed HTTP methods - * - * The callable MUST return an instance of - * \Psr\Http\Message\ResponseInterface. - * - * @return callable - */ - $container['notAllowedHandler'] = function () { - return new NotAllowed; - }; - } - - if (!isset($container['callableResolver'])) { - /** - * Instance of \Slim\Interfaces\CallableResolverInterface - * - * @param Container $container - * - * @return CallableResolverInterface - */ - $container['callableResolver'] = function ($container) { - return new CallableResolver($container); - }; - } - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/DeferredCallable.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/DeferredCallable.php deleted file mode 100644 index def58ab23b3..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/DeferredCallable.php +++ /dev/null @@ -1,39 +0,0 @@ -callable = $callable; - $this->container = $container; - } - - public function __invoke() - { - $callable = $this->resolveCallable($this->callable); - if ($callable instanceof Closure) { - $callable = $callable->bindTo($this->container); - } - - $args = func_get_args(); - - return call_user_func_array($callable, $args); - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Exception/ContainerException.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Exception/ContainerException.php deleted file mode 100644 index 0200e1a8611..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Exception/ContainerException.php +++ /dev/null @@ -1,20 +0,0 @@ -allowedMethods = $allowedMethods; - } - - /** - * Get allowed methods - * - * @return string[] - */ - public function getAllowedMethods() - { - return $this->allowedMethods; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Exception/NotFoundException.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Exception/NotFoundException.php deleted file mode 100644 index 65365eb99d6..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Exception/NotFoundException.php +++ /dev/null @@ -1,14 +0,0 @@ -request = $request; - $this->response = $response; - } - - /** - * Get request - * - * @return ServerRequestInterface - */ - public function getRequest() - { - return $this->request; - } - - /** - * Get response - * - * @return ResponseInterface - */ - public function getResponse() - { - return $this->response; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/AbstractError.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/AbstractError.php deleted file mode 100644 index 5a6cee30a94..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/AbstractError.php +++ /dev/null @@ -1,99 +0,0 @@ -displayErrorDetails = (bool) $displayErrorDetails; - } - - /** - * Write to the error log if displayErrorDetails is false - * - * @param \Exception|\Throwable $throwable - * - * @return void - */ - protected function writeToErrorLog($throwable) - { - if ($this->displayErrorDetails) { - return; - } - - $message = 'Slim Application Error:' . PHP_EOL; - $message .= $this->renderThrowableAsText($throwable); - while ($throwable = $throwable->getPrevious()) { - $message .= PHP_EOL . 'Previous error:' . PHP_EOL; - $message .= $this->renderThrowableAsText($throwable); - } - - $message .= PHP_EOL . 'View in rendered output by enabling the "displayErrorDetails" setting.' . PHP_EOL; - - $this->logError($message); - } - - /** - * Render error as Text. - * - * @param \Exception|\Throwable $throwable - * - * @return string - */ - protected function renderThrowableAsText($throwable) - { - $text = sprintf('Type: %s' . PHP_EOL, get_class($throwable)); - - if ($code = $throwable->getCode()) { - $text .= sprintf('Code: %s' . PHP_EOL, $code); - } - - if ($message = $throwable->getMessage()) { - $text .= sprintf('Message: %s' . PHP_EOL, htmlentities($message)); - } - - if ($file = $throwable->getFile()) { - $text .= sprintf('File: %s' . PHP_EOL, $file); - } - - if ($line = $throwable->getLine()) { - $text .= sprintf('Line: %s' . PHP_EOL, $line); - } - - if ($trace = $throwable->getTraceAsString()) { - $text .= sprintf('Trace: %s', $trace); - } - - return $text; - } - - /** - * Wraps the error_log function so that this can be easily tested - * - * @param $message - */ - protected function logError($message) - { - error_log($message); - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/AbstractHandler.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/AbstractHandler.php deleted file mode 100644 index decdf725ce8..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/AbstractHandler.php +++ /dev/null @@ -1,59 +0,0 @@ -getHeaderLine('Accept'); - $selectedContentTypes = array_intersect(explode(',', $acceptHeader), $this->knownContentTypes); - - if (count($selectedContentTypes)) { - return current($selectedContentTypes); - } - - // handle +json and +xml specially - if (preg_match('/\+(json|xml)/', $acceptHeader, $matches)) { - $mediaType = 'application/' . $matches[1]; - if (in_array($mediaType, $this->knownContentTypes)) { - return $mediaType; - } - } - - return 'text/html'; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/Error.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/Error.php deleted file mode 100644 index b9951888efb..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/Error.php +++ /dev/null @@ -1,206 +0,0 @@ -determineContentType($request); - switch ($contentType) { - case 'application/json': - $output = $this->renderJsonErrorMessage($exception); - break; - - case 'text/xml': - case 'application/xml': - $output = $this->renderXmlErrorMessage($exception); - break; - - case 'text/html': - $output = $this->renderHtmlErrorMessage($exception); - break; - - default: - throw new UnexpectedValueException('Cannot render unknown content type ' . $contentType); - } - - $this->writeToErrorLog($exception); - - $body = new Body(fopen('php://temp', 'r+')); - $body->write($output); - - return $response - ->withStatus(500) - ->withHeader('Content-type', $contentType) - ->withBody($body); - } - - /** - * Render HTML error page - * - * @param \Exception $exception - * - * @return string - */ - protected function renderHtmlErrorMessage(\Exception $exception) - { - $title = 'Slim Application Error'; - - if ($this->displayErrorDetails) { - $html = '

The application could not run because of the following error:

'; - $html .= '

Details

'; - $html .= $this->renderHtmlException($exception); - - while ($exception = $exception->getPrevious()) { - $html .= '

Previous exception

'; - $html .= $this->renderHtmlException($exception); - } - } else { - $html = '

A website error has occurred. Sorry for the temporary inconvenience.

'; - } - - $output = sprintf( - "" . - "%s

%s

%s", - $title, - $title, - $html - ); - - return $output; - } - - /** - * Render exception as HTML. - * - * @param \Exception $exception - * - * @return string - */ - protected function renderHtmlException(\Exception $exception) - { - $html = sprintf('
Type: %s
', get_class($exception)); - - if (($code = $exception->getCode())) { - $html .= sprintf('
Code: %s
', $code); - } - - if (($message = $exception->getMessage())) { - $html .= sprintf('
Message: %s
', htmlentities($message)); - } - - if (($file = $exception->getFile())) { - $html .= sprintf('
File: %s
', $file); - } - - if (($line = $exception->getLine())) { - $html .= sprintf('
Line: %s
', $line); - } - - if (($trace = $exception->getTraceAsString())) { - $html .= '

Trace

'; - $html .= sprintf('
%s
', htmlentities($trace)); - } - - return $html; - } - - /** - * Render JSON error - * - * @param \Exception $exception - * - * @return string - */ - protected function renderJsonErrorMessage(\Exception $exception) - { - $error = [ - 'message' => 'Slim Application Error', - ]; - - if ($this->displayErrorDetails) { - $error['exception'] = []; - - do { - $error['exception'][] = [ - 'type' => get_class($exception), - 'code' => $exception->getCode(), - 'message' => $exception->getMessage(), - 'file' => $exception->getFile(), - 'line' => $exception->getLine(), - 'trace' => explode("\n", $exception->getTraceAsString()), - ]; - } while ($exception = $exception->getPrevious()); - } - - return json_encode($error, JSON_PRETTY_PRINT); - } - - /** - * Render XML error - * - * @param \Exception $exception - * - * @return string - */ - protected function renderXmlErrorMessage(\Exception $exception) - { - $xml = "\n Slim Application Error\n"; - if ($this->displayErrorDetails) { - do { - $xml .= " \n"; - $xml .= " " . get_class($exception) . "\n"; - $xml .= " " . $exception->getCode() . "\n"; - $xml .= " " . $this->createCdataSection($exception->getMessage()) . "\n"; - $xml .= " " . $exception->getFile() . "\n"; - $xml .= " " . $exception->getLine() . "\n"; - $xml .= " " . $this->createCdataSection($exception->getTraceAsString()) . "\n"; - $xml .= " \n"; - } while ($exception = $exception->getPrevious()); - } - $xml .= ""; - - return $xml; - } - - /** - * Returns a CDATA section with the given content. - * - * @param string $content - * @return string - */ - private function createCdataSection($content) - { - return sprintf('', str_replace(']]>', ']]]]>', $content)); - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/NotAllowed.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/NotAllowed.php deleted file mode 100644 index 3442f20bc52..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/NotAllowed.php +++ /dev/null @@ -1,147 +0,0 @@ -getMethod() === 'OPTIONS') { - $status = 200; - $contentType = 'text/plain'; - $output = $this->renderPlainNotAllowedMessage($methods); - } else { - $status = 405; - $contentType = $this->determineContentType($request); - switch ($contentType) { - case 'application/json': - $output = $this->renderJsonNotAllowedMessage($methods); - break; - - case 'text/xml': - case 'application/xml': - $output = $this->renderXmlNotAllowedMessage($methods); - break; - - case 'text/html': - $output = $this->renderHtmlNotAllowedMessage($methods); - break; - default: - throw new UnexpectedValueException('Cannot render unknown content type ' . $contentType); - } - } - - $body = new Body(fopen('php://temp', 'r+')); - $body->write($output); - $allow = implode(', ', $methods); - - return $response - ->withStatus($status) - ->withHeader('Content-type', $contentType) - ->withHeader('Allow', $allow) - ->withBody($body); - } - - /** - * Render PLAIN not allowed message - * - * @param array $methods - * @return string - */ - protected function renderPlainNotAllowedMessage($methods) - { - $allow = implode(', ', $methods); - - return 'Allowed methods: ' . $allow; - } - - /** - * Render JSON not allowed message - * - * @param array $methods - * @return string - */ - protected function renderJsonNotAllowedMessage($methods) - { - $allow = implode(', ', $methods); - - return '{"message":"Method not allowed. Must be one of: ' . $allow . '"}'; - } - - /** - * Render XML not allowed message - * - * @param array $methods - * @return string - */ - protected function renderXmlNotAllowedMessage($methods) - { - $allow = implode(', ', $methods); - - return "Method not allowed. Must be one of: $allow"; - } - - /** - * Render HTML not allowed message - * - * @param array $methods - * @return string - */ - protected function renderHtmlNotAllowedMessage($methods) - { - $allow = implode(', ', $methods); - $output = << - - Method not allowed - - - -

Method not allowed

-

Method not allowed. Must be one of: $allow

- - -END; - - return $output; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/NotFound.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/NotFound.php deleted file mode 100644 index ab1d47a4575..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/NotFound.php +++ /dev/null @@ -1,126 +0,0 @@ -determineContentType($request); - switch ($contentType) { - case 'application/json': - $output = $this->renderJsonNotFoundOutput(); - break; - - case 'text/xml': - case 'application/xml': - $output = $this->renderXmlNotFoundOutput(); - break; - - case 'text/html': - $output = $this->renderHtmlNotFoundOutput($request); - break; - - default: - throw new UnexpectedValueException('Cannot render unknown content type ' . $contentType); - } - - $body = new Body(fopen('php://temp', 'r+')); - $body->write($output); - - return $response->withStatus(404) - ->withHeader('Content-Type', $contentType) - ->withBody($body); - } - - /** - * Return a response for application/json content not found - * - * @return ResponseInterface - */ - protected function renderJsonNotFoundOutput() - { - return '{"message":"Not found"}'; - } - - /** - * Return a response for xml content not found - * - * @return ResponseInterface - */ - protected function renderXmlNotFoundOutput() - { - return 'Not found'; - } - - /** - * Return a response for text/html content not found - * - * @param ServerRequestInterface $request The most recent Request object - * - * @return ResponseInterface - */ - protected function renderHtmlNotFoundOutput(ServerRequestInterface $request) - { - $homeUrl = (string)($request->getUri()->withPath('')->withQuery('')->withFragment('')); - return << - - Page Not Found - - - -

Page Not Found

-

- The page you are looking for could not be found. Check the address bar - to ensure your URL is spelled correctly. If all else fails, you can - visit our home page at the link below. -

- Visit the Home Page - - -END; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/PhpError.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/PhpError.php deleted file mode 100644 index 0122ddb0785..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/PhpError.php +++ /dev/null @@ -1,205 +0,0 @@ -determineContentType($request); - switch ($contentType) { - case 'application/json': - $output = $this->renderJsonErrorMessage($error); - break; - - case 'text/xml': - case 'application/xml': - $output = $this->renderXmlErrorMessage($error); - break; - - case 'text/html': - $output = $this->renderHtmlErrorMessage($error); - break; - default: - throw new UnexpectedValueException('Cannot render unknown content type ' . $contentType); - } - - $this->writeToErrorLog($error); - - $body = new Body(fopen('php://temp', 'r+')); - $body->write($output); - - return $response - ->withStatus(500) - ->withHeader('Content-type', $contentType) - ->withBody($body); - } - - /** - * Render HTML error page - * - * @param \Throwable $error - * - * @return string - */ - protected function renderHtmlErrorMessage(\Throwable $error) - { - $title = 'Slim Application Error'; - - if ($this->displayErrorDetails) { - $html = '

The application could not run because of the following error:

'; - $html .= '

Details

'; - $html .= $this->renderHtmlError($error); - - while ($error = $error->getPrevious()) { - $html .= '

Previous error

'; - $html .= $this->renderHtmlError($error); - } - } else { - $html = '

A website error has occurred. Sorry for the temporary inconvenience.

'; - } - - $output = sprintf( - "" . - "%s

%s

%s", - $title, - $title, - $html - ); - - return $output; - } - - /** - * Render error as HTML. - * - * @param \Throwable $error - * - * @return string - */ - protected function renderHtmlError(\Throwable $error) - { - $html = sprintf('
Type: %s
', get_class($error)); - - if (($code = $error->getCode())) { - $html .= sprintf('
Code: %s
', $code); - } - - if (($message = $error->getMessage())) { - $html .= sprintf('
Message: %s
', htmlentities($message)); - } - - if (($file = $error->getFile())) { - $html .= sprintf('
File: %s
', $file); - } - - if (($line = $error->getLine())) { - $html .= sprintf('
Line: %s
', $line); - } - - if (($trace = $error->getTraceAsString())) { - $html .= '

Trace

'; - $html .= sprintf('
%s
', htmlentities($trace)); - } - - return $html; - } - - /** - * Render JSON error - * - * @param \Throwable $error - * - * @return string - */ - protected function renderJsonErrorMessage(\Throwable $error) - { - $json = [ - 'message' => 'Slim Application Error', - ]; - - if ($this->displayErrorDetails) { - $json['error'] = []; - - do { - $json['error'][] = [ - 'type' => get_class($error), - 'code' => $error->getCode(), - 'message' => $error->getMessage(), - 'file' => $error->getFile(), - 'line' => $error->getLine(), - 'trace' => explode("\n", $error->getTraceAsString()), - ]; - } while ($error = $error->getPrevious()); - } - - return json_encode($json, JSON_PRETTY_PRINT); - } - - /** - * Render XML error - * - * @param \Throwable $error - * - * @return string - */ - protected function renderXmlErrorMessage(\Throwable $error) - { - $xml = "\n Slim Application Error\n"; - if ($this->displayErrorDetails) { - do { - $xml .= " \n"; - $xml .= " " . get_class($error) . "\n"; - $xml .= " " . $error->getCode() . "\n"; - $xml .= " " . $this->createCdataSection($error->getMessage()) . "\n"; - $xml .= " " . $error->getFile() . "\n"; - $xml .= " " . $error->getLine() . "\n"; - $xml .= " " . $this->createCdataSection($error->getTraceAsString()) . "\n"; - $xml .= " \n"; - } while ($error = $error->getPrevious()); - } - $xml .= ""; - - return $xml; - } - - /** - * Returns a CDATA section with the given content. - * - * @param string $content - * @return string - */ - private function createCdataSection($content) - { - return sprintf('', str_replace(']]>', ']]]]>', $content)); - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php deleted file mode 100644 index 157bdebee94..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php +++ /dev/null @@ -1,43 +0,0 @@ - $v) { - $request = $request->withAttribute($k, $v); - } - - return call_user_func($callable, $request, $response, $routeArguments); - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php deleted file mode 100644 index 11793d36e40..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php +++ /dev/null @@ -1,42 +0,0 @@ - '', - 'domain' => null, - 'hostonly' => null, - 'path' => null, - 'expires' => null, - 'secure' => false, - 'httponly' => false - ]; - - /** - * Create new cookies helper - * - * @param array $cookies - */ - public function __construct(array $cookies = []) - { - $this->requestCookies = $cookies; - } - - /** - * Set default cookie properties - * - * @param array $settings - */ - public function setDefaults(array $settings) - { - $this->defaults = array_replace($this->defaults, $settings); - } - - /** - * Get request cookie - * - * @param string $name Cookie name - * @param mixed $default Cookie default value - * - * @return mixed Cookie value if present, else default - */ - public function get($name, $default = null) - { - return isset($this->requestCookies[$name]) ? $this->requestCookies[$name] : $default; - } - - /** - * Set response cookie - * - * @param string $name Cookie name - * @param string|array $value Cookie value, or cookie properties - */ - public function set($name, $value) - { - if (!is_array($value)) { - $value = ['value' => (string)$value]; - } - $this->responseCookies[$name] = array_replace($this->defaults, $value); - } - - /** - * Convert to `Set-Cookie` headers - * - * @return string[] - */ - public function toHeaders() - { - $headers = []; - foreach ($this->responseCookies as $name => $properties) { - $headers[] = $this->toHeader($name, $properties); - } - - return $headers; - } - - /** - * Convert to `Set-Cookie` header - * - * @param string $name Cookie name - * @param array $properties Cookie properties - * - * @return string - */ - protected function toHeader($name, array $properties) - { - $result = urlencode($name) . '=' . urlencode($properties['value']); - - if (isset($properties['domain'])) { - $result .= '; domain=' . $properties['domain']; - } - - if (isset($properties['path'])) { - $result .= '; path=' . $properties['path']; - } - - if (isset($properties['expires'])) { - if (is_string($properties['expires'])) { - $timestamp = strtotime($properties['expires']); - } else { - $timestamp = (int)$properties['expires']; - } - if ($timestamp !== 0) { - $result .= '; expires=' . gmdate('D, d-M-Y H:i:s e', $timestamp); - } - } - - if (isset($properties['secure']) && $properties['secure']) { - $result .= '; secure'; - } - - if (isset($properties['hostonly']) && $properties['hostonly']) { - $result .= '; HostOnly'; - } - - if (isset($properties['httponly']) && $properties['httponly']) { - $result .= '; HttpOnly'; - } - - return $result; - } - - /** - * Parse HTTP request `Cookie:` header and extract - * into a PHP associative array. - * - * @param string $header The raw HTTP request `Cookie:` header - * - * @return array Associative array of cookie names and values - * - * @throws InvalidArgumentException if the cookie data cannot be parsed - */ - public static function parseHeader($header) - { - if (is_array($header) === true) { - $header = isset($header[0]) ? $header[0] : ''; - } - - if (is_string($header) === false) { - throw new InvalidArgumentException('Cannot parse Cookie data. Header value must be a string.'); - } - - $header = rtrim($header, "\r\n"); - $pieces = preg_split('@\s*[;,]\s*@', $header); - $cookies = []; - - foreach ($pieces as $cookie) { - $cookie = explode('=', $cookie, 2); - - if (count($cookie) === 2) { - $key = urldecode($cookie[0]); - $value = urldecode($cookie[1]); - - if (!isset($cookies[$key])) { - $cookies[$key] = $value; - } - } - } - - return $cookies; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Environment.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Environment.php deleted file mode 100644 index a106fa8b877..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Environment.php +++ /dev/null @@ -1,52 +0,0 @@ - 'HTTP/1.1', - 'REQUEST_METHOD' => 'GET', - 'SCRIPT_NAME' => '', - 'REQUEST_URI' => '', - 'QUERY_STRING' => '', - 'SERVER_NAME' => 'localhost', - 'SERVER_PORT' => 80, - 'HTTP_HOST' => 'localhost', - 'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', - 'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.8', - 'HTTP_ACCEPT_CHARSET' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', - 'HTTP_USER_AGENT' => 'Slim Framework', - 'REMOTE_ADDR' => '127.0.0.1', - 'REQUEST_TIME' => time(), - 'REQUEST_TIME_FLOAT' => microtime(true), - ], $userData); - - return new static($data); - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Headers.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Headers.php deleted file mode 100644 index 4aa7a5e4de0..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Headers.php +++ /dev/null @@ -1,222 +0,0 @@ - 1, - 'CONTENT_LENGTH' => 1, - 'PHP_AUTH_USER' => 1, - 'PHP_AUTH_PW' => 1, - 'PHP_AUTH_DIGEST' => 1, - 'AUTH_TYPE' => 1, - ]; - - /** - * Create new headers collection with data extracted from - * the application Environment object - * - * @param Environment $environment The Slim application Environment - * - * @return self - */ - public static function createFromEnvironment(Environment $environment) - { - $data = []; - $environment = self::determineAuthorization($environment); - foreach ($environment as $key => $value) { - $key = strtoupper($key); - if (isset(static::$special[$key]) || strpos($key, 'HTTP_') === 0) { - if ($key !== 'HTTP_CONTENT_LENGTH') { - $data[$key] = $value; - } - } - } - - return new static($data); - } - - /** - * If HTTP_AUTHORIZATION does not exist tries to get it from - * getallheaders() when available. - * - * @param Environment $environment The Slim application Environment - * - * @return Environment - */ - - public static function determineAuthorization(Environment $environment) - { - $authorization = $environment->get('HTTP_AUTHORIZATION'); - - if (null === $authorization && is_callable('getallheaders')) { - $headers = getallheaders(); - $headers = array_change_key_case($headers, CASE_LOWER); - if (isset($headers['authorization'])) { - $environment->set('HTTP_AUTHORIZATION', $headers['authorization']); - } - } - - return $environment; - } - - /** - * Return array of HTTP header names and values. - * This method returns the _original_ header name - * as specified by the end user. - * - * @return array - */ - public function all() - { - $all = parent::all(); - $out = []; - foreach ($all as $key => $props) { - $out[$props['originalKey']] = $props['value']; - } - - return $out; - } - - /** - * Set HTTP header value - * - * This method sets a header value. It replaces - * any values that may already exist for the header name. - * - * @param string $key The case-insensitive header name - * @param string $value The header value - */ - public function set($key, $value) - { - if (!is_array($value)) { - $value = [$value]; - } - parent::set($this->normalizeKey($key), [ - 'value' => $value, - 'originalKey' => $key - ]); - } - - /** - * Get HTTP header value - * - * @param string $key The case-insensitive header name - * @param mixed $default The default value if key does not exist - * - * @return string[] - */ - public function get($key, $default = null) - { - if ($this->has($key)) { - return parent::get($this->normalizeKey($key))['value']; - } - - return $default; - } - - /** - * Get HTTP header key as originally specified - * - * @param string $key The case-insensitive header name - * @param mixed $default The default value if key does not exist - * - * @return string - */ - public function getOriginalKey($key, $default = null) - { - if ($this->has($key)) { - return parent::get($this->normalizeKey($key))['originalKey']; - } - - return $default; - } - - /** - * Add HTTP header value - * - * This method appends a header value. Unlike the set() method, - * this method _appends_ this new value to any values - * that already exist for this header name. - * - * @param string $key The case-insensitive header name - * @param array|string $value The new header value(s) - */ - public function add($key, $value) - { - $oldValues = $this->get($key, []); - $newValues = is_array($value) ? $value : [$value]; - $this->set($key, array_merge($oldValues, array_values($newValues))); - } - - /** - * Does this collection have a given header? - * - * @param string $key The case-insensitive header name - * - * @return bool - */ - public function has($key) - { - return parent::has($this->normalizeKey($key)); - } - - /** - * Remove header from collection - * - * @param string $key The case-insensitive header name - */ - public function remove($key) - { - parent::remove($this->normalizeKey($key)); - } - - /** - * Normalize header name - * - * This method transforms header names into a - * normalized form. This is how we enable case-insensitive - * header names in the other methods in this class. - * - * @param string $key The case-insensitive header name - * - * @return string Normalized header name - */ - public function normalizeKey($key) - { - $key = strtr(strtolower($key), '_', '-'); - if (strpos($key, 'http-') === 0) { - $key = substr($key, 5); - } - - return $key; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Message.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Message.php deleted file mode 100644 index d0e832d695f..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Message.php +++ /dev/null @@ -1,295 +0,0 @@ -protocolVersion; - } - - /** - * Return an instance with the specified HTTP protocol version. - * - * The version string MUST contain only the HTTP version number (e.g., - * "1.1", "1.0"). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new protocol version. - * - * @param string $version HTTP protocol version - * @return static - * @throws InvalidArgumentException if the http version is an invalid number - */ - public function withProtocolVersion($version) - { - static $valid = [ - '1.0' => true, - '1.1' => true, - '2.0' => true, - ]; - if (!isset($valid[$version])) { - throw new InvalidArgumentException('Invalid HTTP version. Must be one of: 1.0, 1.1, 2.0'); - } - $clone = clone $this; - $clone->protocolVersion = $version; - - return $clone; - } - - /******************************************************************************* - * Headers - ******************************************************************************/ - - /** - * Retrieves all message header values. - * - * The keys represent the header name as it will be sent over the wire, and - * each value is an array of strings associated with the header. - * - * // Represent the headers as a string - * foreach ($message->getHeaders() as $name => $values) { - * echo $name . ": " . implode(", ", $values); - * } - * - * // Emit headers iteratively: - * foreach ($message->getHeaders() as $name => $values) { - * foreach ($values as $value) { - * header(sprintf('%s: %s', $name, $value), false); - * } - * } - * - * While header names are not case-sensitive, getHeaders() will preserve the - * exact case in which headers were originally specified. - * - * @return array Returns an associative array of the message's headers. Each - * key MUST be a header name, and each value MUST be an array of strings - * for that header. - */ - public function getHeaders() - { - return $this->headers->all(); - } - - /** - * Checks if a header exists by the given case-insensitive name. - * - * @param string $name Case-insensitive header field name. - * @return bool Returns true if any header names match the given header - * name using a case-insensitive string comparison. Returns false if - * no matching header name is found in the message. - */ - public function hasHeader($name) - { - return $this->headers->has($name); - } - - /** - * Retrieves a message header value by the given case-insensitive name. - * - * This method returns an array of all the header values of the given - * case-insensitive header name. - * - * If the header does not appear in the message, this method MUST return an - * empty array. - * - * @param string $name Case-insensitive header field name. - * @return string[] An array of string values as provided for the given - * header. If the header does not appear in the message, this method MUST - * return an empty array. - */ - public function getHeader($name) - { - return $this->headers->get($name, []); - } - - /** - * Retrieves a comma-separated string of the values for a single header. - * - * This method returns all of the header values of the given - * case-insensitive header name as a string concatenated together using - * a comma. - * - * NOTE: Not all header values may be appropriately represented using - * comma concatenation. For such headers, use getHeader() instead - * and supply your own delimiter when concatenating. - * - * If the header does not appear in the message, this method MUST return - * an empty string. - * - * @param string $name Case-insensitive header field name. - * @return string A string of values as provided for the given header - * concatenated together using a comma. If the header does not appear in - * the message, this method MUST return an empty string. - */ - public function getHeaderLine($name) - { - return implode(',', $this->headers->get($name, [])); - } - - /** - * Return an instance with the provided value replacing the specified header. - * - * While header names are case-insensitive, the casing of the header will - * be preserved by this function, and returned from getHeaders(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new and/or updated header and value. - * - * @param string $name Case-insensitive header field name. - * @param string|string[] $value Header value(s). - * @return static - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withHeader($name, $value) - { - $clone = clone $this; - $clone->headers->set($name, $value); - - return $clone; - } - - /** - * Return an instance with the specified header appended with the given value. - * - * Existing values for the specified header will be maintained. The new - * value(s) will be appended to the existing list. If the header did not - * exist previously, it will be added. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new header and/or value. - * - * @param string $name Case-insensitive header field name to add. - * @param string|string[] $value Header value(s). - * @return static - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withAddedHeader($name, $value) - { - $clone = clone $this; - $clone->headers->add($name, $value); - - return $clone; - } - - /** - * Return an instance without the specified header. - * - * Header resolution MUST be done without case-sensitivity. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the named header. - * - * @param string $name Case-insensitive header field name to remove. - * @return static - */ - public function withoutHeader($name) - { - $clone = clone $this; - $clone->headers->remove($name); - - return $clone; - } - - /******************************************************************************* - * Body - ******************************************************************************/ - - /** - * Gets the body of the message. - * - * @return StreamInterface Returns the body as a stream. - */ - public function getBody() - { - return $this->body; - } - - /** - * Return an instance with the specified message body. - * - * The body MUST be a StreamInterface object. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return a new instance that has the - * new body stream. - * - * @param StreamInterface $body Body. - * @return static - * @throws \InvalidArgumentException When the body is not valid. - */ - public function withBody(StreamInterface $body) - { - // TODO: Test for invalid body? - $clone = clone $this; - $clone->body = $body; - - return $clone; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Request.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Request.php deleted file mode 100644 index 7d5b185dcd8..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Request.php +++ /dev/null @@ -1,1156 +0,0 @@ - 1, - 'DELETE' => 1, - 'GET' => 1, - 'HEAD' => 1, - 'OPTIONS' => 1, - 'PATCH' => 1, - 'POST' => 1, - 'PUT' => 1, - 'TRACE' => 1, - ]; - - /** - * Create new HTTP request with data extracted from the application - * Environment object - * - * @param Environment $environment The Slim application Environment - * - * @return self - */ - public static function createFromEnvironment(Environment $environment) - { - $method = $environment['REQUEST_METHOD']; - $uri = Uri::createFromEnvironment($environment); - $headers = Headers::createFromEnvironment($environment); - $cookies = Cookies::parseHeader($headers->get('Cookie', [])); - $serverParams = $environment->all(); - $body = new RequestBody(); - $uploadedFiles = UploadedFile::createFromEnvironment($environment); - - $request = new static($method, $uri, $headers, $cookies, $serverParams, $body, $uploadedFiles); - - if ($method === 'POST' && - in_array($request->getMediaType(), ['application/x-www-form-urlencoded', 'multipart/form-data']) - ) { - // parsed body must be $_POST - $request = $request->withParsedBody($_POST); - } - return $request; - } - - /** - * Create new HTTP request. - * - * Adds a host header when none was provided and a host is defined in uri. - * - * @param string $method The request method - * @param UriInterface $uri The request URI object - * @param HeadersInterface $headers The request headers collection - * @param array $cookies The request cookies collection - * @param array $serverParams The server environment variables - * @param StreamInterface $body The request body object - * @param array $uploadedFiles The request uploadedFiles collection - */ - public function __construct( - $method, - UriInterface $uri, - HeadersInterface $headers, - array $cookies, - array $serverParams, - StreamInterface $body, - array $uploadedFiles = [] - ) { - $this->originalMethod = $this->filterMethod($method); - $this->uri = $uri; - $this->headers = $headers; - $this->cookies = $cookies; - $this->serverParams = $serverParams; - $this->attributes = new Collection(); - $this->body = $body; - $this->uploadedFiles = $uploadedFiles; - - if (isset($serverParams['SERVER_PROTOCOL'])) { - $this->protocolVersion = str_replace('HTTP/', '', $serverParams['SERVER_PROTOCOL']); - } - - if (!$this->headers->has('Host') || $this->uri->getHost() !== '') { - $this->headers->set('Host', $this->uri->getHost()); - } - - $this->registerMediaTypeParser('application/json', function ($input) { - return json_decode($input, true); - }); - - $this->registerMediaTypeParser('application/xml', function ($input) { - $backup = libxml_disable_entity_loader(true); - $result = simplexml_load_string($input); - libxml_disable_entity_loader($backup); - return $result; - }); - - $this->registerMediaTypeParser('text/xml', function ($input) { - $backup = libxml_disable_entity_loader(true); - $result = simplexml_load_string($input); - libxml_disable_entity_loader($backup); - return $result; - }); - - $this->registerMediaTypeParser('application/x-www-form-urlencoded', function ($input) { - parse_str($input, $data); - return $data; - }); - } - - /** - * This method is applied to the cloned object - * after PHP performs an initial shallow-copy. This - * method completes a deep-copy by creating new objects - * for the cloned object's internal reference pointers. - */ - public function __clone() - { - $this->headers = clone $this->headers; - $this->attributes = clone $this->attributes; - $this->body = clone $this->body; - } - - /******************************************************************************* - * Method - ******************************************************************************/ - - /** - * Retrieves the HTTP method of the request. - * - * @return string Returns the request method. - */ - public function getMethod() - { - if ($this->method === null) { - $this->method = $this->originalMethod; - $customMethod = $this->getHeaderLine('X-Http-Method-Override'); - - if ($customMethod) { - $this->method = $this->filterMethod($customMethod); - } elseif ($this->originalMethod === 'POST') { - $body = $this->getParsedBody(); - - if (is_object($body) && property_exists($body, '_METHOD')) { - $this->method = $this->filterMethod((string)$body->_METHOD); - } elseif (is_array($body) && isset($body['_METHOD'])) { - $this->method = $this->filterMethod((string)$body['_METHOD']); - } - - if ($this->getBody()->eof()) { - $this->getBody()->rewind(); - } - } - } - - return $this->method; - } - - /** - * Get the original HTTP method (ignore override). - * - * Note: This method is not part of the PSR-7 standard. - * - * @return string - */ - public function getOriginalMethod() - { - return $this->originalMethod; - } - - /** - * Return an instance with the provided HTTP method. - * - * While HTTP method names are typically all uppercase characters, HTTP - * method names are case-sensitive and thus implementations SHOULD NOT - * modify the given string. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * changed request method. - * - * @param string $method Case-sensitive method. - * @return self - * @throws \InvalidArgumentException for invalid HTTP methods. - */ - public function withMethod($method) - { - $method = $this->filterMethod($method); - $clone = clone $this; - $clone->originalMethod = $method; - $clone->method = $method; - - return $clone; - } - - /** - * Validate the HTTP method - * - * @param null|string $method - * @return null|string - * @throws \InvalidArgumentException on invalid HTTP method. - */ - protected function filterMethod($method) - { - if ($method === null) { - return $method; - } - - if (!is_string($method)) { - throw new InvalidArgumentException(sprintf( - 'Unsupported HTTP method; must be a string, received %s', - (is_object($method) ? get_class($method) : gettype($method)) - )); - } - - $method = strtoupper($method); - if (!isset($this->validMethods[$method])) { - throw new InvalidArgumentException(sprintf( - 'Unsupported HTTP method "%s" provided', - $method - )); - } - - return $method; - } - - /** - * Does this request use a given method? - * - * Note: This method is not part of the PSR-7 standard. - * - * @param string $method HTTP method - * @return bool - */ - public function isMethod($method) - { - return $this->getMethod() === $method; - } - - /** - * Is this a GET request? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isGet() - { - return $this->isMethod('GET'); - } - - /** - * Is this a POST request? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isPost() - { - return $this->isMethod('POST'); - } - - /** - * Is this a PUT request? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isPut() - { - return $this->isMethod('PUT'); - } - - /** - * Is this a PATCH request? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isPatch() - { - return $this->isMethod('PATCH'); - } - - /** - * Is this a DELETE request? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isDelete() - { - return $this->isMethod('DELETE'); - } - - /** - * Is this a HEAD request? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isHead() - { - return $this->isMethod('HEAD'); - } - - /** - * Is this a OPTIONS request? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isOptions() - { - return $this->isMethod('OPTIONS'); - } - - /** - * Is this an XHR request? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isXhr() - { - return $this->getHeaderLine('X-Requested-With') === 'XMLHttpRequest'; - } - - /******************************************************************************* - * URI - ******************************************************************************/ - - /** - * Retrieves the message's request target. - * - * Retrieves the message's request-target either as it will appear (for - * clients), as it appeared at request (for servers), or as it was - * specified for the instance (see withRequestTarget()). - * - * In most cases, this will be the origin-form of the composed URI, - * unless a value was provided to the concrete implementation (see - * withRequestTarget() below). - * - * If no URI is available, and no request-target has been specifically - * provided, this method MUST return the string "/". - * - * @return string - */ - public function getRequestTarget() - { - if ($this->requestTarget) { - return $this->requestTarget; - } - - if ($this->uri === null) { - return '/'; - } - - $basePath = $this->uri->getBasePath(); - $path = $this->uri->getPath(); - $path = $basePath . '/' . ltrim($path, '/'); - - $query = $this->uri->getQuery(); - if ($query) { - $path .= '?' . $query; - } - $this->requestTarget = $path; - - return $this->requestTarget; - } - - /** - * Return an instance with the specific request-target. - * - * If the request needs a non-origin-form request-target — e.g., for - * specifying an absolute-form, authority-form, or asterisk-form — - * this method may be used to create an instance with the specified - * request-target, verbatim. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * changed request target. - * - * @link http://tools.ietf.org/html/rfc7230#section-2.7 (for the various - * request-target forms allowed in request messages) - * @param mixed $requestTarget - * @return self - * @throws InvalidArgumentException if the request target is invalid - */ - public function withRequestTarget($requestTarget) - { - if (preg_match('#\s#', $requestTarget)) { - throw new InvalidArgumentException( - 'Invalid request target provided; must be a string and cannot contain whitespace' - ); - } - $clone = clone $this; - $clone->requestTarget = $requestTarget; - - return $clone; - } - - /** - * Retrieves the URI instance. - * - * This method MUST return a UriInterface instance. - * - * @link http://tools.ietf.org/html/rfc3986#section-4.3 - * @return UriInterface Returns a UriInterface instance - * representing the URI of the request. - */ - public function getUri() - { - return $this->uri; - } - - /** - * Returns an instance with the provided URI. - * - * This method MUST update the Host header of the returned request by - * default if the URI contains a host component. If the URI does not - * contain a host component, any pre-existing Host header MUST be carried - * over to the returned request. - * - * You can opt-in to preserving the original state of the Host header by - * setting `$preserveHost` to `true`. When `$preserveHost` is set to - * `true`, this method interacts with the Host header in the following ways: - * - * - If the the Host header is missing or empty, and the new URI contains - * a host component, this method MUST update the Host header in the returned - * request. - * - If the Host header is missing or empty, and the new URI does not contain a - * host component, this method MUST NOT update the Host header in the returned - * request. - * - If a Host header is present and non-empty, this method MUST NOT update - * the Host header in the returned request. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new UriInterface instance. - * - * @link http://tools.ietf.org/html/rfc3986#section-4.3 - * @param UriInterface $uri New request URI to use. - * @param bool $preserveHost Preserve the original state of the Host header. - * @return self - */ - public function withUri(UriInterface $uri, $preserveHost = false) - { - $clone = clone $this; - $clone->uri = $uri; - - if (!$preserveHost) { - if ($uri->getHost() !== '') { - $clone->headers->set('Host', $uri->getHost()); - } - } else { - if ($this->uri->getHost() !== '' && (!$this->hasHeader('Host') || $this->getHeader('Host') === null)) { - $clone->headers->set('Host', $uri->getHost()); - } - } - - return $clone; - } - - /** - * Get request content type. - * - * Note: This method is not part of the PSR-7 standard. - * - * @return string|null The request content type, if known - */ - public function getContentType() - { - $result = $this->getHeader('Content-Type'); - - return $result ? $result[0] : null; - } - - /** - * Get request media type, if known. - * - * Note: This method is not part of the PSR-7 standard. - * - * @return string|null The request media type, minus content-type params - */ - public function getMediaType() - { - $contentType = $this->getContentType(); - if ($contentType) { - $contentTypeParts = preg_split('/\s*[;,]\s*/', $contentType); - - return strtolower($contentTypeParts[0]); - } - - return null; - } - - /** - * Get request media type params, if known. - * - * Note: This method is not part of the PSR-7 standard. - * - * @return array - */ - public function getMediaTypeParams() - { - $contentType = $this->getContentType(); - $contentTypeParams = []; - if ($contentType) { - $contentTypeParts = preg_split('/\s*[;,]\s*/', $contentType); - $contentTypePartsLength = count($contentTypeParts); - for ($i = 1; $i < $contentTypePartsLength; $i++) { - $paramParts = explode('=', $contentTypeParts[$i]); - $contentTypeParams[strtolower($paramParts[0])] = $paramParts[1]; - } - } - - return $contentTypeParams; - } - - /** - * Get request content character set, if known. - * - * Note: This method is not part of the PSR-7 standard. - * - * @return string|null - */ - public function getContentCharset() - { - $mediaTypeParams = $this->getMediaTypeParams(); - if (isset($mediaTypeParams['charset'])) { - return $mediaTypeParams['charset']; - } - - return null; - } - - /** - * Get request content length, if known. - * - * Note: This method is not part of the PSR-7 standard. - * - * @return int|null - */ - public function getContentLength() - { - $result = $this->headers->get('Content-Length'); - - return $result ? (int)$result[0] : null; - } - - /******************************************************************************* - * Cookies - ******************************************************************************/ - - /** - * Retrieve cookies. - * - * Retrieves cookies sent by the client to the server. - * - * The data MUST be compatible with the structure of the $_COOKIE - * superglobal. - * - * @return array - */ - public function getCookieParams() - { - return $this->cookies; - } - - /** - * Return an instance with the specified cookies. - * - * The data IS NOT REQUIRED to come from the $_COOKIE superglobal, but MUST - * be compatible with the structure of $_COOKIE. Typically, this data will - * be injected at instantiation. - * - * This method MUST NOT update the related Cookie header of the request - * instance, nor related values in the server params. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated cookie values. - * - * @param array $cookies Array of key/value pairs representing cookies. - * @return self - */ - public function withCookieParams(array $cookies) - { - $clone = clone $this; - $clone->cookies = $cookies; - - return $clone; - } - - /******************************************************************************* - * Query Params - ******************************************************************************/ - - /** - * Retrieve query string arguments. - * - * Retrieves the deserialized query string arguments, if any. - * - * Note: the query params might not be in sync with the URI or server - * params. If you need to ensure you are only getting the original - * values, you may need to parse the query string from `getUri()->getQuery()` - * or from the `QUERY_STRING` server param. - * - * @return array - */ - public function getQueryParams() - { - if (is_array($this->queryParams)) { - return $this->queryParams; - } - - if ($this->uri === null) { - return []; - } - - parse_str($this->uri->getQuery(), $this->queryParams); // <-- URL decodes data - - return $this->queryParams; - } - - /** - * Return an instance with the specified query string arguments. - * - * These values SHOULD remain immutable over the course of the incoming - * request. They MAY be injected during instantiation, such as from PHP's - * $_GET superglobal, or MAY be derived from some other value such as the - * URI. In cases where the arguments are parsed from the URI, the data - * MUST be compatible with what PHP's parse_str() would return for - * purposes of how duplicate query parameters are handled, and how nested - * sets are handled. - * - * Setting query string arguments MUST NOT change the URI stored by the - * request, nor the values in the server params. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated query string arguments. - * - * @param array $query Array of query string arguments, typically from - * $_GET. - * @return self - */ - public function withQueryParams(array $query) - { - $clone = clone $this; - $clone->queryParams = $query; - - return $clone; - } - - /******************************************************************************* - * File Params - ******************************************************************************/ - - /** - * Retrieve normalized file upload data. - * - * This method returns upload metadata in a normalized tree, with each leaf - * an instance of Psr\Http\Message\UploadedFileInterface. - * - * These values MAY be prepared from $_FILES or the message body during - * instantiation, or MAY be injected via withUploadedFiles(). - * - * @return array An array tree of UploadedFileInterface instances; an empty - * array MUST be returned if no data is present. - */ - public function getUploadedFiles() - { - return $this->uploadedFiles; - } - - /** - * Create a new instance with the specified uploaded files. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param array $uploadedFiles An array tree of UploadedFileInterface instances. - * @return self - * @throws \InvalidArgumentException if an invalid structure is provided. - */ - public function withUploadedFiles(array $uploadedFiles) - { - $clone = clone $this; - $clone->uploadedFiles = $uploadedFiles; - - return $clone; - } - - /******************************************************************************* - * Server Params - ******************************************************************************/ - - /** - * Retrieve server parameters. - * - * Retrieves data related to the incoming request environment, - * typically derived from PHP's $_SERVER superglobal. The data IS NOT - * REQUIRED to originate from $_SERVER. - * - * @return array - */ - public function getServerParams() - { - return $this->serverParams; - } - - /******************************************************************************* - * Attributes - ******************************************************************************/ - - /** - * Retrieve attributes derived from the request. - * - * The request "attributes" may be used to allow injection of any - * parameters derived from the request: e.g., the results of path - * match operations; the results of decrypting cookies; the results of - * deserializing non-form-encoded message bodies; etc. Attributes - * will be application and request specific, and CAN be mutable. - * - * @return array Attributes derived from the request. - */ - public function getAttributes() - { - return $this->attributes->all(); - } - - /** - * Retrieve a single derived request attribute. - * - * Retrieves a single derived request attribute as described in - * getAttributes(). If the attribute has not been previously set, returns - * the default value as provided. - * - * This method obviates the need for a hasAttribute() method, as it allows - * specifying a default value to return if the attribute is not found. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $default Default value to return if the attribute does not exist. - * @return mixed - */ - public function getAttribute($name, $default = null) - { - return $this->attributes->get($name, $default); - } - - /** - * Return an instance with the specified derived request attribute. - * - * This method allows setting a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $value The value of the attribute. - * @return self - */ - public function withAttribute($name, $value) - { - $clone = clone $this; - $clone->attributes->set($name, $value); - - return $clone; - } - - /** - * Create a new instance with the specified derived request attributes. - * - * Note: This method is not part of the PSR-7 standard. - * - * This method allows setting all new derived request attributes as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return a new instance that has the - * updated attributes. - * - * @param array $attributes New attributes - * @return self - */ - public function withAttributes(array $attributes) - { - $clone = clone $this; - $clone->attributes = new Collection($attributes); - - return $clone; - } - - /** - * Return an instance that removes the specified derived request attribute. - * - * This method allows removing a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @return self - */ - public function withoutAttribute($name) - { - $clone = clone $this; - $clone->attributes->remove($name); - - return $clone; - } - - /******************************************************************************* - * Body - ******************************************************************************/ - - /** - * Retrieve any parameters provided in the request body. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, this method MUST - * return the contents of $_POST. - * - * Otherwise, this method may return any results of deserializing - * the request body content; as parsing returns structured content, the - * potential types MUST be arrays or objects only. A null value indicates - * the absence of body content. - * - * @return null|array|object The deserialized body parameters, if any. - * These will typically be an array or object. - * @throws RuntimeException if the request body media type parser returns an invalid value - */ - public function getParsedBody() - { - if ($this->bodyParsed !== false) { - return $this->bodyParsed; - } - - if (!$this->body) { - return null; - } - - $mediaType = $this->getMediaType(); - - // look for a media type with a structured syntax suffix (RFC 6839) - $parts = explode('+', $mediaType); - if (count($parts) >= 2) { - $mediaType = 'application/' . $parts[count($parts)-1]; - } - - if (isset($this->bodyParsers[$mediaType]) === true) { - $body = (string)$this->getBody(); - $parsed = $this->bodyParsers[$mediaType]($body); - - if (!is_null($parsed) && !is_object($parsed) && !is_array($parsed)) { - throw new RuntimeException( - 'Request body media type parser return value must be an array, an object, or null' - ); - } - $this->bodyParsed = $parsed; - return $this->bodyParsed; - } - - return null; - } - - /** - * Return an instance with the specified body parameters. - * - * These MAY be injected during instantiation. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, use this method - * ONLY to inject the contents of $_POST. - * - * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of - * deserializing the request body content. Deserialization/parsing returns - * structured data, and, as such, this method ONLY accepts arrays or objects, - * or a null value if nothing was available to parse. - * - * As an example, if content negotiation determines that the request data - * is a JSON payload, this method could be used to create a request - * instance with the deserialized parameters. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param null|array|object $data The deserialized body data. This will - * typically be in an array or object. - * @return self - * @throws \InvalidArgumentException if an unsupported argument type is - * provided. - */ - public function withParsedBody($data) - { - if (!is_null($data) && !is_object($data) && !is_array($data)) { - throw new InvalidArgumentException('Parsed body value must be an array, an object, or null'); - } - - $clone = clone $this; - $clone->bodyParsed = $data; - - return $clone; - } - - /** - * Force Body to be parsed again. - * - * Note: This method is not part of the PSR-7 standard. - * - * @return self - */ - public function reparseBody() - { - $this->bodyParsed = false; - - return $this; - } - - /** - * Register media type parser. - * - * Note: This method is not part of the PSR-7 standard. - * - * @param string $mediaType A HTTP media type (excluding content-type - * params). - * @param callable $callable A callable that returns parsed contents for - * media type. - */ - public function registerMediaTypeParser($mediaType, callable $callable) - { - if ($callable instanceof Closure) { - $callable = $callable->bindTo($this); - } - $this->bodyParsers[(string)$mediaType] = $callable; - } - - /******************************************************************************* - * Parameters (e.g., POST and GET data) - ******************************************************************************/ - - /** - * Fetch request parameter value from body or query string (in that order). - * - * Note: This method is not part of the PSR-7 standard. - * - * @param string $key The parameter key. - * @param string $default The default value. - * - * @return mixed The parameter value. - */ - public function getParam($key, $default = null) - { - $postParams = $this->getParsedBody(); - $getParams = $this->getQueryParams(); - $result = $default; - if (is_array($postParams) && isset($postParams[$key])) { - $result = $postParams[$key]; - } elseif (is_object($postParams) && property_exists($postParams, $key)) { - $result = $postParams->$key; - } elseif (isset($getParams[$key])) { - $result = $getParams[$key]; - } - - return $result; - } - - /** - * Fetch parameter value from request body. - * - * Note: This method is not part of the PSR-7 standard. - * - * @param $key - * @param null $default - * - * @return null - */ - public function getParsedBodyParam($key, $default = null) - { - $postParams = $this->getParsedBody(); - $result = $default; - if (is_array($postParams) && isset($postParams[$key])) { - $result = $postParams[$key]; - } elseif (is_object($postParams) && property_exists($postParams, $key)) { - $result = $postParams->$key; - } - - return $result; - } - - /** - * Fetch parameter value from query string. - * - * Note: This method is not part of the PSR-7 standard. - * - * @param $key - * @param null $default - * - * @return null - */ - public function getQueryParam($key, $default = null) - { - $getParams = $this->getQueryParams(); - $result = $default; - if (isset($getParams[$key])) { - $result = $getParams[$key]; - } - - return $result; - } - - /** - * Fetch assocative array of body and query string parameters. - * - * Note: This method is not part of the PSR-7 standard. - * - * @return array - */ - public function getParams() - { - $params = $this->getQueryParams(); - $postParams = $this->getParsedBody(); - if ($postParams) { - $params = array_merge($params, (array)$postParams); - } - - return $params; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/RequestBody.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/RequestBody.php deleted file mode 100644 index 2345fe4354c..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/RequestBody.php +++ /dev/null @@ -1,27 +0,0 @@ - 'Continue', - 101 => 'Switching Protocols', - 102 => 'Processing', - //Successful 2xx - 200 => 'OK', - 201 => 'Created', - 202 => 'Accepted', - 203 => 'Non-Authoritative Information', - 204 => 'No Content', - 205 => 'Reset Content', - 206 => 'Partial Content', - 207 => 'Multi-Status', - 208 => 'Already Reported', - 226 => 'IM Used', - //Redirection 3xx - 300 => 'Multiple Choices', - 301 => 'Moved Permanently', - 302 => 'Found', - 303 => 'See Other', - 304 => 'Not Modified', - 305 => 'Use Proxy', - 306 => '(Unused)', - 307 => 'Temporary Redirect', - 308 => 'Permanent Redirect', - //Client Error 4xx - 400 => 'Bad Request', - 401 => 'Unauthorized', - 402 => 'Payment Required', - 403 => 'Forbidden', - 404 => 'Not Found', - 405 => 'Method Not Allowed', - 406 => 'Not Acceptable', - 407 => 'Proxy Authentication Required', - 408 => 'Request Timeout', - 409 => 'Conflict', - 410 => 'Gone', - 411 => 'Length Required', - 412 => 'Precondition Failed', - 413 => 'Request Entity Too Large', - 414 => 'Request-URI Too Long', - 415 => 'Unsupported Media Type', - 416 => 'Requested Range Not Satisfiable', - 417 => 'Expectation Failed', - 418 => 'I\'m a teapot', - 422 => 'Unprocessable Entity', - 423 => 'Locked', - 424 => 'Failed Dependency', - 426 => 'Upgrade Required', - 428 => 'Precondition Required', - 429 => 'Too Many Requests', - 431 => 'Request Header Fields Too Large', - 451 => 'Unavailable For Legal Reasons', - //Server Error 5xx - 500 => 'Internal Server Error', - 501 => 'Not Implemented', - 502 => 'Bad Gateway', - 503 => 'Service Unavailable', - 504 => 'Gateway Timeout', - 505 => 'HTTP Version Not Supported', - 506 => 'Variant Also Negotiates', - 507 => 'Insufficient Storage', - 508 => 'Loop Detected', - 510 => 'Not Extended', - 511 => 'Network Authentication Required', - ]; - - /** - * Create new HTTP response. - * - * @param int $status The response status code. - * @param HeadersInterface|null $headers The response headers. - * @param StreamInterface|null $body The response body. - */ - public function __construct($status = 200, HeadersInterface $headers = null, StreamInterface $body = null) - { - $this->status = $this->filterStatus($status); - $this->headers = $headers ? $headers : new Headers(); - $this->body = $body ? $body : new Body(fopen('php://temp', 'r+')); - } - - /** - * This method is applied to the cloned object - * after PHP performs an initial shallow-copy. This - * method completes a deep-copy by creating new objects - * for the cloned object's internal reference pointers. - */ - public function __clone() - { - $this->headers = clone $this->headers; - } - - /******************************************************************************* - * Status - ******************************************************************************/ - - /** - * Gets the response status code. - * - * The status code is a 3-digit integer result code of the server's attempt - * to understand and satisfy the request. - * - * @return int Status code. - */ - public function getStatusCode() - { - return $this->status; - } - - /** - * Return an instance with the specified status code and, optionally, reason phrase. - * - * If no reason phrase is specified, implementations MAY choose to default - * to the RFC 7231 or IANA recommended reason phrase for the response's - * status code. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated status and reason phrase. - * - * @link http://tools.ietf.org/html/rfc7231#section-6 - * @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml - * @param int $code The 3-digit integer result code to set. - * @param string $reasonPhrase The reason phrase to use with the - * provided status code; if none is provided, implementations MAY - * use the defaults as suggested in the HTTP specification. - * @return self - * @throws \InvalidArgumentException For invalid status code arguments. - */ - public function withStatus($code, $reasonPhrase = '') - { - $code = $this->filterStatus($code); - - if (!is_string($reasonPhrase) && !method_exists($reasonPhrase, '__toString')) { - throw new InvalidArgumentException('ReasonPhrase must be a string'); - } - - $clone = clone $this; - $clone->status = $code; - if ($reasonPhrase === '' && isset(static::$messages[$code])) { - $reasonPhrase = static::$messages[$code]; - } - - if ($reasonPhrase === '') { - throw new InvalidArgumentException('ReasonPhrase must be supplied for this code'); - } - - $clone->reasonPhrase = $reasonPhrase; - - return $clone; - } - - /** - * Filter HTTP status code. - * - * @param int $status HTTP status code. - * @return int - * @throws \InvalidArgumentException If an invalid HTTP status code is provided. - */ - protected function filterStatus($status) - { - if (!is_integer($status) || $status<100 || $status>599) { - throw new InvalidArgumentException('Invalid HTTP status code'); - } - - return $status; - } - - /** - * Gets the response reason phrase associated with the status code. - * - * Because a reason phrase is not a required element in a response - * status line, the reason phrase value MAY be null. Implementations MAY - * choose to return the default RFC 7231 recommended reason phrase (or those - * listed in the IANA HTTP Status Code Registry) for the response's - * status code. - * - * @link http://tools.ietf.org/html/rfc7231#section-6 - * @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml - * @return string Reason phrase; must return an empty string if none present. - */ - public function getReasonPhrase() - { - if ($this->reasonPhrase) { - return $this->reasonPhrase; - } - if (isset(static::$messages[$this->status])) { - return static::$messages[$this->status]; - } - return ''; - } - - /******************************************************************************* - * Body - ******************************************************************************/ - - /** - * Write data to the response body. - * - * Note: This method is not part of the PSR-7 standard. - * - * Proxies to the underlying stream and writes the provided data to it. - * - * @param string $data - * @return self - */ - public function write($data) - { - $this->getBody()->write($data); - - return $this; - } - - /******************************************************************************* - * Response Helpers - ******************************************************************************/ - - /** - * Redirect. - * - * Note: This method is not part of the PSR-7 standard. - * - * This method prepares the response object to return an HTTP Redirect - * response to the client. - * - * @param string|UriInterface $url The redirect destination. - * @param int|null $status The redirect HTTP status code. - * @return self - */ - public function withRedirect($url, $status = null) - { - $responseWithRedirect = $this->withHeader('Location', (string)$url); - - if (is_null($status) && $this->getStatusCode() === 200) { - $status = 302; - } - - if (!is_null($status)) { - return $responseWithRedirect->withStatus($status); - } - - return $responseWithRedirect; - } - - /** - * Json. - * - * Note: This method is not part of the PSR-7 standard. - * - * This method prepares the response object to return an HTTP Json - * response to the client. - * - * @param mixed $data The data - * @param int $status The HTTP status code. - * @param int $encodingOptions Json encoding options - * @throws \RuntimeException - * @return self - */ - public function withJson($data, $status = null, $encodingOptions = 0) - { - $body = $this->getBody(); - $body->rewind(); - $body->write($json = json_encode($data, $encodingOptions)); - - // Ensure that the json encoding passed successfully - if ($json === false) { - throw new \RuntimeException(json_last_error_msg(), json_last_error()); - } - - $responseWithJson = $this->withHeader('Content-Type', 'application/json;charset=utf-8'); - if (isset($status)) { - return $responseWithJson->withStatus($status); - } - return $responseWithJson; - } - - /** - * Is this response empty? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isEmpty() - { - return in_array($this->getStatusCode(), [204, 205, 304]); - } - - /** - * Is this response informational? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isInformational() - { - return $this->getStatusCode() >= 100 && $this->getStatusCode() < 200; - } - - /** - * Is this response OK? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isOk() - { - return $this->getStatusCode() === 200; - } - - /** - * Is this response successful? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isSuccessful() - { - return $this->getStatusCode() >= 200 && $this->getStatusCode() < 300; - } - - /** - * Is this response a redirect? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isRedirect() - { - return in_array($this->getStatusCode(), [301, 302, 303, 307]); - } - - /** - * Is this response a redirection? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isRedirection() - { - return $this->getStatusCode() >= 300 && $this->getStatusCode() < 400; - } - - /** - * Is this response forbidden? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - * @api - */ - public function isForbidden() - { - return $this->getStatusCode() === 403; - } - - /** - * Is this response not Found? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isNotFound() - { - return $this->getStatusCode() === 404; - } - - /** - * Is this response a client error? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isClientError() - { - return $this->getStatusCode() >= 400 && $this->getStatusCode() < 500; - } - - /** - * Is this response a server error? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - public function isServerError() - { - return $this->getStatusCode() >= 500 && $this->getStatusCode() < 600; - } - - /** - * Convert response to string. - * - * Note: This method is not part of the PSR-7 standard. - * - * @return string - */ - public function __toString() - { - $output = sprintf( - 'HTTP/%s %s %s', - $this->getProtocolVersion(), - $this->getStatusCode(), - $this->getReasonPhrase() - ); - $output .= PHP_EOL; - foreach ($this->getHeaders() as $name => $values) { - $output .= sprintf('%s: %s', $name, $this->getHeaderLine($name)) . PHP_EOL; - } - $output .= PHP_EOL; - $output .= (string)$this->getBody(); - - return $output; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Stream.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Stream.php deleted file mode 100644 index 97de9ac0090..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Stream.php +++ /dev/null @@ -1,409 +0,0 @@ - ['r', 'r+', 'w+', 'a+', 'x+', 'c+'], - 'writable' => ['r+', 'w', 'w+', 'a', 'a+', 'x', 'x+', 'c', 'c+'], - ]; - - /** - * The underlying stream resource - * - * @var resource - */ - protected $stream; - - /** - * Stream metadata - * - * @var array - */ - protected $meta; - - /** - * Is this stream readable? - * - * @var bool - */ - protected $readable; - - /** - * Is this stream writable? - * - * @var bool - */ - protected $writable; - - /** - * Is this stream seekable? - * - * @var bool - */ - protected $seekable; - - /** - * The size of the stream if known - * - * @var null|int - */ - protected $size; - - /** - * Create a new Stream. - * - * @param resource $stream A PHP resource handle. - * - * @throws InvalidArgumentException If argument is not a resource. - */ - public function __construct($stream) - { - $this->attach($stream); - } - - /** - * Get stream metadata as an associative array or retrieve a specific key. - * - * The keys returned are identical to the keys returned from PHP's - * stream_get_meta_data() function. - * - * @link http://php.net/manual/en/function.stream-get-meta-data.php - * - * @param string $key Specific metadata to retrieve. - * - * @return array|mixed|null Returns an associative array if no key is - * provided. Returns a specific key value if a key is provided and the - * value is found, or null if the key is not found. - */ - public function getMetadata($key = null) - { - $this->meta = stream_get_meta_data($this->stream); - if (is_null($key) === true) { - return $this->meta; - } - - return isset($this->meta[$key]) ? $this->meta[$key] : null; - } - - /** - * Is a resource attached to this stream? - * - * Note: This method is not part of the PSR-7 standard. - * - * @return bool - */ - protected function isAttached() - { - return is_resource($this->stream); - } - - /** - * Attach new resource to this object. - * - * Note: This method is not part of the PSR-7 standard. - * - * @param resource $newStream A PHP resource handle. - * - * @throws InvalidArgumentException If argument is not a valid PHP resource. - */ - protected function attach($newStream) - { - if (is_resource($newStream) === false) { - throw new InvalidArgumentException(__METHOD__ . ' argument must be a valid PHP resource'); - } - - if ($this->isAttached() === true) { - $this->detach(); - } - - $this->stream = $newStream; - } - - /** - * Separates any underlying resources from the stream. - * - * After the stream has been detached, the stream is in an unusable state. - * - * @return resource|null Underlying PHP stream, if any - */ - public function detach() - { - $oldResource = $this->stream; - $this->stream = null; - $this->meta = null; - $this->readable = null; - $this->writable = null; - $this->seekable = null; - $this->size = null; - - return $oldResource; - } - - /** - * Reads all data from the stream into a string, from the beginning to end. - * - * This method MUST attempt to seek to the beginning of the stream before - * reading data and read the stream until the end is reached. - * - * Warning: This could attempt to load a large amount of data into memory. - * - * This method MUST NOT raise an exception in order to conform with PHP's - * string casting operations. - * - * @see http://php.net/manual/en/language.oop5.magic.php#object.tostring - * @return string - */ - public function __toString() - { - if (!$this->isAttached()) { - return ''; - } - - try { - $this->rewind(); - return $this->getContents(); - } catch (RuntimeException $e) { - return ''; - } - } - - /** - * Closes the stream and any underlying resources. - */ - public function close() - { - if ($this->isAttached() === true) { - fclose($this->stream); - } - - $this->detach(); - } - - /** - * Get the size of the stream if known. - * - * @return int|null Returns the size in bytes if known, or null if unknown. - */ - public function getSize() - { - if (!$this->size && $this->isAttached() === true) { - $stats = fstat($this->stream); - $this->size = isset($stats['size']) ? $stats['size'] : null; - } - - return $this->size; - } - - /** - * Returns the current position of the file read/write pointer - * - * @return int Position of the file pointer - * - * @throws RuntimeException on error. - */ - public function tell() - { - if (!$this->isAttached() || ($position = ftell($this->stream)) === false) { - throw new RuntimeException('Could not get the position of the pointer in stream'); - } - - return $position; - } - - /** - * Returns true if the stream is at the end of the stream. - * - * @return bool - */ - public function eof() - { - return $this->isAttached() ? feof($this->stream) : true; - } - - /** - * Returns whether or not the stream is readable. - * - * @return bool - */ - public function isReadable() - { - if ($this->readable === null) { - $this->readable = false; - if ($this->isAttached()) { - $meta = $this->getMetadata(); - foreach (self::$modes['readable'] as $mode) { - if (strpos($meta['mode'], $mode) === 0) { - $this->readable = true; - break; - } - } - } - } - - return $this->readable; - } - - /** - * Returns whether or not the stream is writable. - * - * @return bool - */ - public function isWritable() - { - if ($this->writable === null) { - $this->writable = false; - if ($this->isAttached()) { - $meta = $this->getMetadata(); - foreach (self::$modes['writable'] as $mode) { - if (strpos($meta['mode'], $mode) === 0) { - $this->writable = true; - break; - } - } - } - } - - return $this->writable; - } - - /** - * Returns whether or not the stream is seekable. - * - * @return bool - */ - public function isSeekable() - { - if ($this->seekable === null) { - $this->seekable = false; - if ($this->isAttached()) { - $meta = $this->getMetadata(); - $this->seekable = $meta['seekable']; - } - } - - return $this->seekable; - } - - /** - * Seek to a position in the stream. - * - * @link http://www.php.net/manual/en/function.fseek.php - * - * @param int $offset Stream offset - * @param int $whence Specifies how the cursor position will be calculated - * based on the seek offset. Valid values are identical to the built-in - * PHP $whence values for `fseek()`. SEEK_SET: Set position equal to - * offset bytes SEEK_CUR: Set position to current location plus offset - * SEEK_END: Set position to end-of-stream plus offset. - * - * @throws RuntimeException on failure. - */ - public function seek($offset, $whence = SEEK_SET) - { - // Note that fseek returns 0 on success! - if (!$this->isSeekable() || fseek($this->stream, $offset, $whence) === -1) { - throw new RuntimeException('Could not seek in stream'); - } - } - - /** - * Seek to the beginning of the stream. - * - * If the stream is not seekable, this method will raise an exception; - * otherwise, it will perform a seek(0). - * - * @see seek() - * - * @link http://www.php.net/manual/en/function.fseek.php - * - * @throws RuntimeException on failure. - */ - public function rewind() - { - if (!$this->isSeekable() || rewind($this->stream) === false) { - throw new RuntimeException('Could not rewind stream'); - } - } - - /** - * Read data from the stream. - * - * @param int $length Read up to $length bytes from the object and return - * them. Fewer than $length bytes may be returned if underlying stream - * call returns fewer bytes. - * - * @return string Returns the data read from the stream, or an empty string - * if no bytes are available. - * - * @throws RuntimeException if an error occurs. - */ - public function read($length) - { - if (!$this->isReadable() || ($data = fread($this->stream, $length)) === false) { - throw new RuntimeException('Could not read from stream'); - } - - return $data; - } - - /** - * Write data to the stream. - * - * @param string $string The string that is to be written. - * - * @return int Returns the number of bytes written to the stream. - * - * @throws RuntimeException on failure. - */ - public function write($string) - { - if (!$this->isWritable() || ($written = fwrite($this->stream, $string)) === false) { - throw new RuntimeException('Could not write to stream'); - } - - // reset size so that it will be recalculated on next call to getSize() - $this->size = null; - - return $written; - } - - /** - * Returns the remaining contents in a string - * - * @return string - * - * @throws RuntimeException if unable to read or an error occurs while - * reading. - */ - public function getContents() - { - if (!$this->isReadable() || ($contents = stream_get_contents($this->stream)) === false) { - throw new RuntimeException('Could not get contents of stream'); - } - - return $contents; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/UploadedFile.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/UploadedFile.php deleted file mode 100644 index ff970277c7c..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/UploadedFile.php +++ /dev/null @@ -1,327 +0,0 @@ -has('slim.files')) { - return $env['slim.files']; - } elseif (isset($_FILES)) { - return static::parseUploadedFiles($_FILES); - } - - return []; - } - - /** - * Parse a non-normalized, i.e. $_FILES superglobal, tree of uploaded file data. - * - * @param array $uploadedFiles The non-normalized tree of uploaded file data. - * - * @return array A normalized tree of UploadedFile instances. - */ - private static function parseUploadedFiles(array $uploadedFiles) - { - $parsed = []; - foreach ($uploadedFiles as $field => $uploadedFile) { - if (!isset($uploadedFile['error'])) { - if (is_array($uploadedFile)) { - $parsed[$field] = static::parseUploadedFiles($uploadedFile); - } - continue; - } - - $parsed[$field] = []; - if (!is_array($uploadedFile['error'])) { - $parsed[$field] = new static( - $uploadedFile['tmp_name'], - isset($uploadedFile['name']) ? $uploadedFile['name'] : null, - isset($uploadedFile['type']) ? $uploadedFile['type'] : null, - isset($uploadedFile['size']) ? $uploadedFile['size'] : null, - $uploadedFile['error'], - true - ); - } else { - $subArray = []; - foreach ($uploadedFile['error'] as $fileIdx => $error) { - // normalise subarray and re-parse to move the input's keyname up a level - $subArray[$fileIdx]['name'] = $uploadedFile['name'][$fileIdx]; - $subArray[$fileIdx]['type'] = $uploadedFile['type'][$fileIdx]; - $subArray[$fileIdx]['tmp_name'] = $uploadedFile['tmp_name'][$fileIdx]; - $subArray[$fileIdx]['error'] = $uploadedFile['error'][$fileIdx]; - $subArray[$fileIdx]['size'] = $uploadedFile['size'][$fileIdx]; - - $parsed[$field] = static::parseUploadedFiles($subArray); - } - } - } - - return $parsed; - } - - /** - * Construct a new UploadedFile instance. - * - * @param string $file The full path to the uploaded file provided by the client. - * @param string|null $name The file name. - * @param string|null $type The file media type. - * @param int|null $size The file size in bytes. - * @param int $error The UPLOAD_ERR_XXX code representing the status of the upload. - * @param bool $sapi Indicates if the upload is in a SAPI environment. - */ - public function __construct($file, $name = null, $type = null, $size = null, $error = UPLOAD_ERR_OK, $sapi = false) - { - $this->file = $file; - $this->name = $name; - $this->type = $type; - $this->size = $size; - $this->error = $error; - $this->sapi = $sapi; - } - - /** - * Retrieve a stream representing the uploaded file. - * - * This method MUST return a StreamInterface instance, representing the - * uploaded file. The purpose of this method is to allow utilizing native PHP - * stream functionality to manipulate the file upload, such as - * stream_copy_to_stream() (though the result will need to be decorated in a - * native PHP stream wrapper to work with such functions). - * - * If the moveTo() method has been called previously, this method MUST raise - * an exception. - * - * @return StreamInterface Stream representation of the uploaded file. - * @throws \RuntimeException in cases when no stream is available or can be - * created. - */ - public function getStream() - { - if ($this->moved) { - throw new \RuntimeException(sprintf('Uploaded file %1s has already been moved', $this->name)); - } - if ($this->stream === null) { - $this->stream = new Stream(fopen($this->file, 'r')); - } - - return $this->stream; - } - - /** - * Move the uploaded file to a new location. - * - * Use this method as an alternative to move_uploaded_file(). This method is - * guaranteed to work in both SAPI and non-SAPI environments. - * Implementations must determine which environment they are in, and use the - * appropriate method (move_uploaded_file(), rename(), or a stream - * operation) to perform the operation. - * - * $targetPath may be an absolute path, or a relative path. If it is a - * relative path, resolution should be the same as used by PHP's rename() - * function. - * - * The original file or stream MUST be removed on completion. - * - * If this method is called more than once, any subsequent calls MUST raise - * an exception. - * - * When used in an SAPI environment where $_FILES is populated, when writing - * files via moveTo(), is_uploaded_file() and move_uploaded_file() SHOULD be - * used to ensure permissions and upload status are verified correctly. - * - * If you wish to move to a stream, use getStream(), as SAPI operations - * cannot guarantee writing to stream destinations. - * - * @see http://php.net/is_uploaded_file - * @see http://php.net/move_uploaded_file - * - * @param string $targetPath Path to which to move the uploaded file. - * - * @throws InvalidArgumentException if the $path specified is invalid. - * @throws RuntimeException on any error during the move operation, or on - * the second or subsequent call to the method. - */ - public function moveTo($targetPath) - { - if ($this->moved) { - throw new RuntimeException('Uploaded file already moved'); - } - - if (!is_writable(dirname($targetPath))) { - throw new InvalidArgumentException('Upload target path is not writable'); - } - - $targetIsStream = strpos($targetPath, '://') > 0; - if ($targetIsStream) { - if (!copy($this->file, $targetPath)) { - throw new RuntimeException(sprintf('Error moving uploaded file %1s to %2s', $this->name, $targetPath)); - } - if (!unlink($this->file)) { - throw new RuntimeException(sprintf('Error removing uploaded file %1s', $this->name)); - } - } elseif ($this->sapi) { - if (!is_uploaded_file($this->file)) { - throw new RuntimeException(sprintf('%1s is not a valid uploaded file', $this->file)); - } - - if (!move_uploaded_file($this->file, $targetPath)) { - throw new RuntimeException(sprintf('Error moving uploaded file %1s to %2s', $this->name, $targetPath)); - } - } else { - if (!rename($this->file, $targetPath)) { - throw new RuntimeException(sprintf('Error moving uploaded file %1s to %2s', $this->name, $targetPath)); - } - } - - $this->moved = true; - } - - /** - * Retrieve the error associated with the uploaded file. - * - * The return value MUST be one of PHP's UPLOAD_ERR_XXX constants. - * - * If the file was uploaded successfully, this method MUST return - * UPLOAD_ERR_OK. - * - * Implementations SHOULD return the value stored in the "error" key of - * the file in the $_FILES array. - * - * @see http://php.net/manual/en/features.file-upload.errors.php - * - * @return int One of PHP's UPLOAD_ERR_XXX constants. - */ - public function getError() - { - return $this->error; - } - - /** - * Retrieve the filename sent by the client. - * - * Do not trust the value returned by this method. A client could send - * a malicious filename with the intention to corrupt or hack your - * application. - * - * Implementations SHOULD return the value stored in the "name" key of - * the file in the $_FILES array. - * - * @return string|null The filename sent by the client or null if none - * was provided. - */ - public function getClientFilename() - { - return $this->name; - } - - /** - * Retrieve the media type sent by the client. - * - * Do not trust the value returned by this method. A client could send - * a malicious media type with the intention to corrupt or hack your - * application. - * - * Implementations SHOULD return the value stored in the "type" key of - * the file in the $_FILES array. - * - * @return string|null The media type sent by the client or null if none - * was provided. - */ - public function getClientMediaType() - { - return $this->type; - } - - /** - * Retrieve the file size. - * - * Implementations SHOULD return the value stored in the "size" key of - * the file in the $_FILES array if available, as PHP calculates this based - * on the actual size transmitted. - * - * @return int|null The file size in bytes or null if unknown. - */ - public function getSize() - { - return $this->size; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Uri.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Uri.php deleted file mode 100644 index 27b1d0d5938..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Http/Uri.php +++ /dev/null @@ -1,821 +0,0 @@ -scheme = $this->filterScheme($scheme); - $this->host = $host; - $this->port = $this->filterPort($port); - $this->path = empty($path) ? '/' : $this->filterPath($path); - $this->query = $this->filterQuery($query); - $this->fragment = $this->filterQuery($fragment); - $this->user = $user; - $this->password = $password; - } - - /** - * Create new Uri from string. - * - * @param string $uri Complete Uri string - * (i.e., https://user:pass@host:443/path?query). - * - * @return self - */ - public static function createFromString($uri) - { - if (!is_string($uri) && !method_exists($uri, '__toString')) { - throw new InvalidArgumentException('Uri must be a string'); - } - - $parts = parse_url($uri); - $scheme = isset($parts['scheme']) ? $parts['scheme'] : ''; - $user = isset($parts['user']) ? $parts['user'] : ''; - $pass = isset($parts['pass']) ? $parts['pass'] : ''; - $host = isset($parts['host']) ? $parts['host'] : ''; - $port = isset($parts['port']) ? $parts['port'] : null; - $path = isset($parts['path']) ? $parts['path'] : ''; - $query = isset($parts['query']) ? $parts['query'] : ''; - $fragment = isset($parts['fragment']) ? $parts['fragment'] : ''; - - return new static($scheme, $host, $port, $path, $query, $fragment, $user, $pass); - } - - /** - * Create new Uri from environment. - * - * @param Environment $env - * - * @return self - */ - public static function createFromEnvironment(Environment $env) - { - // Scheme - $isSecure = $env->get('HTTPS'); - $scheme = (empty($isSecure) || $isSecure === 'off') ? 'http' : 'https'; - - // Authority: Username and password - $username = $env->get('PHP_AUTH_USER', ''); - $password = $env->get('PHP_AUTH_PW', ''); - - // Authority: Host - if ($env->has('HTTP_HOST')) { - $host = $env->get('HTTP_HOST'); - } else { - $host = $env->get('SERVER_NAME'); - } - - // Authority: Port - $port = (int)$env->get('SERVER_PORT', 80); - if (preg_match('/^(\[[a-fA-F0-9:.]+\])(:\d+)?\z/', $host, $matches)) { - $host = $matches[1]; - - if ($matches[2]) { - $port = (int) substr($matches[2], 1); - } - } else { - $pos = strpos($host, ':'); - if ($pos !== false) { - $port = (int) substr($host, $pos + 1); - $host = strstr($host, ':', true); - } - } - - // Path - $requestScriptName = parse_url($env->get('SCRIPT_NAME'), PHP_URL_PATH); - $requestScriptDir = dirname($requestScriptName); - - // parse_url() requires a full URL. As we don't extract the domain name or scheme, - // we use a stand-in. - $requestUri = parse_url('http://example.com' . $env->get('REQUEST_URI'), PHP_URL_PATH); - - $basePath = ''; - $virtualPath = $requestUri; - if (stripos($requestUri, $requestScriptName) === 0) { - $basePath = $requestScriptName; - } elseif ($requestScriptDir !== '/' && stripos($requestUri, $requestScriptDir) === 0) { - $basePath = $requestScriptDir; - } - - if ($basePath) { - $virtualPath = ltrim(substr($requestUri, strlen($basePath)), '/'); - } - - // Query string - $queryString = $env->get('QUERY_STRING', ''); - - // Fragment - $fragment = ''; - - // Build Uri - $uri = new static($scheme, $host, $port, $virtualPath, $queryString, $fragment, $username, $password); - if ($basePath) { - $uri = $uri->withBasePath($basePath); - } - - return $uri; - } - - /******************************************************************************** - * Scheme - *******************************************************************************/ - - /** - * Retrieve the scheme component of the URI. - * - * If no scheme is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.1. - * - * The trailing ":" character is not part of the scheme and MUST NOT be - * added. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.1 - * @return string The URI scheme. - */ - public function getScheme() - { - return $this->scheme; - } - - /** - * Return an instance with the specified scheme. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified scheme. - * - * Implementations MUST support the schemes "http" and "https" case - * insensitively, and MAY accommodate other schemes if required. - * - * An empty scheme is equivalent to removing the scheme. - * - * @param string $scheme The scheme to use with the new instance. - * @return self A new instance with the specified scheme. - * @throws \InvalidArgumentException for invalid or unsupported schemes. - */ - public function withScheme($scheme) - { - $scheme = $this->filterScheme($scheme); - $clone = clone $this; - $clone->scheme = $scheme; - - return $clone; - } - - /** - * Filter Uri scheme. - * - * @param string $scheme Raw Uri scheme. - * @return string - * - * @throws InvalidArgumentException If the Uri scheme is not a string. - * @throws InvalidArgumentException If Uri scheme is not "", "https", or "http". - */ - protected function filterScheme($scheme) - { - static $valid = [ - '' => true, - 'https' => true, - 'http' => true, - ]; - - if (!is_string($scheme) && !method_exists($scheme, '__toString')) { - throw new InvalidArgumentException('Uri scheme must be a string'); - } - - $scheme = str_replace('://', '', strtolower((string)$scheme)); - if (!isset($valid[$scheme])) { - throw new InvalidArgumentException('Uri scheme must be one of: "", "https", "http"'); - } - - return $scheme; - } - - /******************************************************************************** - * Authority - *******************************************************************************/ - - /** - * Retrieve the authority component of the URI. - * - * If no authority information is present, this method MUST return an empty - * string. - * - * The authority syntax of the URI is: - * - *
-     * [user-info@]host[:port]
-     * 
- * - * If the port component is not set or is the standard port for the current - * scheme, it SHOULD NOT be included. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.2 - * @return string The URI authority, in "[user-info@]host[:port]" format. - */ - public function getAuthority() - { - $userInfo = $this->getUserInfo(); - $host = $this->getHost(); - $port = $this->getPort(); - - return ($userInfo ? $userInfo . '@' : '') . $host . ($port !== null ? ':' . $port : ''); - } - - /** - * Retrieve the user information component of the URI. - * - * If no user information is present, this method MUST return an empty - * string. - * - * If a user is present in the URI, this will return that value; - * additionally, if the password is also present, it will be appended to the - * user value, with a colon (":") separating the values. - * - * The trailing "@" character is not part of the user information and MUST - * NOT be added. - * - * @return string The URI user information, in "username[:password]" format. - */ - public function getUserInfo() - { - return $this->user . ($this->password ? ':' . $this->password : ''); - } - - /** - * Return an instance with the specified user information. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified user information. - * - * Password is optional, but the user information MUST include the - * user; an empty string for the user is equivalent to removing user - * information. - * - * @param string $user The user name to use for authority. - * @param null|string $password The password associated with $user. - * @return self A new instance with the specified user information. - */ - public function withUserInfo($user, $password = null) - { - $clone = clone $this; - $clone->user = $user; - $clone->password = $password ? $password : ''; - - return $clone; - } - - /** - * Retrieve the host component of the URI. - * - * If no host is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.2.2. - * - * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 - * @return string The URI host. - */ - public function getHost() - { - return $this->host; - } - - /** - * Return an instance with the specified host. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified host. - * - * An empty host value is equivalent to removing the host. - * - * @param string $host The hostname to use with the new instance. - * @return self A new instance with the specified host. - * @throws \InvalidArgumentException for invalid hostnames. - */ - public function withHost($host) - { - $clone = clone $this; - $clone->host = $host; - - return $clone; - } - - /** - * Retrieve the port component of the URI. - * - * If a port is present, and it is non-standard for the current scheme, - * this method MUST return it as an integer. If the port is the standard port - * used with the current scheme, this method SHOULD return null. - * - * If no port is present, and no scheme is present, this method MUST return - * a null value. - * - * If no port is present, but a scheme is present, this method MAY return - * the standard port for that scheme, but SHOULD return null. - * - * @return null|int The URI port. - */ - public function getPort() - { - return $this->port && !$this->hasStandardPort() ? $this->port : null; - } - - /** - * Return an instance with the specified port. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified port. - * - * Implementations MUST raise an exception for ports outside the - * established TCP and UDP port ranges. - * - * A null value provided for the port is equivalent to removing the port - * information. - * - * @param null|int $port The port to use with the new instance; a null value - * removes the port information. - * @return self A new instance with the specified port. - * @throws \InvalidArgumentException for invalid ports. - */ - public function withPort($port) - { - $port = $this->filterPort($port); - $clone = clone $this; - $clone->port = $port; - - return $clone; - } - - /** - * Does this Uri use a standard port? - * - * @return bool - */ - protected function hasStandardPort() - { - return ($this->scheme === 'http' && $this->port === 80) || ($this->scheme === 'https' && $this->port === 443); - } - - /** - * Filter Uri port. - * - * @param null|int $port The Uri port number. - * @return null|int - * - * @throws InvalidArgumentException If the port is invalid. - */ - protected function filterPort($port) - { - if (is_null($port) || (is_integer($port) && ($port >= 1 && $port <= 65535))) { - return $port; - } - - throw new InvalidArgumentException('Uri port must be null or an integer between 1 and 65535 (inclusive)'); - } - - /******************************************************************************** - * Path - *******************************************************************************/ - - /** - * Retrieve the path component of the URI. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * Normally, the empty path "" and absolute path "/" are considered equal as - * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically - * do this normalization because in contexts with a trimmed base path, e.g. - * the front controller, this difference becomes significant. It's the task - * of the user to handle both "" and "/". - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.3. - * - * As an example, if the value should include a slash ("/") not intended as - * delimiter between path segments, that value MUST be passed in encoded - * form (e.g., "%2F") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.3 - * @return string The URI path. - */ - public function getPath() - { - return $this->path; - } - - /** - * Return an instance with the specified path. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified path. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * If the path is intended to be domain-relative rather than path relative then - * it must begin with a slash ("/"). Paths not starting with a slash ("/") - * are assumed to be relative to some base path known to the application or - * consumer. - * - * Users can provide both encoded and decoded path characters. - * Implementations ensure the correct encoding as outlined in getPath(). - * - * @param string $path The path to use with the new instance. - * @return self A new instance with the specified path. - * @throws \InvalidArgumentException for invalid paths. - */ - public function withPath($path) - { - if (!is_string($path)) { - throw new InvalidArgumentException('Uri path must be a string'); - } - - $clone = clone $this; - $clone->path = $this->filterPath($path); - - // if the path is absolute, then clear basePath - if (substr($path, 0, 1) == '/') { - $clone->basePath = ''; - } - - return $clone; - } - - /** - * Retrieve the base path segment of the URI. - * - * Note: This method is not part of the PSR-7 standard. - * - * This method MUST return a string; if no path is present it MUST return - * an empty string. - * - * @return string The base path segment of the URI. - */ - public function getBasePath() - { - return $this->basePath; - } - - /** - * Set base path. - * - * Note: This method is not part of the PSR-7 standard. - * - * @param string $basePath - * @return self - */ - public function withBasePath($basePath) - { - if (!is_string($basePath)) { - throw new InvalidArgumentException('Uri path must be a string'); - } - if (!empty($basePath)) { - $basePath = '/' . trim($basePath, '/'); // <-- Trim on both sides - } - $clone = clone $this; - - if ($basePath !== '/') { - $clone->basePath = $this->filterPath($basePath); - } - - return $clone; - } - - /** - * Filter Uri path. - * - * This method percent-encodes all reserved - * characters in the provided path string. This method - * will NOT double-encode characters that are already - * percent-encoded. - * - * @param string $path The raw uri path. - * @return string The RFC 3986 percent-encoded uri path. - * @link http://www.faqs.org/rfcs/rfc3986.html - */ - protected function filterPath($path) - { - return preg_replace_callback( - '/(?:[^a-zA-Z0-9_\-\.~:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/', - function ($match) { - return rawurlencode($match[0]); - }, - $path - ); - } - - /******************************************************************************** - * Query - *******************************************************************************/ - - /** - * Retrieve the query string of the URI. - * - * If no query string is present, this method MUST return an empty string. - * - * The leading "?" character is not part of the query and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.4. - * - * As an example, if a value in a key/value pair of the query string should - * include an ampersand ("&") not intended as a delimiter between values, - * that value MUST be passed in encoded form (e.g., "%26") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.4 - * @return string The URI query string. - */ - public function getQuery() - { - return $this->query; - } - - /** - * Return an instance with the specified query string. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified query string. - * - * Users can provide both encoded and decoded query characters. - * Implementations ensure the correct encoding as outlined in getQuery(). - * - * An empty query string value is equivalent to removing the query string. - * - * @param string $query The query string to use with the new instance. - * @return self A new instance with the specified query string. - * @throws \InvalidArgumentException for invalid query strings. - */ - public function withQuery($query) - { - if (!is_string($query) && !method_exists($query, '__toString')) { - throw new InvalidArgumentException('Uri query must be a string'); - } - $query = ltrim((string)$query, '?'); - $clone = clone $this; - $clone->query = $this->filterQuery($query); - - return $clone; - } - - /** - * Filters the query string or fragment of a URI. - * - * @param string $query The raw uri query string. - * @return string The percent-encoded query string. - */ - protected function filterQuery($query) - { - return preg_replace_callback( - '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/', - function ($match) { - return rawurlencode($match[0]); - }, - $query - ); - } - - /******************************************************************************** - * Fragment - *******************************************************************************/ - - /** - * Retrieve the fragment component of the URI. - * - * If no fragment is present, this method MUST return an empty string. - * - * The leading "#" character is not part of the fragment and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.5. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.5 - * @return string The URI fragment. - */ - public function getFragment() - { - return $this->fragment; - } - - /** - * Return an instance with the specified URI fragment. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified URI fragment. - * - * Users can provide both encoded and decoded fragment characters. - * Implementations ensure the correct encoding as outlined in getFragment(). - * - * An empty fragment value is equivalent to removing the fragment. - * - * @param string $fragment The fragment to use with the new instance. - * @return self A new instance with the specified fragment. - */ - public function withFragment($fragment) - { - if (!is_string($fragment) && !method_exists($fragment, '__toString')) { - throw new InvalidArgumentException('Uri fragment must be a string'); - } - $fragment = ltrim((string)$fragment, '#'); - $clone = clone $this; - $clone->fragment = $this->filterQuery($fragment); - - return $clone; - } - - /******************************************************************************** - * Helpers - *******************************************************************************/ - - /** - * Return the string representation as a URI reference. - * - * Depending on which components of the URI are present, the resulting - * string is either a full URI or relative reference according to RFC 3986, - * Section 4.1. The method concatenates the various components of the URI, - * using the appropriate delimiters: - * - * - If a scheme is present, it MUST be suffixed by ":". - * - If an authority is present, it MUST be prefixed by "//". - * - The path can be concatenated without delimiters. But there are two - * cases where the path has to be adjusted to make the URI reference - * valid as PHP does not allow to throw an exception in __toString(): - * - If the path is rootless and an authority is present, the path MUST - * be prefixed by "/". - * - If the path is starting with more than one "/" and no authority is - * present, the starting slashes MUST be reduced to one. - * - If a query is present, it MUST be prefixed by "?". - * - If a fragment is present, it MUST be prefixed by "#". - * - * @see http://tools.ietf.org/html/rfc3986#section-4.1 - * @return string - */ - public function __toString() - { - $scheme = $this->getScheme(); - $authority = $this->getAuthority(); - $basePath = $this->getBasePath(); - $path = $this->getPath(); - $query = $this->getQuery(); - $fragment = $this->getFragment(); - - $path = $basePath . '/' . ltrim($path, '/'); - - return ($scheme ? $scheme . ':' : '') - . ($authority ? '//' . $authority : '') - . $path - . ($query ? '?' . $query : '') - . ($fragment ? '#' . $fragment : ''); - } - - /** - * Return the fully qualified base URL. - * - * Note that this method never includes a trailing / - * - * This method is not part of PSR-7. - * - * @return string - */ - public function getBaseUrl() - { - $scheme = $this->getScheme(); - $authority = $this->getAuthority(); - $basePath = $this->getBasePath(); - - if ($authority && substr($basePath, 0, 1) !== '/') { - $basePath = $basePath . '/' . $basePath; - } - - return ($scheme ? $scheme . ':' : '') - . ($authority ? '//' . $authority : '') - . rtrim($basePath, '/'); - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Interfaces/CallableResolverInterface.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Interfaces/CallableResolverInterface.php deleted file mode 100644 index 9bde59ac97a..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Interfaces/CallableResolverInterface.php +++ /dev/null @@ -1,27 +0,0 @@ -middlewareLock) { - throw new RuntimeException('Middleware can’t be added once the stack is dequeuing'); - } - - if (is_null($this->stack)) { - $this->seedMiddlewareStack(); - } - $next = $this->stack->top(); - $this->stack[] = function (ServerRequestInterface $req, ResponseInterface $res) use ($callable, $next) { - $result = call_user_func($callable, $req, $res, $next); - if ($result instanceof ResponseInterface === false) { - throw new UnexpectedValueException( - 'Middleware must return instance of \Psr\Http\Message\ResponseInterface' - ); - } - - return $result; - }; - - return $this; - } - - /** - * Seed middleware stack with first callable - * - * @param callable $kernel The last item to run as middleware - * - * @throws RuntimeException if the stack is seeded more than once - */ - protected function seedMiddlewareStack(callable $kernel = null) - { - if (!is_null($this->stack)) { - throw new RuntimeException('MiddlewareStack can only be seeded once.'); - } - if ($kernel === null) { - $kernel = $this; - } - $this->stack = new SplStack; - $this->stack->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO | SplDoublyLinkedList::IT_MODE_KEEP); - $this->stack[] = $kernel; - } - - /** - * Call middleware stack - * - * @param ServerRequestInterface $req A request object - * @param ResponseInterface $res A response object - * - * @return ResponseInterface - */ - public function callMiddlewareStack(ServerRequestInterface $req, ResponseInterface $res) - { - if (is_null($this->stack)) { - $this->seedMiddlewareStack(); - } - /** @var callable $start */ - $start = $this->stack->top(); - $this->middlewareLock = true; - $resp = $start($req, $res); - $this->middlewareLock = false; - return $resp; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Routable.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Routable.php deleted file mode 100644 index 4a6759fac46..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Routable.php +++ /dev/null @@ -1,106 +0,0 @@ -middleware; - } - - /** - * Get the route pattern - * - * @return string - */ - public function getPattern() - { - return $this->pattern; - } - - /** - * Set container for use with resolveCallable - * - * @param ContainerInterface $container - * - * @return self - */ - public function setContainer(ContainerInterface $container) - { - $this->container = $container; - return $this; - } - - /** - * Prepend middleware to the middleware collection - * - * @param callable|string $callable The callback routine - * - * @return static - */ - public function add($callable) - { - $this->middleware[] = new DeferredCallable($callable, $this->container); - return $this; - } - - /** - * Set the route pattern - * - * @set string - */ - public function setPattern($newPattern) - { - $this->pattern = $newPattern; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Route.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Route.php deleted file mode 100644 index 3cb4a0e28b4..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Route.php +++ /dev/null @@ -1,357 +0,0 @@ -methods = $methods; - $this->pattern = $pattern; - $this->callable = $callable; - $this->groups = $groups; - $this->identifier = 'route' . $identifier; - } - - /** - * Finalize the route in preparation for dispatching - */ - public function finalize() - { - if ($this->finalized) { - return; - } - - $groupMiddleware = []; - foreach ($this->getGroups() as $group) { - $groupMiddleware = array_merge($group->getMiddleware(), $groupMiddleware); - } - - $this->middleware = array_merge($this->middleware, $groupMiddleware); - - foreach ($this->getMiddleware() as $middleware) { - $this->addMiddleware($middleware); - } - - $this->finalized = true; - } - - /** - * Get route callable - * - * @return callable - */ - public function getCallable() - { - return $this->callable; - } - - /** - * Get route methods - * - * @return string[] - */ - public function getMethods() - { - return $this->methods; - } - - /** - * Get parent route groups - * - * @return RouteGroup[] - */ - public function getGroups() - { - return $this->groups; - } - - /** - * Get route name - * - * @return null|string - */ - public function getName() - { - return $this->name; - } - - /** - * Get route identifier - * - * @return string - */ - public function getIdentifier() - { - return $this->identifier; - } - - /** - * Get output buffering mode - * - * @return boolean|string - */ - public function getOutputBuffering() - { - return $this->outputBuffering; - } - - /** - * Set output buffering mode - * - * One of: false, 'prepend' or 'append' - * - * @param boolean|string $mode - * - * @throws InvalidArgumentException If an unknown buffering mode is specified - */ - public function setOutputBuffering($mode) - { - if (!in_array($mode, [false, 'prepend', 'append'], true)) { - throw new InvalidArgumentException('Unknown output buffering mode'); - } - $this->outputBuffering = $mode; - } - - /** - * Set route name - * - * @param string $name - * - * @return self - * - * @throws InvalidArgumentException if the route name is not a string - */ - public function setName($name) - { - if (!is_string($name)) { - throw new InvalidArgumentException('Route name must be a string'); - } - $this->name = $name; - return $this; - } - - /** - * Set a route argument - * - * @param string $name - * @param string $value - * - * @return self - */ - public function setArgument($name, $value) - { - $this->arguments[$name] = $value; - return $this; - } - - /** - * Replace route arguments - * - * @param array $arguments - * - * @return self - */ - public function setArguments(array $arguments) - { - $this->arguments = $arguments; - return $this; - } - - /** - * Retrieve route arguments - * - * @return array - */ - public function getArguments() - { - return $this->arguments; - } - - /** - * Retrieve a specific route argument - * - * @param string $name - * @param mixed $default - * - * @return mixed - */ - public function getArgument($name, $default = null) - { - if (array_key_exists($name, $this->arguments)) { - return $this->arguments[$name]; - } - return $default; - } - - /******************************************************************************** - * Route Runner - *******************************************************************************/ - - /** - * Prepare the route for use - * - * @param ServerRequestInterface $request - * @param array $arguments - */ - public function prepare(ServerRequestInterface $request, array $arguments) - { - // Add the arguments - foreach ($arguments as $k => $v) { - $this->setArgument($k, $v); - } - } - - /** - * Run route - * - * This method traverses the middleware stack, including the route's callable - * and captures the resultant HTTP response object. It then sends the response - * back to the Application. - * - * @param ServerRequestInterface $request - * @param ResponseInterface $response - * - * @return ResponseInterface - */ - public function run(ServerRequestInterface $request, ResponseInterface $response) - { - // Finalise route now that we are about to run it - $this->finalize(); - - // Traverse middleware stack and fetch updated response - return $this->callMiddlewareStack($request, $response); - } - - /** - * Dispatch route callable against current Request and Response objects - * - * This method invokes the route object's callable. If middleware is - * registered for the route, each callable middleware is invoked in - * the order specified. - * - * @param ServerRequestInterface $request The current Request object - * @param ResponseInterface $response The current Response object - * @return \Psr\Http\Message\ResponseInterface - * @throws \Exception if the route callable throws an exception - */ - public function __invoke(ServerRequestInterface $request, ResponseInterface $response) - { - $this->callable = $this->resolveCallable($this->callable); - - /** @var InvocationStrategyInterface $handler */ - $handler = isset($this->container) ? $this->container->get('foundHandler') : new RequestResponse(); - - // invoke route callable - if ($this->outputBuffering === false) { - $newResponse = $handler($this->callable, $request, $response, $this->arguments); - } else { - try { - ob_start(); - $newResponse = $handler($this->callable, $request, $response, $this->arguments); - $output = ob_get_clean(); - } catch (Exception $e) { - ob_end_clean(); - throw $e; - } - } - - if ($newResponse instanceof ResponseInterface) { - // if route callback returns a ResponseInterface, then use it - $response = $newResponse; - } elseif (is_string($newResponse)) { - // if route callback returns a string, then append it to the response - if ($response->getBody()->isWritable()) { - $response->getBody()->write($newResponse); - } - } - - if (!empty($output) && $response->getBody()->isWritable()) { - if ($this->outputBuffering === 'prepend') { - // prepend output buffer content - $body = new Http\Body(fopen('php://temp', 'r+')); - $body->write($output . $response->getBody()); - $response = $response->withBody($body); - } elseif ($this->outputBuffering === 'append') { - // append output buffer content - $response->getBody()->write($output); - } - } - - return $response; - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/RouteGroup.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/RouteGroup.php deleted file mode 100644 index a0cdf4d47d8..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/RouteGroup.php +++ /dev/null @@ -1,47 +0,0 @@ -pattern = $pattern; - $this->callable = $callable; - } - - /** - * Invoke the group to register any Routable objects within it. - * - * @param App $app The App to bind the callable to. - */ - public function __invoke(App $app = null) - { - $callable = $this->resolveCallable($this->callable); - if ($callable instanceof Closure && $app !== null) { - $callable = $callable->bindTo($app); - } - - $callable(); - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Router.php b/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Router.php deleted file mode 100644 index b9d5d132ab2..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/Slim/Router.php +++ /dev/null @@ -1,421 +0,0 @@ -routeParser = $parser ?: new StdParser; - } - - /** - * Set the base path used in pathFor() - * - * @param string $basePath - * - * @return self - */ - public function setBasePath($basePath) - { - if (!is_string($basePath)) { - throw new InvalidArgumentException('Router basePath must be a string'); - } - - $this->basePath = $basePath; - - return $this; - } - - /** - * Set path to fast route cache file. If this is false then route caching is disabled. - * - * @param string|false $cacheFile - * - * @return self - */ - public function setCacheFile($cacheFile) - { - if (!is_string($cacheFile) && $cacheFile !== false) { - throw new InvalidArgumentException('Router cacheFile must be a string or false'); - } - - $this->cacheFile = $cacheFile; - - if ($cacheFile !== false && !is_writable(dirname($cacheFile))) { - throw new RuntimeException('Router cacheFile directory must be writable'); - } - - - return $this; - } - - /** - * Add route - * - * @param string[] $methods Array of HTTP methods - * @param string $pattern The route pattern - * @param callable $handler The route callable - * - * @return RouteInterface - * - * @throws InvalidArgumentException if the route pattern isn't a string - */ - public function map($methods, $pattern, $handler) - { - if (!is_string($pattern)) { - throw new InvalidArgumentException('Route pattern must be a string'); - } - - // Prepend parent group pattern(s) - if ($this->routeGroups) { - $pattern = $this->processGroups() . $pattern; - } - - // According to RFC methods are defined in uppercase (See RFC 7231) - $methods = array_map("strtoupper", $methods); - - // Add route - $route = new Route($methods, $pattern, $handler, $this->routeGroups, $this->routeCounter); - $this->routes[$route->getIdentifier()] = $route; - $this->routeCounter++; - - return $route; - } - - /** - * Dispatch router for HTTP request - * - * @param ServerRequestInterface $request The current HTTP request object - * - * @return array - * - * @link https://github.com/nikic/FastRoute/blob/master/src/Dispatcher.php - */ - public function dispatch(ServerRequestInterface $request) - { - $uri = '/' . ltrim($request->getUri()->getPath(), '/'); - - return $this->createDispatcher()->dispatch( - $request->getMethod(), - $uri - ); - } - - /** - * @return \FastRoute\Dispatcher - */ - protected function createDispatcher() - { - if ($this->dispatcher) { - return $this->dispatcher; - } - - $routeDefinitionCallback = function (RouteCollector $r) { - foreach ($this->getRoutes() as $route) { - $r->addRoute($route->getMethods(), $route->getPattern(), $route->getIdentifier()); - } - }; - - if ($this->cacheFile) { - $this->dispatcher = \FastRoute\cachedDispatcher($routeDefinitionCallback, [ - 'routeParser' => $this->routeParser, - 'cacheFile' => $this->cacheFile, - ]); - } else { - $this->dispatcher = \FastRoute\simpleDispatcher($routeDefinitionCallback, [ - 'routeParser' => $this->routeParser, - ]); - } - - return $this->dispatcher; - } - - /** - * @param \FastRoute\Dispatcher $dispatcher - */ - public function setDispatcher(Dispatcher $dispatcher) - { - $this->dispatcher = $dispatcher; - } - - /** - * Get route objects - * - * @return Route[] - */ - public function getRoutes() - { - return $this->routes; - } - - /** - * Get named route object - * - * @param string $name Route name - * - * @return Route - * - * @throws RuntimeException If named route does not exist - */ - public function getNamedRoute($name) - { - foreach ($this->routes as $route) { - if ($name == $route->getName()) { - return $route; - } - } - throw new RuntimeException('Named route does not exist for name: ' . $name); - } - - /** - * Remove named route - * - * @param string $name Route name - * - * @throws RuntimeException If named route does not exist - */ - public function removeNamedRoute($name) - { - $route = $this->getNamedRoute($name); - - // no exception, route exists, now remove by id - unset($this->routes[$route->getIdentifier()]); - } - - /** - * Process route groups - * - * @return string A group pattern to prefix routes with - */ - protected function processGroups() - { - $pattern = ""; - foreach ($this->routeGroups as $group) { - $pattern .= $group->getPattern(); - } - return $pattern; - } - - /** - * Add a route group to the array - * - * @param string $pattern - * @param callable $callable - * - * @return RouteGroupInterface - */ - public function pushGroup($pattern, $callable) - { - $group = new RouteGroup($pattern, $callable); - array_push($this->routeGroups, $group); - return $group; - } - - /** - * Removes the last route group from the array - * - * @return RouteGroup|bool The RouteGroup if successful, else False - */ - public function popGroup() - { - $group = array_pop($this->routeGroups); - return $group instanceof RouteGroup ? $group : false; - } - - /** - * @param $identifier - * @return \Slim\Interfaces\RouteInterface - */ - public function lookupRoute($identifier) - { - if (!isset($this->routes[$identifier])) { - throw new RuntimeException('Route not found, looks like your route cache is stale.'); - } - return $this->routes[$identifier]; - } - - /** - * Build the path for a named route excluding the base path - * - * @param string $name Route name - * @param array $data Named argument replacement data - * @param array $queryParams Optional query string parameters - * - * @return string - * - * @throws RuntimeException If named route does not exist - * @throws InvalidArgumentException If required data not provided - */ - public function relativePathFor($name, array $data = [], array $queryParams = []) - { - $route = $this->getNamedRoute($name); - $pattern = $route->getPattern(); - - $routeDatas = $this->routeParser->parse($pattern); - // $routeDatas is an array of all possible routes that can be made. There is - // one routedata for each optional parameter plus one for no optional parameters. - // - // The most specific is last, so we look for that first. - $routeDatas = array_reverse($routeDatas); - - $segments = []; - foreach ($routeDatas as $routeData) { - foreach ($routeData as $item) { - if (is_string($item)) { - // this segment is a static string - $segments[] = $item; - continue; - } - - // This segment has a parameter: first element is the name - if (!array_key_exists($item[0], $data)) { - // we don't have a data element for this segment: cancel - // testing this routeData item, so that we can try a less - // specific routeData item. - $segments = []; - $segmentName = $item[0]; - break; - } - $segments[] = $data[$item[0]]; - } - if (!empty($segments)) { - // we found all the parameters for this route data, no need to check - // less specific ones - break; - } - } - - if (empty($segments)) { - throw new InvalidArgumentException('Missing data for URL segment: ' . $segmentName); - } - $url = implode('', $segments); - - if ($queryParams) { - $url .= '?' . http_build_query($queryParams); - } - - return $url; - } - - - /** - * Build the path for a named route including the base path - * - * @param string $name Route name - * @param array $data Named argument replacement data - * @param array $queryParams Optional query string parameters - * - * @return string - * - * @throws RuntimeException If named route does not exist - * @throws InvalidArgumentException If required data not provided - */ - public function pathFor($name, array $data = [], array $queryParams = []) - { - $url = $this->relativePathFor($name, $data, $queryParams); - - if ($this->basePath) { - $url = $this->basePath . $url; - } - - return $url; - } - - /** - * Build the path for a named route. - * - * This method is deprecated. Use pathFor() from now on. - * - * @param string $name Route name - * @param array $data Named argument replacement data - * @param array $queryParams Optional query string parameters - * - * @return string - * - * @throws RuntimeException If named route does not exist - * @throws InvalidArgumentException If required data not provided - */ - public function urlFor($name, array $data = [], array $queryParams = []) - { - trigger_error('urlFor() is deprecated. Use pathFor() instead.', E_USER_DEPRECATED); - return $this->pathFor($name, $data, $queryParams); - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/composer.json b/samples/server/petstore/php-slim/vendor/slim/slim/composer.json deleted file mode 100644 index 808eb9d3857..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/composer.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "slim/slim", - "type": "library", - "description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs", - "keywords": ["framework","micro","api","router"], - "homepage": "http://slimframework.com", - "license": "MIT", - "authors": [ - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "https://joshlockhart.com" - }, - { - "name": "Andrew Smith", - "email": "a.smith@silentworks.co.uk", - "homepage": "http://silentworks.co.uk" - }, - { - "name": "Rob Allen", - "email": "rob@akrabat.com", - "homepage": "http://akrabat.com" - }, - { - "name": "Gabriel Manricks", - "email": "gmanricks@me.com", - "homepage": "http://gabrielmanricks.com" - } - ], - "require": { - "php": ">=5.5.0", - "pimple/pimple": "^3.0", - "psr/http-message": "^1.0", - "nikic/fast-route": "^1.0", - "container-interop/container-interop": "^1.1" - }, - "require-dev": { - "squizlabs/php_codesniffer": "^2.5", - "phpunit/phpunit": "^4.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "autoload": { - "psr-4": { - "Slim\\": "Slim" - } - }, - "scripts": { - "test": [ - "@phpunit", - "@phpcs" - ], - "phpunit": "php vendor/bin/phpunit", - "phpcs": "php vendor/bin/phpcs" - } -} diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/example/.htaccess b/samples/server/petstore/php-slim/vendor/slim/slim/example/.htaccess deleted file mode 100644 index 0784bd22014..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/example/.htaccess +++ /dev/null @@ -1,12 +0,0 @@ -# Note: see https://httpd.apache.org/docs/current/howto/htaccess.html: -# -# "You should avoid using .htaccess files completely if you have access to -# httpd main server config file. Using .htaccess files slows down your Apache -# http server. Any directive that you can include in a .htaccess file is -# better set in a Directory block, as it will have the same effect with -# better performance." - -RewriteEngine On -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule ^ index.php [QSA,L] diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/example/README.md b/samples/server/petstore/php-slim/vendor/slim/slim/example/README.md deleted file mode 100644 index e4fb35982c2..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/example/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Slim example - -1. Install composer - - ```text - $ cd Slim - $ composer install - ``` - -2. Run php server - - ```text - $ cd Slim - $ php -S localhost:8888 -t example example/index.php - ``` - -3. Open browser - - Open http://localhost:8888 in your browser and you will see 'Welcome to Slim!' diff --git a/samples/server/petstore/php-slim/vendor/slim/slim/example/index.php b/samples/server/petstore/php-slim/vendor/slim/slim/example/index.php deleted file mode 100644 index ef895f83f93..00000000000 --- a/samples/server/petstore/php-slim/vendor/slim/slim/example/index.php +++ /dev/null @@ -1,45 +0,0 @@ -get('/', function ($request, $response, $args) { - $response->write("Welcome to Slim!"); - return $response; -}); - -$app->get('/hello[/{name}]', function ($request, $response, $args) { - $response->write("Hello, " . $args['name']); - return $response; -})->setArgument('name', 'World!'); - -/** - * Step 4: Run the Slim application - * - * This method should be called last. This executes the Slim application - * and returns the HTTP response to the HTTP client. - */ -$app->run(); From c01f4bf220f7c430394961c058fc8b32c7c7cfff Mon Sep 17 00:00:00 2001 From: sunn <33183834+etherealjoy@users.noreply.github.com> Date: Mon, 25 Jun 2018 05:51:24 +0200 Subject: [PATCH 31/35] [cpp-qt5] sanitize model names (#388) * Escape characters that have language significance * Remove assignment to parameter variable --- .../languages/CppQt5ClientCodegen.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java index fa3e9ca643d..f57667f5be5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java @@ -248,7 +248,7 @@ public class CppQt5ClientCodegen extends AbstractCppCodegen implements CodegenCo if (!folder.isEmpty()) folder += File.separator; - return "#include \"" + folder + name + ".h\""; + return "#include \"" + folder + toModelName(name) + ".h\""; } /** @@ -285,7 +285,7 @@ public class CppQt5ClientCodegen extends AbstractCppCodegen implements CodegenCo @Override public String toModelFilename(String name) { - return modelNamePrefix + initialCaps(name); + return initialCaps(toModelName(name)); } @Override @@ -381,7 +381,7 @@ public class CppQt5ClientCodegen extends AbstractCppCodegen implements CodegenCo @Override public String toModelName(String type) { if (type == null) { - LOGGER.warn("Model name can't be null. Defaul to 'UnknownModel'."); + LOGGER.warn("Model name can't be null. Default to 'UnknownModel'."); type = "UnknownModel"; } @@ -392,30 +392,31 @@ public class CppQt5ClientCodegen extends AbstractCppCodegen implements CodegenCo languageSpecificPrimitives.contains(type)) { return type; } else { - return modelNamePrefix + Character.toUpperCase(type.charAt(0)) + type.substring(1); + String typeName = sanitizeName(type); + return modelNamePrefix + Character.toUpperCase(typeName.charAt(0)) + typeName.substring(1); } } @Override public String toVarName(String name) { // sanitize name - name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + String varName = sanitizeName(name); // if it's all uppper case, convert to lower case - if (name.matches("^[A-Z_]*$")) { - name = name.toLowerCase(); + if (varName.matches("^[A-Z_]*$")) { + varName = varName.toLowerCase(); } // camelize (lower first character) the variable name // petId => pet_id - name = underscore(name); + varName = underscore(varName); // for reserved word or word starting with number, append _ - if (isReservedWord(name) || name.matches("^\\d.*")) { - name = escapeReservedWord(name); + if (isReservedWord(varName) || varName.matches("^\\d.*")) { + varName = escapeReservedWord(varName); } - return name; + return varName; } @Override From a0bfe2bf72851092b3d63f5a42d6e8df417a00a5 Mon Sep 17 00:00:00 2001 From: Jan Prieser Date: Mon, 25 Jun 2018 06:04:10 +0200 Subject: [PATCH 32/35] WIP: new javascript flowtyped generator (#176) New Javascript flowtyped generator --- .travis.yml | 2 +- README.md | 3 +- bin/javascript-flowtyped-petstore.sh | 32 + .../JavascriptFlowtypedClientCodegen.java | 281 ++ .../Javascript-Flowtyped/README.mustache | 41 + .../Javascript-Flowtyped/api.mustache | 266 ++ .../resources/Javascript-Flowtyped/babelrc | 4 + .../configuration.mustache | 65 + .../Javascript-Flowtyped/flowconfig.mustache | 11 + .../resources/Javascript-Flowtyped/gitignore | 1 + .../Javascript-Flowtyped/index.mustache | 5 + .../Javascript-Flowtyped/licenseInfo.mustache | 11 + .../Javascript-Flowtyped/modelEnum.mustache | 6 + .../modelGeneric.mustache | 27 + .../Javascript-Flowtyped/package.mustache | 36 + .../org.openapitools.codegen.CodegenConfig | 1 + pom.xml | 1 + .../petstore/javascript-flowtyped/.babelrc | 4 + .../petstore/javascript-flowtyped/.flowconfig | 11 + .../petstore/javascript-flowtyped/.gitignore | 1 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../petstore/javascript-flowtyped/README.md | 41 + .../petstore/javascript-flowtyped/lib/api.js | 1193 +++++ .../javascript-flowtyped/lib/api.js.flow | 1374 ++++++ .../javascript-flowtyped/lib/configuration.js | 68 + .../lib/configuration.js.flow | 76 + .../javascript-flowtyped/lib/index.js | 15 + .../javascript-flowtyped/lib/index.js.flow | 16 + .../javascript-flowtyped/package-lock.json | 4052 +++++++++++++++++ .../javascript-flowtyped/package.json | 31 + .../petstore/javascript-flowtyped/pom.xml | 46 + .../petstore/javascript-flowtyped/src/api.js | 1374 ++++++ .../javascript-flowtyped/src/configuration.js | 76 + .../javascript-flowtyped/src/index.js | 16 + 35 files changed, 9209 insertions(+), 2 deletions(-) create mode 100755 bin/javascript-flowtyped-petstore.sh create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java create mode 100644 modules/openapi-generator/src/main/resources/Javascript-Flowtyped/README.mustache create mode 100644 modules/openapi-generator/src/main/resources/Javascript-Flowtyped/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/Javascript-Flowtyped/babelrc create mode 100644 modules/openapi-generator/src/main/resources/Javascript-Flowtyped/configuration.mustache create mode 100644 modules/openapi-generator/src/main/resources/Javascript-Flowtyped/flowconfig.mustache create mode 100644 modules/openapi-generator/src/main/resources/Javascript-Flowtyped/gitignore create mode 100644 modules/openapi-generator/src/main/resources/Javascript-Flowtyped/index.mustache create mode 100644 modules/openapi-generator/src/main/resources/Javascript-Flowtyped/licenseInfo.mustache create mode 100644 modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelEnum.mustache create mode 100644 modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelGeneric.mustache create mode 100644 modules/openapi-generator/src/main/resources/Javascript-Flowtyped/package.mustache create mode 100644 samples/client/petstore/javascript-flowtyped/.babelrc create mode 100644 samples/client/petstore/javascript-flowtyped/.flowconfig create mode 100644 samples/client/petstore/javascript-flowtyped/.gitignore create mode 100644 samples/client/petstore/javascript-flowtyped/.openapi-generator-ignore create mode 100644 samples/client/petstore/javascript-flowtyped/.openapi-generator/VERSION create mode 100644 samples/client/petstore/javascript-flowtyped/README.md create mode 100644 samples/client/petstore/javascript-flowtyped/lib/api.js create mode 100644 samples/client/petstore/javascript-flowtyped/lib/api.js.flow create mode 100644 samples/client/petstore/javascript-flowtyped/lib/configuration.js create mode 100644 samples/client/petstore/javascript-flowtyped/lib/configuration.js.flow create mode 100644 samples/client/petstore/javascript-flowtyped/lib/index.js create mode 100644 samples/client/petstore/javascript-flowtyped/lib/index.js.flow create mode 100644 samples/client/petstore/javascript-flowtyped/package-lock.json create mode 100644 samples/client/petstore/javascript-flowtyped/package.json create mode 100644 samples/client/petstore/javascript-flowtyped/pom.xml create mode 100644 samples/client/petstore/javascript-flowtyped/src/api.js create mode 100644 samples/client/petstore/javascript-flowtyped/src/configuration.js create mode 100644 samples/client/petstore/javascript-flowtyped/src/index.js diff --git a/.travis.yml b/.travis.yml index fd791ca4330..87eab231b21 100644 --- a/.travis.yml +++ b/.travis.yml @@ -128,4 +128,4 @@ after_success: - if [ $DOCKER_HUB_USERNAME ]; then echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin && docker build -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/openapi-generator-cli && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest $DOCKER_CODEGEN_CLI_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME && echo "Pushed to $DOCKER_CODEGEN_CLI_IMAGE_NAME"; fi; fi env: - - DOCKER_GENERATOR_IMAGE_NAME=openapitools/openapi-generator-online DOCKER_CODEGEN_CLI_IMAGE_NAME=openapitools/openapi-generator-cli + - DOCKER_GENERATOR_IMAGE_NAME=openapitools/openapi-generator-online DOCKER_CODEGEN_CLI_IMAGE_NAME=openapitools/openapi-generator-cli NODE_ENV=test diff --git a/README.md b/README.md index 945fa485d2b..78497f7443e 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se | | Languages/Frameworks | |-|-| -**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C#** (.net 2.0, 3.5 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (AngularJS, Angular (2.x - 6.x), Aurelia, Fetch, Inversify, jQuery, Node) +**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C#** (.net 2.0, 3.5 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (AngularJS, Angular (2.x - 6.x), Aurelia, Fetch, Inversify, jQuery, Node) **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed), **Erlang**, **Go**, **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **Kotlin**, **PHP** (Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), Scalatra) **API documentation generators** | **HTML**, **Confluence Wiki** **Configuration files** | [**Apache2**](https://httpd.apache.org/) @@ -477,6 +477,7 @@ Here is a list of template creators: * Java (Rest-assured): @viclovsky * Javascript/NodeJS: @jfiala * Javascript (Closure-annotated Angular) @achew22 + * Javascript (Flow types) @jaypea * JMeter: @davidkiss * Kotlin: @jimschubert * Lua: @daurnimator diff --git a/bin/javascript-flowtyped-petstore.sh b/bin/javascript-flowtyped-petstore.sh new file mode 100755 index 00000000000..8918e4d4d4f --- /dev/null +++ b/bin/javascript-flowtyped-petstore.sh @@ -0,0 +1,32 @@ +#!/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 -B 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/Javascript-Flowtyped -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g javascript-flowtyped -o samples/client/petstore/javascript-flowtyped -DappName=PetstoreClient $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java new file mode 100644 index 00000000000..bb415e2bc41 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptFlowtypedClientCodegen.java @@ -0,0 +1,281 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.parser.util.SchemaTypeUtil; +import org.openapitools.codegen.*; +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.utils.ModelUtils; + +import java.text.SimpleDateFormat; +import java.util.*; + +public class JavascriptFlowtypedClientCodegen extends AbstractTypeScriptClientCodegen { + private static final SimpleDateFormat SNAPSHOT_SUFFIX_FORMAT = new SimpleDateFormat("yyyyMMddHHmm"); + + public static final String NPM_NAME = "npmName"; + public static final String NPM_VERSION = "npmVersion"; + public static final String NPM_REPOSITORY = "npmRepository"; + public static final String SNAPSHOT = "snapshot"; + + protected String npmName = null; + protected String npmVersion = "1.0.0"; + protected String npmRepository = null; + + public JavascriptFlowtypedClientCodegen() { + super(); + + // clear import mapping (from default generator) as TS does not use it + // at the moment + importMapping.clear(); + + setReservedWordsLowerCase(Arrays.asList( + // local variable names used in API methods (endpoints) + "varLocalPath", "queryParameters", "headerParams", "formParams", "useFormData", "varLocalDeferred", + "requestOptions", + // Typescript reserved words + "abstract", "arguments", "boolean", "break", "byte", + "case", "catch", "char", "class", "const", + "continue", "debugger", "default", "delete", "do", + "double", "else", "enum", "eval", "export", + "extends", "false", "final", "finally", "float", + "for", "function", "goto", "if", "implements", + "import", "in", "instanceof", "int", "interface", + "let", "long", "native", "new", "null", + "package", "private", "protected", "public", "return", + "short", "static", "super", "switch", "synchronized", + "this", "throw", "throws", "transient", "true", + "try", "typeof", "var", "void", "volatile", + "while", "with", "yield", + "Array", "Date", "eval", "function", "hasOwnProperty", + "Infinity", "isFinite", "isNaN", "isPrototypeOf", + "Math", "NaN", "Number", "Object", + "prototype", "String", "toString", "undefined", "valueOf")); + + languageSpecificPrimitives = new HashSet( + Arrays.asList("string", "boolean", "number", "Array", "Object", "Date", "File", "Blob") + ); + + instantiationTypes.put("array", "Array"); + instantiationTypes.put("list", "Array"); + instantiationTypes.put("map", "Object"); + typeMapping.clear(); + typeMapping.put("array", "Array"); + typeMapping.put("map", "Object"); + typeMapping.put("List", "Array"); + typeMapping.put("boolean", "boolean"); + typeMapping.put("string", "string"); + typeMapping.put("int", "number"); + typeMapping.put("float", "number"); + typeMapping.put("number", "number"); + typeMapping.put("DateTime", "Date"); + typeMapping.put("date", "Date"); + typeMapping.put("long", "number"); + typeMapping.put("short", "number"); + typeMapping.put("char", "string"); + typeMapping.put("double", "number"); + typeMapping.put("object", "Object"); + typeMapping.put("integer", "number"); + // file, binary not supported in JS client right now, using String as a workaround + typeMapping.put("file", "string"); + typeMapping.put("binary", "string"); + typeMapping.put("ByteArray", "string"); + typeMapping.put("UUID", "string"); + + defaultIncludes = new HashSet(languageSpecificPrimitives); + outputFolder = "generated-code/javascript-flowtyped"; + embeddedTemplateDir = templateDir = "Javascript-Flowtyped"; + + this.cliOptions.add(new CliOption(NPM_NAME, "The name under which you want to publish generated npm package")); + this.cliOptions.add(new CliOption(NPM_VERSION, "The version of your npm package")); + this.cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json")); + this.cliOptions.add(new CliOption(SNAPSHOT, "When setting this property to true the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); + + } + + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + @Override + protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) { + codegenModel.additionalPropertiesType = getTypeDeclaration((Schema) schema.getAdditionalProperties()); + addImport(codegenModel, codegenModel.additionalPropertiesType); + } + + @Override + public void processOpts() { + super.processOpts(); + supportingFiles.add(new SupportingFile("index.mustache", "src", "index.js")); + supportingFiles.add(new SupportingFile("api.mustache", "src", "api.js")); + supportingFiles.add(new SupportingFile("configuration.mustache", "src", "configuration.js")); + supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); + + addNpmPackageGeneration(); + } + + @Override + public String getTypeDeclaration(Schema p) { + Schema inner; + if (ModelUtils.isArraySchema(p)) { + inner = ((ArraySchema) p).getItems(); + return this.getSchemaType(p) + "<" + this.getTypeDeclaration(inner) + ">"; + } else if (ModelUtils.isMapSchema(p)) { + inner = (Schema) p.getAdditionalProperties(); + return "{ [key: string]: " + this.getTypeDeclaration(inner) + "; }"; + } else if (ModelUtils.isFileSchema(p)) { + return "any"; + } else if (ModelUtils.isBinarySchema(p)) { + return "any"; + } else { + return super.getTypeDeclaration(p); + } + } + + private void addNpmPackageGeneration() { + if (additionalProperties.containsKey(NPM_NAME)) { + this.setNpmName(additionalProperties.get(NPM_NAME).toString()); + } + + if (additionalProperties.containsKey(NPM_VERSION)) { + this.setNpmVersion(additionalProperties.get(NPM_VERSION).toString()); + } + + if (additionalProperties.containsKey(SNAPSHOT) && Boolean.valueOf(additionalProperties.get(SNAPSHOT).toString())) { + this.setNpmVersion(npmVersion + "-SNAPSHOT." + SNAPSHOT_SUFFIX_FORMAT.format(new Date())); + } + additionalProperties.put(NPM_VERSION, npmVersion); + + if (additionalProperties.containsKey(NPM_REPOSITORY)) { + this.setNpmRepository(additionalProperties.get(NPM_REPOSITORY).toString()); + } + + //Files for building our lib + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("package.mustache", "", "package.json")); + supportingFiles.add(new SupportingFile("flowconfig.mustache", "", ".flowconfig")); + supportingFiles.add(new SupportingFile("babelrc", "", ".babelrc")); + } + + @Override + public void preprocessOpenAPI(OpenAPI openAPI) { + super.preprocessOpenAPI(openAPI); + + if (openAPI.getInfo() != null) { + Info info = openAPI.getInfo(); + if (StringUtils.isBlank(npmName) && info.getTitle() != null) { + // when projectName is not specified, generate it from info.title + npmName = sanitizeName(dashize(info.getTitle())); + } + if (StringUtils.isBlank(npmVersion)) { + // when projectVersion is not specified, use info.version + npmVersion = escapeUnsafeCharacters(escapeQuotationMark(info.getVersion())); + } + } + + // default values + if (StringUtils.isBlank(npmName)) { + npmName = "openapi-js-client"; + } + if (StringUtils.isBlank(npmVersion)) { + npmVersion = "1.0.0"; + } + + additionalProperties.put(NPM_NAME, npmName); + additionalProperties.put(NPM_VERSION, npmVersion); + additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage); + } + + @Override + public Map postProcessModels(Map objs) { + // process enum in models + List models = (List) postProcessModelsEnum(objs).get("models"); + for (Object _mo : models) { + Map mo = (Map) _mo; + CodegenModel cm = (CodegenModel) mo.get("model"); + cm.imports = new TreeSet(cm.imports); + // name enum with model name, e.g. StatusEnum => Pet.StatusEnum + for (CodegenProperty var : cm.vars) { + if (Boolean.TRUE.equals(var.isEnum)) { + var.datatypeWithEnum = var.datatypeWithEnum.replace(var.enumName, cm.classname + "" + var.enumName); + } + } + if (cm.parent != null) { + for (CodegenProperty var : cm.allVars) { + if (Boolean.TRUE.equals(var.isEnum)) { + var.datatypeWithEnum = var.datatypeWithEnum + .replace(var.enumName, cm.classname + "" + var.enumName); + } + } + } + } + + return objs; + } + + @Override + public String escapeQuotationMark(String input) { + // remove ', " to avoid code injection + return input.replace("\"", "").replace("'", ""); + } + + @Override + public String escapeUnsafeCharacters(String input) { + return input.replace("*/", "*_/").replace("/*", "/_*"); + } + + @Override + public String getName() { + return "javascript-flowtyped"; + } + + @Override + public String getHelp() { + return "Generates a Javascript client library (beta) using Flow types and Fetch API."; + } + + public String getNpmName() { + return npmName; + } + + public void setNpmName(String npmName) { + this.npmName = npmName; + } + + public String getNpmVersion() { + return npmVersion; + } + + public void setNpmVersion(String npmVersion) { + this.npmVersion = npmVersion; + } + + public String getNpmRepository() { + return npmRepository; + } + + public void setNpmRepository(String npmRepository) { + this.npmRepository = npmRepository; + } + +} diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/README.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/README.mustache new file mode 100644 index 00000000000..f13c6322bb9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/README.mustache @@ -0,0 +1,41 @@ +## {{npmName}}@{{npmVersion}} + +This generator creates Flow typed JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: + +Environment +* Node.js +* Webpack +* Browserify + +Language level +* ES6 + +Module system +* ES6 module system + +### Building + +To build an compile the flow typed sources to javascript use: +``` +npm install +npm run build +``` + +### Publishing + +First build the package then run ```npm publish``` + +### Consuming + +navigate to the folder of your consuming project and run one of the following commands. + +_published:_ + +``` +npm install {{npmName}}@{{npmVersion}} --save +``` + +_unPublished (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE --save diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/api.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/api.mustache new file mode 100644 index 00000000000..0d5bfc94e42 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/api.mustache @@ -0,0 +1,266 @@ +// @flow +/* eslint-disable no-use-before-define */ +{{>licenseInfo}} + +import * as url from "url"; +import * as portableFetch from "portable-fetch"; +import { Configuration } from "./configuration"; + +const BASE_PATH: string = "{{{basePath}}}".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + */ +export type FetchAPI = { + (url: string, init?: any): Promise; +} + +/** + * + * @export + */ +export type FetchArgs = { + url: string; + options: {}; +} + + +/** + * + * @export + */ +export type RequestOptions = { + headers?: {}; + query?: {}; + body?: string | FormData; +} + +/** + * * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name:string = "RequiredError" + constructor(field: string, msg?: string) { + super(msg); + } +} + +{{#models}} +{{#model}}{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>modelGeneric}}{{/isEnum}}{{/model}} +{{/models}} + +{{#apiInfo}}{{#apis}}{{#operations}} +/** + * {{classname}} - fetch parameter creator{{#description}} + * {{&description}}{{/description}} + * @export + */ +export const {{classname}}FetchParamCreator = function (configuration?: Configuration) { + return { + {{#operation}} + /** + * {{¬es}} + {{#summary}} + * @summary {{&summary}} + {{/summary}} + * @throws {RequiredError} + */ + {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options: RequestOptions): FetchArgs { + {{#allParams}} + {{#required}} + // verify required parameter '{{paramName}}' is not null or undefined + if ({{paramName}} === null || {{paramName}} === undefined) { + throw new RequiredError('{{paramName}}','Required parameter {{paramName}} was null or undefined when calling {{nickname}}.'); + } + {{/required}} + {{/allParams}} + const localVarPath = `{{{path}}}`{{#pathParams}} + .replace(`{${"{{baseName}}"}}`, encodeURIComponent(String({{paramName}}))){{/pathParams}}; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: '{{httpMethod}}' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + {{#hasFormParams}} + const localVarFormParams = new FormData(); + {{/hasFormParams}} + + {{#authMethods}} + // authentication {{name}} required + {{#isApiKey}} + {{#isKeyInHeader}} + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("{{keyParamName}}") + : configuration.apiKey; + localVarHeaderParameter["{{keyParamName}}"] = localVarApiKeyValue; + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("{{keyParamName}}") + : configuration.apiKey; + localVarQueryParameter["{{keyParamName}}"] = localVarApiKeyValue; + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasic}} + // http basic authentication required + if (configuration && (configuration.username || configuration.password)) { + localVarHeaderParameter["Authorization"] = "Basic " + btoa(configuration.username + ":" + configuration.password); + } + {{/isBasic}} + {{#isOAuth}} + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("{{name}}", [{{#scopes}}"{{{scope}}}"{{^-last}}, {{/-last}}{{/scopes}}]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + {{/isOAuth}} + + {{/authMethods}} + {{#queryParams}} + {{#isListContainer}} + if ({{paramName}}) { + {{#isCollectionFormatMulti}} + localVarQueryParameter['{{baseName}}'] = {{paramName}}; + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} + localVarQueryParameter['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"]); + {{/isCollectionFormatMulti}} + } + {{/isListContainer}} + {{^isListContainer}} + if ({{paramName}} !== undefined) { + {{#isDateTime}} + localVarQueryParameter['{{baseName}}'] = (({{paramName}}:any):Date).toISOString(); + {{/isDateTime}} + {{^isDateTime}} + {{#isDate}} + localVarQueryParameter['{{baseName}}'] = (({{paramName}}:any):Date).toISOString(); + {{/isDate}} + {{^isDate}} + localVarQueryParameter['{{baseName}}'] = (({{paramName}}:any):string); + {{/isDate}} + {{/isDateTime}} + } + {{/isListContainer}} + + {{/queryParams}} + {{#headerParams}} + {{#isListContainer}} + if ({{paramName}}) { + localVarHeaderParameter['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"]); + } + {{/isListContainer}} + {{^isListContainer}} + if ({{paramName}} !== undefined && {{paramName}} !== null) { + localVarHeaderParameter['{{baseName}}'] = (({{paramName}}:any):string); + } + {{/isListContainer}} + + {{/headerParams}} + {{#formParams}} + {{#isListContainer}} + if ({{paramName}}) { + {{#isCollectionFormatMulti}} + {{paramName}}.forEach((element) => { + localVarFormParams.append('{{baseName}}', element); + }) + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} + localVarFormParams.set('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"])); + {{/isCollectionFormatMulti}} + } + {{/isListContainer}} + {{^isListContainer}} + if ({{paramName}} !== undefined) { + localVarFormParams.set('{{baseName}}', (({{paramName}}:any):string)); + } + {{/isListContainer}} + + {{/formParams}} + {{#bodyParam}} + {{^consumes}} + localVarHeaderParameter['Content-Type'] = 'application/json'; + {{/consumes}} + {{#consumes.0}} + localVarHeaderParameter['Content-Type'] = '{{{mediaType}}}'; + {{/consumes.0}} + + {{/bodyParam}} + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + {{#hasFormParams}} + localVarRequestOptions.body = localVarFormParams; + {{/hasFormParams}} + {{#bodyParam}} + const needsSerialization = (typeof {{paramName}} !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify({{paramName}} || {}) : ((({{paramName}}:any):string) || ""); + {{/bodyParam}} + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + {{/operation}} + } +}; + +export type {{classname}}Type = { {{#operation}} + {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: RequestOptions): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Response{{/returnType}}>, + {{/operation}} +} + +/** + * {{classname}} - factory function to inject configuration {{#description}} + * {{{description}}}{{/description}} + * @export + */ +export const {{classname}} = function(configuration?: Configuration, fetch: FetchAPI = portableFetch): {{classname}}Type { + const basePath: string = (configuration && configuration.basePath) || BASE_PATH; + return { + {{#operation}} + /** + * {{¬es}} + {{#summary}} + * @summary {{&summary}} + {{/summary}} + * @throws {RequiredError} + */ + {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: RequestOptions = {}): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Response{{/returnType}}> { + const localVarFetchArgs = {{classname}}FetchParamCreator(configuration).{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response{{#returnType}}.json(){{/returnType}}; + } else { + throw response; + } + }); + }, + {{/operation}} + } +}; +{{/operations}}{{/apis}}{{/apiInfo}} +export type ApiTypes = { {{#apiInfo}}{{#apis}}{{#operations}} + {{classname}}: {{classname}}Type, +{{/operations}}{{/apis}}{{/apiInfo}} } diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/babelrc b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/babelrc new file mode 100644 index 00000000000..75148dc5edb --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/babelrc @@ -0,0 +1,4 @@ +{ + "presets": ["react-app"], + "plugins": ["transform-flow-strip-types"] +} diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/configuration.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/configuration.mustache new file mode 100644 index 00000000000..4c6144d5d47 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/configuration.mustache @@ -0,0 +1,65 @@ +// @flow +{{>licenseInfo}} + +export type ConfigurationParameters = { + apiKey?: string | (name: string) => string; + username?: string; + password?: string; + accessToken?: string | (name: string, scopes?: string[]) => string; + basePath?: string; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey: string | (name: string) => string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken: string | ((name: string, scopes?: string[]) => string); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath: string; + + constructor(param: ConfigurationParameters = {}) { + if (param.apiKey) { + this.apiKey = param.apiKey; + } + if (param.username) { + this.username = param.username; + } + if (param.password) { + this.password = param.password; + } + if (param.accessToken) { + this.accessToken = param.accessToken; + } + if (param.basePath) { + this.basePath = param.basePath; + } + } +} diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/flowconfig.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/flowconfig.mustache new file mode 100644 index 00000000000..1fed445333e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/flowconfig.mustache @@ -0,0 +1,11 @@ +[ignore] + +[include] + +[libs] + +[lints] + +[options] + +[strict] diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/gitignore b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/gitignore new file mode 100644 index 00000000000..3c3629e647f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/gitignore @@ -0,0 +1 @@ +node_modules diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/index.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/index.mustache new file mode 100644 index 00000000000..44d58c71f1b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/index.mustache @@ -0,0 +1,5 @@ +// @flow +{{>licenseInfo}} + +export * from "./api"; +export * from "./configuration"; diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/licenseInfo.mustache new file mode 100644 index 00000000000..bbd8742e52a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/licenseInfo.mustache @@ -0,0 +1,11 @@ +/** + * {{{appName}}} + * {{{appDescription}}} + * + * {{#version}}OpenAPI spec version: {{{version}}}{{/version}} + * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelEnum.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelEnum.mustache new file mode 100644 index 00000000000..8b427630ff0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelEnum.mustache @@ -0,0 +1,6 @@ +/** + * {{{description}}} + * @export + * @enum {string} + */ +export type {{classname}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}} | {{/-last}}{{/enumVars}}{{/allowableValues}}; diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelGeneric.mustache new file mode 100644 index 00000000000..a1ada999736 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelGeneric.mustache @@ -0,0 +1,27 @@ +{{#hasEnums}} + {{#vars}} + {{#isEnum}} + + export type {{classname}}{{enumName}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}} | {{/-last}}{{/enumVars}}{{/allowableValues}}; + {{/isEnum}} + {{/vars}} +{{/hasEnums}} +/** + * {{{description}}} + * @export + */ +export type {{classname}} = { +{{#additionalPropertiesType}} + [key: string]: {{{additionalPropertiesType}}}{{#hasVars}} | any{{/hasVars}}; + +{{/additionalPropertiesType}} +{{#vars}} + /** + * {{{description}}} + * @type {{=<% %>=}}{<%&datatype%>}<%={{ }}=%> + * @memberof {{classname}} + */ + {{name}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{/isEnum}}; +{{/vars}} +} + diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/package.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/package.mustache new file mode 100644 index 00000000000..f936cba54dc --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/package.mustache @@ -0,0 +1,36 @@ +{ + "name": "{{npmName}}", + "version": "{{npmVersion}}", + "description": "swagger client for {{npmName}}", + "author": "Swagger Codegen Contributors", + "keywords": [ + "fetch", + "flow", + "swagger-client", + "{{npmName}}" + ], + "license": "Unlicense", + "main": "./lib/index.js", + "scripts": { + "build": "npm run build:clean && npm run build:lib && npm run build:flow", + "build:clean": "rimraf lib", + "build:lib": "node_modules/.bin/babel -d lib src --ignore '**/__tests__/**'", + "build:flow": "flow-copy-source -v -i '**/__tests__/**' src lib" + }, + "dependencies": { + "portable-fetch": "^3.0.0" + }, + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.3", + "babel-plugin-transform-flow-strip-types": "^6.22.0", + "babel-preset-react-app": "^3.1.1", + "flow-copy-source": "^1.3.0", + "rimraf": "^2.6.2" + }{{#npmRepository}},{{/npmRepository}} +{{#npmRepository}} + "publishConfig":{ + "registry":"{{npmRepository}}" + } +{{/npmRepository}} +} diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 85e298d431d..f17eb35a5b0 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -45,6 +45,7 @@ org.openapitools.codegen.languages.JavaResteasyServerCodegen org.openapitools.codegen.languages.JavaResteasyEapServerCodegen org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen org.openapitools.codegen.languages.JavascriptClientCodegen +org.openapitools.codegen.languages.JavascriptFlowtypedClientCodegen org.openapitools.codegen.languages.JavascriptClosureAngularClientCodegen org.openapitools.codegen.languages.JMeterCodegen org.openapitools.codegen.languages.LuaClientCodegen diff --git a/pom.xml b/pom.xml index 2ed6942495b..b7040100d01 100644 --- a/pom.xml +++ b/pom.xml @@ -941,6 +941,7 @@ samples/client/petstore/javascript-es6 samples/client/petstore/javascript-promise samples/client/petstore/javascript-promise-es6 + samples/client/petstore/javascript-flowtyped samples/client/petstore/python samples/client/petstore/python-tornado samples/client/petstore/python-asyncio diff --git a/samples/client/petstore/javascript-flowtyped/.babelrc b/samples/client/petstore/javascript-flowtyped/.babelrc new file mode 100644 index 00000000000..75148dc5edb --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/.babelrc @@ -0,0 +1,4 @@ +{ + "presets": ["react-app"], + "plugins": ["transform-flow-strip-types"] +} diff --git a/samples/client/petstore/javascript-flowtyped/.flowconfig b/samples/client/petstore/javascript-flowtyped/.flowconfig new file mode 100644 index 00000000000..1fed445333e --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/.flowconfig @@ -0,0 +1,11 @@ +[ignore] + +[include] + +[libs] + +[lints] + +[options] + +[strict] diff --git a/samples/client/petstore/javascript-flowtyped/.gitignore b/samples/client/petstore/javascript-flowtyped/.gitignore new file mode 100644 index 00000000000..3c3629e647f --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/samples/client/petstore/javascript-flowtyped/.openapi-generator-ignore b/samples/client/petstore/javascript-flowtyped/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/javascript-flowtyped/.openapi-generator/VERSION b/samples/client/petstore/javascript-flowtyped/.openapi-generator/VERSION new file mode 100644 index 00000000000..096bf47efe3 --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/.openapi-generator/VERSION @@ -0,0 +1 @@ +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-flowtyped/README.md b/samples/client/petstore/javascript-flowtyped/README.md new file mode 100644 index 00000000000..f9b11cbd029 --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/README.md @@ -0,0 +1,41 @@ +## open_api_petstore@1.0.0 + +This generator creates Flow typed JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: + +Environment +* Node.js +* Webpack +* Browserify + +Language level +* ES6 + +Module system +* ES6 module system + +### Building + +To build an compile the flow typed sources to javascript use: +``` +npm install +npm run build +``` + +### Publishing + +First build the package then run ```npm publish``` + +### Consuming + +navigate to the folder of your consuming project and run one of the following commands. + +_published:_ + +``` +npm install open_api_petstore@1.0.0 --save +``` + +_unPublished (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE --save diff --git a/samples/client/petstore/javascript-flowtyped/lib/api.js b/samples/client/petstore/javascript-flowtyped/lib/api.js new file mode 100644 index 00000000000..6a62fd1a7be --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/lib/api.js @@ -0,0 +1,1193 @@ +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/* eslint-disable no-use-before-define */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import * as url from "url"; +import * as portableFetch from "portable-fetch"; +import { Configuration } from "./configuration"; + +var BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); + +/** + * + * @export + */ +export var COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|" +}; + +/** + * + * @export + */ + + +/** + * + * @export + */ + + +/** + * + * @export + */ + + +/** + * * @export + * @class RequiredError + * @extends {Error} + */ +export var RequiredError = function (_Error) { + _inherits(RequiredError, _Error); + + function RequiredError(field, msg) { + _classCallCheck(this, RequiredError); + + var _this = _possibleConstructorReturn(this, (RequiredError.__proto__ || Object.getPrototypeOf(RequiredError)).call(this, msg)); + + _this.name = "RequiredError"; + return _this; + } + + return RequiredError; +}(Error); + +/** + * Describes the result of uploading an image resource + * @export + */ + + +/** + * A category for a pet + * @export + */ + +/** + * An order for a pets from the pet store + * @export + */ + +/** + * A pet for sale in the pet store + * @export + */ + + +/** + * A tag for a pet + * @export + */ + + +/** + * A User who is purchasing from the pet store + * @export + */ + + +/** + * PetApi - fetch parameter creator + * @export + */ +export var PetApiFetchParamCreator = function PetApiFetchParamCreator(configuration) { + return { + /** + * + * @summary Add a new pet to the store + * @throws {RequiredError} + */ + addPet: function addPet(pet, options) { + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new RequiredError('pet', 'Required parameter pet was null or undefined when calling addPet.'); + } + var localVarPath = "/pet"; + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'POST' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + var localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + var needsSerialization = typeof pet !== "string" || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(pet || {}) : pet || ""; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * + * @summary Deletes a pet + * @throws {RequiredError} + */ + deletePet: function deletePet(petId, apiKey, options) { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId', 'Required parameter petId was null or undefined when calling deletePet.'); + } + var localVarPath = "/pet/{petId}".replace("{" + "petId" + "}", encodeURIComponent(String(petId))); + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'DELETE' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + var localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (apiKey !== undefined && apiKey !== null) { + localVarHeaderParameter['api_key'] = apiKey; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @throws {RequiredError} + */ + findPetsByStatus: function findPetsByStatus(status, options) { + // verify required parameter 'status' is not null or undefined + if (status === null || status === undefined) { + throw new RequiredError('status', 'Required parameter status was null or undefined when calling findPetsByStatus.'); + } + var localVarPath = "/pet/findByStatus"; + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'GET' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + var localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (status) { + localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS["csv"]); + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @throws {RequiredError} + */ + findPetsByTags: function findPetsByTags(tags, options) { + // verify required parameter 'tags' is not null or undefined + if (tags === null || tags === undefined) { + throw new RequiredError('tags', 'Required parameter tags was null or undefined when calling findPetsByTags.'); + } + var localVarPath = "/pet/findByTags"; + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'GET' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + var localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (tags) { + localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS["csv"]); + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * Returns a single pet + * @summary Find pet by ID + * @throws {RequiredError} + */ + getPetById: function getPetById(petId, options) { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId', 'Required parameter petId was null or undefined when calling getPetById.'); + } + var localVarPath = "/pet/{petId}".replace("{" + "petId" + "}", encodeURIComponent(String(petId))); + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'GET' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + // authentication api_key required + if (configuration && configuration.apiKey) { + var localVarApiKeyValue = typeof configuration.apiKey === 'function' ? configuration.apiKey("api_key") : configuration.apiKey; + localVarHeaderParameter["api_key"] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * + * @summary Update an existing pet + * @throws {RequiredError} + */ + updatePet: function updatePet(pet, options) { + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new RequiredError('pet', 'Required parameter pet was null or undefined when calling updatePet.'); + } + var localVarPath = "/pet"; + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'PUT' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + var localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + var needsSerialization = typeof pet !== "string" || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(pet || {}) : pet || ""; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * + * @summary Updates a pet in the store with form data + * @throws {RequiredError} + */ + updatePetWithForm: function updatePetWithForm(petId, name, status, options) { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId', 'Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + var localVarPath = "/pet/{petId}".replace("{" + "petId" + "}", encodeURIComponent(String(petId))); + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'POST' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + var localVarFormParams = new FormData(); + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + var localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (name !== undefined) { + localVarFormParams.set('name', name); + } + + if (status !== undefined) { + localVarFormParams.set('status', status); + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = localVarFormParams; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * + * @summary uploads an image + * @throws {RequiredError} + */ + uploadFile: function uploadFile(petId, additionalMetadata, file, options) { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId', 'Required parameter petId was null or undefined when calling uploadFile.'); + } + var localVarPath = "/pet/{petId}/uploadImage".replace("{" + "petId" + "}", encodeURIComponent(String(petId))); + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'POST' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + var localVarFormParams = new FormData(); + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + var localVarAccessTokenValue = typeof configuration.accessToken === 'function' ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (additionalMetadata !== undefined) { + localVarFormParams.set('additionalMetadata', additionalMetadata); + } + + if (file !== undefined) { + localVarFormParams.set('file', file); + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = localVarFormParams; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + } + }; +}; + +/** + * PetApi - factory function to inject configuration + * @export + */ +export var PetApi = function PetApi(configuration) { + var fetch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : portableFetch; + + var basePath = configuration && configuration.basePath || BASE_PATH; + return { + /** + * + * @summary Add a new pet to the store + * @throws {RequiredError} + */ + addPet: function addPet(pet) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var localVarFetchArgs = PetApiFetchParamCreator(configuration).addPet(pet, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + + /** + * + * @summary Deletes a pet + * @throws {RequiredError} + */ + deletePet: function deletePet(petId, apiKey) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var localVarFetchArgs = PetApiFetchParamCreator(configuration).deletePet(petId, apiKey, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @throws {RequiredError} + */ + findPetsByStatus: function findPetsByStatus(status) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var localVarFetchArgs = PetApiFetchParamCreator(configuration).findPetsByStatus(status, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @throws {RequiredError} + */ + findPetsByTags: function findPetsByTags(tags) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var localVarFetchArgs = PetApiFetchParamCreator(configuration).findPetsByTags(tags, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + + /** + * Returns a single pet + * @summary Find pet by ID + * @throws {RequiredError} + */ + getPetById: function getPetById(petId) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var localVarFetchArgs = PetApiFetchParamCreator(configuration).getPetById(petId, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + + /** + * + * @summary Update an existing pet + * @throws {RequiredError} + */ + updatePet: function updatePet(pet) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePet(pet, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + + /** + * + * @summary Updates a pet in the store with form data + * @throws {RequiredError} + */ + updatePetWithForm: function updatePetWithForm(petId, name, status) { + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + + var localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePetWithForm(petId, name, status, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + + /** + * + * @summary uploads an image + * @throws {RequiredError} + */ + uploadFile: function uploadFile(petId, additionalMetadata, file) { + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + + var localVarFetchArgs = PetApiFetchParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + } + }; +}; + +/** + * StoreApi - fetch parameter creator + * @export + */ +export var StoreApiFetchParamCreator = function StoreApiFetchParamCreator(configuration) { + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @throws {RequiredError} + */ + deleteOrder: function deleteOrder(orderId, options) { + // verify required parameter 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new RequiredError('orderId', 'Required parameter orderId was null or undefined when calling deleteOrder.'); + } + var localVarPath = "/store/order/{orderId}".replace("{" + "orderId" + "}", encodeURIComponent(String(orderId))); + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'DELETE' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @throws {RequiredError} + */ + getInventory: function getInventory(options) { + var localVarPath = "/store/inventory"; + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'GET' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + // authentication api_key required + if (configuration && configuration.apiKey) { + var localVarApiKeyValue = typeof configuration.apiKey === 'function' ? configuration.apiKey("api_key") : configuration.apiKey; + localVarHeaderParameter["api_key"] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @throws {RequiredError} + */ + getOrderById: function getOrderById(orderId, options) { + // verify required parameter 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new RequiredError('orderId', 'Required parameter orderId was null or undefined when calling getOrderById.'); + } + var localVarPath = "/store/order/{orderId}".replace("{" + "orderId" + "}", encodeURIComponent(String(orderId))); + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'GET' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * + * @summary Place an order for a pet + * @throws {RequiredError} + */ + placeOrder: function placeOrder(order, options) { + // verify required parameter 'order' is not null or undefined + if (order === null || order === undefined) { + throw new RequiredError('order', 'Required parameter order was null or undefined when calling placeOrder.'); + } + var localVarPath = "/store/order"; + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'POST' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + var needsSerialization = typeof order !== "string" || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(order || {}) : order || ""; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + } + }; +}; + +/** + * StoreApi - factory function to inject configuration + * @export + */ +export var StoreApi = function StoreApi(configuration) { + var fetch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : portableFetch; + + var basePath = configuration && configuration.basePath || BASE_PATH; + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @throws {RequiredError} + */ + deleteOrder: function deleteOrder(orderId) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var localVarFetchArgs = StoreApiFetchParamCreator(configuration).deleteOrder(orderId, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @throws {RequiredError} + */ + getInventory: function getInventory() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var localVarFetchArgs = StoreApiFetchParamCreator(configuration).getInventory(options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @throws {RequiredError} + */ + getOrderById: function getOrderById(orderId) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var localVarFetchArgs = StoreApiFetchParamCreator(configuration).getOrderById(orderId, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + + /** + * + * @summary Place an order for a pet + * @throws {RequiredError} + */ + placeOrder: function placeOrder(order) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var localVarFetchArgs = StoreApiFetchParamCreator(configuration).placeOrder(order, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + } + }; +}; + +/** + * UserApi - fetch parameter creator + * @export + */ +export var UserApiFetchParamCreator = function UserApiFetchParamCreator(configuration) { + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @throws {RequiredError} + */ + createUser: function createUser(user, options) { + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError('user', 'Required parameter user was null or undefined when calling createUser.'); + } + var localVarPath = "/user"; + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'POST' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + var needsSerialization = typeof user !== "string" || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(user || {}) : user || ""; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * + * @summary Creates list of users with given input array + * @throws {RequiredError} + */ + createUsersWithArrayInput: function createUsersWithArrayInput(user, options) { + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError('user', 'Required parameter user was null or undefined when calling createUsersWithArrayInput.'); + } + var localVarPath = "/user/createWithArray"; + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'POST' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + var needsSerialization = typeof user !== "string" || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(user || {}) : user || ""; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * + * @summary Creates list of users with given input array + * @throws {RequiredError} + */ + createUsersWithListInput: function createUsersWithListInput(user, options) { + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError('user', 'Required parameter user was null or undefined when calling createUsersWithListInput.'); + } + var localVarPath = "/user/createWithList"; + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'POST' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + var needsSerialization = typeof user !== "string" || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(user || {}) : user || ""; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * This can only be done by the logged in user. + * @summary Delete user + * @throws {RequiredError} + */ + deleteUser: function deleteUser(username, options) { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username', 'Required parameter username was null or undefined when calling deleteUser.'); + } + var localVarPath = "/user/{username}".replace("{" + "username" + "}", encodeURIComponent(String(username))); + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'DELETE' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * + * @summary Get user by user name + * @throws {RequiredError} + */ + getUserByName: function getUserByName(username, options) { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username', 'Required parameter username was null or undefined when calling getUserByName.'); + } + var localVarPath = "/user/{username}".replace("{" + "username" + "}", encodeURIComponent(String(username))); + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'GET' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * + * @summary Logs user into the system + * @throws {RequiredError} + */ + loginUser: function loginUser(username, password, options) { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username', 'Required parameter username was null or undefined when calling loginUser.'); + } + // verify required parameter 'password' is not null or undefined + if (password === null || password === undefined) { + throw new RequiredError('password', 'Required parameter password was null or undefined when calling loginUser.'); + } + var localVarPath = "/user/login"; + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'GET' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + if (username !== undefined) { + localVarQueryParameter['username'] = username; + } + + if (password !== undefined) { + localVarQueryParameter['password'] = password; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * + * @summary Logs out current logged in user session + * @throws {RequiredError} + */ + logoutUser: function logoutUser(options) { + var localVarPath = "/user/logout"; + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'GET' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + }, + + /** + * This can only be done by the logged in user. + * @summary Updated user + * @throws {RequiredError} + */ + updateUser: function updateUser(username, user, options) { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username', 'Required parameter username was null or undefined when calling updateUser.'); + } + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError('user', 'Required parameter user was null or undefined when calling updateUser.'); + } + var localVarPath = "/user/{username}".replace("{" + "username" + "}", encodeURIComponent(String(username))); + var localVarUrlObj = url.parse(localVarPath, true); + var localVarRequestOptions = Object.assign({}, { method: 'PUT' }, options); + var localVarHeaderParameter = {}; + var localVarQueryParameter = {}; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + var needsSerialization = typeof user !== "string" || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(user || {}) : user || ""; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions + }; + } + }; +}; + +/** + * UserApi - factory function to inject configuration + * @export + */ +export var UserApi = function UserApi(configuration) { + var fetch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : portableFetch; + + var basePath = configuration && configuration.basePath || BASE_PATH; + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @throws {RequiredError} + */ + createUser: function createUser(user) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var localVarFetchArgs = UserApiFetchParamCreator(configuration).createUser(user, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + + /** + * + * @summary Creates list of users with given input array + * @throws {RequiredError} + */ + createUsersWithArrayInput: function createUsersWithArrayInput(user) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithArrayInput(user, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + + /** + * + * @summary Creates list of users with given input array + * @throws {RequiredError} + */ + createUsersWithListInput: function createUsersWithListInput(user) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithListInput(user, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + + /** + * This can only be done by the logged in user. + * @summary Delete user + * @throws {RequiredError} + */ + deleteUser: function deleteUser(username) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var localVarFetchArgs = UserApiFetchParamCreator(configuration).deleteUser(username, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + + /** + * + * @summary Get user by user name + * @throws {RequiredError} + */ + getUserByName: function getUserByName(username) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var localVarFetchArgs = UserApiFetchParamCreator(configuration).getUserByName(username, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + + /** + * + * @summary Logs user into the system + * @throws {RequiredError} + */ + loginUser: function loginUser(username, password) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var localVarFetchArgs = UserApiFetchParamCreator(configuration).loginUser(username, password, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + + /** + * + * @summary Logs out current logged in user session + * @throws {RequiredError} + */ + logoutUser: function logoutUser() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var localVarFetchArgs = UserApiFetchParamCreator(configuration).logoutUser(options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + + /** + * This can only be done by the logged in user. + * @summary Updated user + * @throws {RequiredError} + */ + updateUser: function updateUser(username, user) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var localVarFetchArgs = UserApiFetchParamCreator(configuration).updateUser(username, user, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + } + }; +}; \ No newline at end of file diff --git a/samples/client/petstore/javascript-flowtyped/lib/api.js.flow b/samples/client/petstore/javascript-flowtyped/lib/api.js.flow new file mode 100644 index 00000000000..9732cb35975 --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/lib/api.js.flow @@ -0,0 +1,1374 @@ +// @flow +/* eslint-disable no-use-before-define */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +import * as url from "url"; +import * as portableFetch from "portable-fetch"; +import { Configuration } from "./configuration"; + +const BASE_PATH: string = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + */ +export type FetchAPI = { + (url: string, init?: any): Promise; +} + +/** + * + * @export + */ +export type FetchArgs = { + url: string; + options: {}; +} + + +/** + * + * @export + */ +export type RequestOptions = { + headers?: {}; + query?: {}; + body?: string | FormData; +} + +/** + * * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name:string = "RequiredError" + constructor(field: string, msg?: string) { + super(msg); + } +} + +/** + * Describes the result of uploading an image resource + * @export + */ +export type ApiResponse = { + /** + * + * @type {number} + * @memberof ApiResponse + */ + code?: number; + /** + * + * @type {string} + * @memberof ApiResponse + */ + type?: string; + /** + * + * @type {string} + * @memberof ApiResponse + */ + message?: string; +} + + +/** + * A category for a pet + * @export + */ +export type Category = { + /** + * + * @type {number} + * @memberof Category + */ + id?: number; + /** + * + * @type {string} + * @memberof Category + */ + name?: string; +} + + + + export type OrderStatusEnum = 'placed' | 'approved' | 'delivered'; +/** + * An order for a pets from the pet store + * @export + */ +export type Order = { + /** + * + * @type {number} + * @memberof Order + */ + id?: number; + /** + * + * @type {number} + * @memberof Order + */ + petId?: number; + /** + * + * @type {number} + * @memberof Order + */ + quantity?: number; + /** + * + * @type {Date} + * @memberof Order + */ + shipDate?: Date; + /** + * Order Status + * @type {string} + * @memberof Order + */ + status?: OrderStatusEnum; + /** + * + * @type {boolean} + * @memberof Order + */ + complete?: boolean; +} + + + + export type PetStatusEnum = 'available' | 'pending' | 'sold'; +/** + * A pet for sale in the pet store + * @export + */ +export type Pet = { + /** + * + * @type {number} + * @memberof Pet + */ + id?: number; + /** + * + * @type {Category} + * @memberof Pet + */ + category?: Category; + /** + * + * @type {string} + * @memberof Pet + */ + name: string; + /** + * + * @type {Array} + * @memberof Pet + */ + photoUrls: Array; + /** + * + * @type {Array} + * @memberof Pet + */ + tags?: Array; + /** + * pet status in the store + * @type {string} + * @memberof Pet + */ + status?: PetStatusEnum; +} + + +/** + * A tag for a pet + * @export + */ +export type Tag = { + /** + * + * @type {number} + * @memberof Tag + */ + id?: number; + /** + * + * @type {string} + * @memberof Tag + */ + name?: string; +} + + +/** + * A User who is purchasing from the pet store + * @export + */ +export type User = { + /** + * + * @type {number} + * @memberof User + */ + id?: number; + /** + * + * @type {string} + * @memberof User + */ + username?: string; + /** + * + * @type {string} + * @memberof User + */ + firstName?: string; + /** + * + * @type {string} + * @memberof User + */ + lastName?: string; + /** + * + * @type {string} + * @memberof User + */ + email?: string; + /** + * + * @type {string} + * @memberof User + */ + password?: string; + /** + * + * @type {string} + * @memberof User + */ + phone?: string; + /** + * User Status + * @type {number} + * @memberof User + */ + userStatus?: number; +} + + + + +/** + * PetApi - fetch parameter creator + * @export + */ +export const PetApiFetchParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Add a new pet to the store + * @throws {RequiredError} + */ + addPet(pet: Pet, options: RequestOptions): FetchArgs { + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new RequiredError('pet','Required parameter pet was null or undefined when calling addPet.'); + } + const localVarPath = `/pet`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'POST' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = (typeof pet !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(pet || {}) : (((pet:any):string) || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Deletes a pet + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options: RequestOptions): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); + } + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'DELETE' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (apiKey !== undefined && apiKey !== null) { + localVarHeaderParameter['api_key'] = ((apiKey:any):string); + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @throws {RequiredError} + */ + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options: RequestOptions): FetchArgs { + // verify required parameter 'status' is not null or undefined + if (status === null || status === undefined) { + throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); + } + const localVarPath = `/pet/findByStatus`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'GET' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (status) { + localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS["csv"]); + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options: RequestOptions): FetchArgs { + // verify required parameter 'tags' is not null or undefined + if (tags === null || tags === undefined) { + throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); + } + const localVarPath = `/pet/findByTags`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'GET' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (tags) { + localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS["csv"]); + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @throws {RequiredError} + */ + getPetById(petId: number, options: RequestOptions): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); + } + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'GET' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + // authentication api_key required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("api_key") + : configuration.apiKey; + localVarHeaderParameter["api_key"] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update an existing pet + * @throws {RequiredError} + */ + updatePet(pet: Pet, options: RequestOptions): FetchArgs { + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new RequiredError('pet','Required parameter pet was null or undefined when calling updatePet.'); + } + const localVarPath = `/pet`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'PUT' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = (typeof pet !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(pet || {}) : (((pet:any):string) || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Updates a pet in the store with form data + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options: RequestOptions): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'POST' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + const localVarFormParams = new FormData(); + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (name !== undefined) { + localVarFormParams.set('name', ((name:any):string)); + } + + if (status !== undefined) { + localVarFormParams.set('status', ((status:any):string)); + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = localVarFormParams; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary uploads an image + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options: RequestOptions): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); + } + const localVarPath = `/pet/{petId}/uploadImage` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'POST' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + const localVarFormParams = new FormData(); + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (additionalMetadata !== undefined) { + localVarFormParams.set('additionalMetadata', ((additionalMetadata:any):string)); + } + + if (file !== undefined) { + localVarFormParams.set('file', ((file:any):string)); + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = localVarFormParams; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +export type PetApiType = { + addPet(pet: Pet, options?: RequestOptions): Promise, + + deletePet(petId: number, apiKey?: string, options?: RequestOptions): Promise, + + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: RequestOptions): Promise>, + + findPetsByTags(tags: Array, options?: RequestOptions): Promise>, + + getPetById(petId: number, options?: RequestOptions): Promise, + + updatePet(pet: Pet, options?: RequestOptions): Promise, + + updatePetWithForm(petId: number, name?: string, status?: string, options?: RequestOptions): Promise, + + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: RequestOptions): Promise, +} + +/** + * PetApi - factory function to inject configuration + * @export + */ +export const PetApi = function(configuration?: Configuration, fetch: FetchAPI = portableFetch): PetApiType { + const basePath: string = (configuration && configuration.basePath) || BASE_PATH; + return { + /** + * + * @summary Add a new pet to the store + * @throws {RequiredError} + */ + addPet(pet: Pet, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = PetApiFetchParamCreator(configuration).addPet(pet, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * + * @summary Deletes a pet + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = PetApiFetchParamCreator(configuration).deletePet(petId, apiKey, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @throws {RequiredError} + */ + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: RequestOptions = {}): Promise> { + const localVarFetchArgs = PetApiFetchParamCreator(configuration).findPetsByStatus(status, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options?: RequestOptions = {}): Promise> { + const localVarFetchArgs = PetApiFetchParamCreator(configuration).findPetsByTags(tags, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @throws {RequiredError} + */ + getPetById(petId: number, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = PetApiFetchParamCreator(configuration).getPetById(petId, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + /** + * + * @summary Update an existing pet + * @throws {RequiredError} + */ + updatePet(pet: Pet, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePet(pet, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * + * @summary Updates a pet in the store with form data + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePetWithForm(petId, name, status, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * + * @summary uploads an image + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = PetApiFetchParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + } +}; + +/** + * StoreApi - fetch parameter creator + * @export + */ +export const StoreApiFetchParamCreator = function (configuration?: Configuration) { + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options: RequestOptions): FetchArgs { + // verify required parameter 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); + } + const localVarPath = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'DELETE' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @throws {RequiredError} + */ + getInventory(options: RequestOptions): FetchArgs { + const localVarPath = `/store/inventory`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'GET' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + // authentication api_key required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("api_key") + : configuration.apiKey; + localVarHeaderParameter["api_key"] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @throws {RequiredError} + */ + getOrderById(orderId: number, options: RequestOptions): FetchArgs { + // verify required parameter 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); + } + const localVarPath = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'GET' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Place an order for a pet + * @throws {RequiredError} + */ + placeOrder(order: Order, options: RequestOptions): FetchArgs { + // verify required parameter 'order' is not null or undefined + if (order === null || order === undefined) { + throw new RequiredError('order','Required parameter order was null or undefined when calling placeOrder.'); + } + const localVarPath = `/store/order`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'POST' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = (typeof order !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(order || {}) : (((order:any):string) || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +export type StoreApiType = { + deleteOrder(orderId: string, options?: RequestOptions): Promise, + + getInventory(options?: RequestOptions): Promise<{ [key: string]: number; }>, + + getOrderById(orderId: number, options?: RequestOptions): Promise, + + placeOrder(order: Order, options?: RequestOptions): Promise, +} + +/** + * StoreApi - factory function to inject configuration + * @export + */ +export const StoreApi = function(configuration?: Configuration, fetch: FetchAPI = portableFetch): StoreApiType { + const basePath: string = (configuration && configuration.basePath) || BASE_PATH; + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = StoreApiFetchParamCreator(configuration).deleteOrder(orderId, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @throws {RequiredError} + */ + getInventory(options?: RequestOptions = {}): Promise<{ [key: string]: number; }> { + const localVarFetchArgs = StoreApiFetchParamCreator(configuration).getInventory(options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @throws {RequiredError} + */ + getOrderById(orderId: number, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = StoreApiFetchParamCreator(configuration).getOrderById(orderId, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + /** + * + * @summary Place an order for a pet + * @throws {RequiredError} + */ + placeOrder(order: Order, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = StoreApiFetchParamCreator(configuration).placeOrder(order, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + } +}; + +/** + * UserApi - fetch parameter creator + * @export + */ +export const UserApiFetchParamCreator = function (configuration?: Configuration) { + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @throws {RequiredError} + */ + createUser(user: User, options: RequestOptions): FetchArgs { + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError('user','Required parameter user was null or undefined when calling createUser.'); + } + const localVarPath = `/user`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'POST' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = (typeof user !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(user || {}) : (((user:any):string) || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @throws {RequiredError} + */ + createUsersWithArrayInput(user: Array, options: RequestOptions): FetchArgs { + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError('user','Required parameter user was null or undefined when calling createUsersWithArrayInput.'); + } + const localVarPath = `/user/createWithArray`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'POST' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = (typeof user !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(user || {}) : (((user:any):string) || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @throws {RequiredError} + */ + createUsersWithListInput(user: Array, options: RequestOptions): FetchArgs { + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError('user','Required parameter user was null or undefined when calling createUsersWithListInput.'); + } + const localVarPath = `/user/createWithList`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'POST' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = (typeof user !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(user || {}) : (((user:any):string) || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @throws {RequiredError} + */ + deleteUser(username: string, options: RequestOptions): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); + } + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'DELETE' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get user by user name + * @throws {RequiredError} + */ + getUserByName(username: string, options: RequestOptions): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); + } + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'GET' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Logs user into the system + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options: RequestOptions): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling loginUser.'); + } + // verify required parameter 'password' is not null or undefined + if (password === null || password === undefined) { + throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); + } + const localVarPath = `/user/login`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'GET' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + if (username !== undefined) { + localVarQueryParameter['username'] = ((username:any):string); + } + + if (password !== undefined) { + localVarQueryParameter['password'] = ((password:any):string); + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Logs out current logged in user session + * @throws {RequiredError} + */ + logoutUser(options: RequestOptions): FetchArgs { + const localVarPath = `/user/logout`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'GET' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @throws {RequiredError} + */ + updateUser(username: string, user: User, options: RequestOptions): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling updateUser.'); + } + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError('user','Required parameter user was null or undefined when calling updateUser.'); + } + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'PUT' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = (typeof user !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(user || {}) : (((user:any):string) || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +export type UserApiType = { + createUser(user: User, options?: RequestOptions): Promise, + + createUsersWithArrayInput(user: Array, options?: RequestOptions): Promise, + + createUsersWithListInput(user: Array, options?: RequestOptions): Promise, + + deleteUser(username: string, options?: RequestOptions): Promise, + + getUserByName(username: string, options?: RequestOptions): Promise, + + loginUser(username: string, password: string, options?: RequestOptions): Promise, + + logoutUser(options?: RequestOptions): Promise, + + updateUser(username: string, user: User, options?: RequestOptions): Promise, +} + +/** + * UserApi - factory function to inject configuration + * @export + */ +export const UserApi = function(configuration?: Configuration, fetch: FetchAPI = portableFetch): UserApiType { + const basePath: string = (configuration && configuration.basePath) || BASE_PATH; + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @throws {RequiredError} + */ + createUser(user: User, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUser(user, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * + * @summary Creates list of users with given input array + * @throws {RequiredError} + */ + createUsersWithArrayInput(user: Array, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithArrayInput(user, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * + * @summary Creates list of users with given input array + * @throws {RequiredError} + */ + createUsersWithListInput(user: Array, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithListInput(user, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @throws {RequiredError} + */ + deleteUser(username: string, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = UserApiFetchParamCreator(configuration).deleteUser(username, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * + * @summary Get user by user name + * @throws {RequiredError} + */ + getUserByName(username: string, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = UserApiFetchParamCreator(configuration).getUserByName(username, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + /** + * + * @summary Logs user into the system + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = UserApiFetchParamCreator(configuration).loginUser(username, password, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + /** + * + * @summary Logs out current logged in user session + * @throws {RequiredError} + */ + logoutUser(options?: RequestOptions = {}): Promise { + const localVarFetchArgs = UserApiFetchParamCreator(configuration).logoutUser(options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @throws {RequiredError} + */ + updateUser(username: string, user: User, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = UserApiFetchParamCreator(configuration).updateUser(username, user, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + } +}; + +export type ApiTypes = { + PetApi: PetApiType, + + StoreApi: StoreApiType, + + UserApi: UserApiType, + } diff --git a/samples/client/petstore/javascript-flowtyped/lib/configuration.js b/samples/client/petstore/javascript-flowtyped/lib/configuration.js new file mode 100644 index 00000000000..fbc458cc9b0 --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/lib/configuration.js @@ -0,0 +1,68 @@ +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +export var Configuration = +/** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + +/** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ +function Configuration() { + var param = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + _classCallCheck(this, Configuration); + + if (param.apiKey) { + this.apiKey = param.apiKey; + } + if (param.username) { + this.username = param.username; + } + if (param.password) { + this.password = param.password; + } + if (param.accessToken) { + this.accessToken = param.accessToken; + } + if (param.basePath) { + this.basePath = param.basePath; + } +} +/** + * override base path + * + * @type {string} + * @memberof Configuration + */ + +/** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + +/** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ +; +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ \ No newline at end of file diff --git a/samples/client/petstore/javascript-flowtyped/lib/configuration.js.flow b/samples/client/petstore/javascript-flowtyped/lib/configuration.js.flow new file mode 100644 index 00000000000..ffcb7070880 --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/lib/configuration.js.flow @@ -0,0 +1,76 @@ +// @flow +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +export type ConfigurationParameters = { + apiKey?: string | (name: string) => string; + username?: string; + password?: string; + accessToken?: string | (name: string, scopes?: string[]) => string; + basePath?: string; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey: string | (name: string) => string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken: string | ((name: string, scopes?: string[]) => string); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath: string; + + constructor(param: ConfigurationParameters = {}) { + if (param.apiKey) { + this.apiKey = param.apiKey; + } + if (param.username) { + this.username = param.username; + } + if (param.password) { + this.password = param.password; + } + if (param.accessToken) { + this.accessToken = param.accessToken; + } + if (param.basePath) { + this.basePath = param.basePath; + } + } +} diff --git a/samples/client/petstore/javascript-flowtyped/lib/index.js b/samples/client/petstore/javascript-flowtyped/lib/index.js new file mode 100644 index 00000000000..38b6edb5fd5 --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/lib/index.js @@ -0,0 +1,15 @@ + +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +export * from "./api"; +export * from "./configuration"; \ No newline at end of file diff --git a/samples/client/petstore/javascript-flowtyped/lib/index.js.flow b/samples/client/petstore/javascript-flowtyped/lib/index.js.flow new file mode 100644 index 00000000000..f8e9fdf37ae --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/lib/index.js.flow @@ -0,0 +1,16 @@ +// @flow +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +export * from "./api"; +export * from "./configuration"; diff --git a/samples/client/petstore/javascript-flowtyped/package-lock.json b/samples/client/petstore/javascript-flowtyped/package-lock.json new file mode 100644 index 00000000000..2080338849e --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/package-lock.json @@ -0,0 +1,4052 @@ +{ + "name": "open_api_petstore", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "optional": true, + "requires": { + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "optional": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true, + "optional": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "dev": true + }, + "atob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", + "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=", + "dev": true + }, + "babel-cli": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.26.0.tgz", + "integrity": "sha1-UCq1SHTX24itALiHoGODzgPQAvE=", + "dev": true, + "requires": { + "babel-core": "^6.26.0", + "babel-polyfill": "^6.26.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "chokidar": "^1.6.1", + "commander": "^2.11.0", + "convert-source-map": "^1.5.0", + "fs-readdir-recursive": "^1.0.0", + "glob": "^7.1.2", + "lodash": "^4.17.4", + "output-file-sync": "^1.1.2", + "path-is-absolute": "^1.0.1", + "slash": "^1.0.0", + "source-map": "^0.5.6", + "v8flags": "^2.1.1" + } + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + } + }, + "babel-core": { + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "dev": true, + "requires": { + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + } + }, + "babel-helper-builder-binary-assignment-operator-visitor": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", + "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "dev": true, + "requires": { + "babel-helper-explode-assignable-expression": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-builder-react-jsx": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz", + "integrity": "sha1-Of+DE7dci2Xc7/HzHTg+D/KkCKA=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "esutils": "^2.0.2" + } + }, + "babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-define-map": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", + "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-explode-assignable-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", + "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "dev": true, + "requires": { + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-optimise-call-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "dev": true, + "requires": { + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-dynamic-import-node": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-1.1.0.tgz", + "integrity": "sha512-tTfZbM9Ecwj3GK50mnPrUpinTwA4xXmDiQGCk/aBYbvl1+X8YqldK86wZ1owVJ4u3mrKbRlXMma80J18qwiaTQ==", + "dev": true, + "requires": { + "babel-plugin-syntax-dynamic-import": "^6.18.0", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0" + } + }, + "babel-plugin-syntax-async-functions": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", + "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", + "dev": true + }, + "babel-plugin-syntax-class-properties": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", + "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=", + "dev": true + }, + "babel-plugin-syntax-dynamic-import": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz", + "integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=", + "dev": true + }, + "babel-plugin-syntax-exponentiation-operator": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", + "dev": true + }, + "babel-plugin-syntax-flow": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz", + "integrity": "sha1-TDqyCiryaqIM0lmVw5jE63AxDI0=", + "dev": true + }, + "babel-plugin-syntax-jsx": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", + "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=", + "dev": true + }, + "babel-plugin-syntax-object-rest-spread": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", + "dev": true + }, + "babel-plugin-syntax-trailing-function-commas": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", + "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", + "dev": true + }, + "babel-plugin-transform-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", + "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-functions": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-class-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz", + "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-plugin-syntax-class-properties": "^6.8.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-arrow-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoped-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoping": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", + "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-plugin-transform-es2015-classes": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", + "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "dev": true, + "requires": { + "babel-helper-define-map": "^6.24.1", + "babel-helper-function-name": "^6.24.1", + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-helper-replace-supers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-computed-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", + "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-duplicate-keys": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", + "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-for-of": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-modules-amd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", + "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", + "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", + "dev": true, + "requires": { + "babel-plugin-transform-strict-mode": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-systemjs": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", + "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-umd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", + "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-object-super": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", + "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", + "dev": true, + "requires": { + "babel-helper-replace-supers": "^6.24.1", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "dev": true, + "requires": { + "babel-helper-call-delegate": "^6.24.1", + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-shorthand-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", + "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-template-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-typeof-symbol": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "regexpu-core": "^2.0.0" + } + }, + "babel-plugin-transform-exponentiation-operator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", + "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "dev": true, + "requires": { + "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", + "babel-plugin-syntax-exponentiation-operator": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-flow-strip-types": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz", + "integrity": "sha1-hMtnKTXUNxT9wyvOhFaNh0Qc988=", + "dev": true, + "requires": { + "babel-plugin-syntax-flow": "^6.18.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-object-rest-spread": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", + "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", + "dev": true, + "requires": { + "babel-plugin-syntax-object-rest-spread": "^6.8.0", + "babel-runtime": "^6.26.0" + } + }, + "babel-plugin-transform-react-constant-elements": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-constant-elements/-/babel-plugin-transform-react-constant-elements-6.23.0.tgz", + "integrity": "sha1-LxGb9NLN1F65uqrldAU8YE9hR90=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-react-display-name": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz", + "integrity": "sha1-Z+K/Hx6ck6sI25Z5LgU5K/LMKNE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-react-jsx": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz", + "integrity": "sha1-hAoCjn30YN/DotKfDA2R9jduZqM=", + "dev": true, + "requires": { + "babel-helper-builder-react-jsx": "^6.24.1", + "babel-plugin-syntax-jsx": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-react-jsx-self": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx-self/-/babel-plugin-transform-react-jsx-self-6.22.0.tgz", + "integrity": "sha1-322AqdomEqEh5t3XVYvL7PBuY24=", + "dev": true, + "requires": { + "babel-plugin-syntax-jsx": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-react-jsx-source": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx-source/-/babel-plugin-transform-react-jsx-source-6.22.0.tgz", + "integrity": "sha1-ZqwSFT9c0tF7PBkmj0vwGX9E7NY=", + "dev": true, + "requires": { + "babel-plugin-syntax-jsx": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-regenerator": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", + "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", + "dev": true, + "requires": { + "regenerator-transform": "^0.10.0" + } + }, + "babel-plugin-transform-runtime": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.23.0.tgz", + "integrity": "sha1-iEkNRGUC6puOfvsP4J7E2ZR5se4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-polyfill": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", + "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "regenerator-runtime": "^0.10.5" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", + "dev": true + } + } + }, + "babel-preset-env": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", + "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "^6.22.0", + "babel-plugin-syntax-trailing-function-commas": "^6.22.0", + "babel-plugin-transform-async-to-generator": "^6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoping": "^6.23.0", + "babel-plugin-transform-es2015-classes": "^6.23.0", + "babel-plugin-transform-es2015-computed-properties": "^6.22.0", + "babel-plugin-transform-es2015-destructuring": "^6.23.0", + "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", + "babel-plugin-transform-es2015-for-of": "^6.23.0", + "babel-plugin-transform-es2015-function-name": "^6.22.0", + "babel-plugin-transform-es2015-literals": "^6.22.0", + "babel-plugin-transform-es2015-modules-amd": "^6.22.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-umd": "^6.23.0", + "babel-plugin-transform-es2015-object-super": "^6.22.0", + "babel-plugin-transform-es2015-parameters": "^6.23.0", + "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", + "babel-plugin-transform-es2015-spread": "^6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", + "babel-plugin-transform-es2015-template-literals": "^6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", + "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", + "babel-plugin-transform-exponentiation-operator": "^6.22.0", + "babel-plugin-transform-regenerator": "^6.22.0", + "browserslist": "^2.1.2", + "invariant": "^2.2.2", + "semver": "^5.3.0" + } + }, + "babel-preset-flow": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz", + "integrity": "sha1-5xIYiHCFrpoktb5Baa/7WZgWxJ0=", + "dev": true, + "requires": { + "babel-plugin-transform-flow-strip-types": "^6.22.0" + } + }, + "babel-preset-react": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-react/-/babel-preset-react-6.24.1.tgz", + "integrity": "sha1-umnfrqRfw+xjm2pOzqbhdwLJE4A=", + "dev": true, + "requires": { + "babel-plugin-syntax-jsx": "^6.3.13", + "babel-plugin-transform-react-display-name": "^6.23.0", + "babel-plugin-transform-react-jsx": "^6.24.1", + "babel-plugin-transform-react-jsx-self": "^6.22.0", + "babel-plugin-transform-react-jsx-source": "^6.22.0", + "babel-preset-flow": "^6.23.0" + } + }, + "babel-preset-react-app": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/babel-preset-react-app/-/babel-preset-react-app-3.1.1.tgz", + "integrity": "sha512-9fRHopNaGL5ScRZdPSoyxRaABKmkS2fx0HUJ5Yphan5G8QDFD7lETsPyY7El6b7YPT3sNrw9gfrWzl4/LsJcfA==", + "dev": true, + "requires": { + "babel-plugin-dynamic-import-node": "1.1.0", + "babel-plugin-syntax-dynamic-import": "6.18.0", + "babel-plugin-transform-class-properties": "6.24.1", + "babel-plugin-transform-es2015-destructuring": "6.23.0", + "babel-plugin-transform-object-rest-spread": "6.26.0", + "babel-plugin-transform-react-constant-elements": "6.23.0", + "babel-plugin-transform-react-jsx": "6.24.1", + "babel-plugin-transform-react-jsx-self": "6.22.0", + "babel-plugin-transform-react-jsx-source": "6.22.0", + "babel-plugin-transform-regenerator": "6.26.0", + "babel-plugin-transform-runtime": "6.23.0", + "babel-preset-env": "1.6.1", + "babel-preset-react": "6.24.1" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "requires": { + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "binary-extensions": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "optional": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "browserslist": { + "version": "2.11.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.11.3.tgz", + "integrity": "sha512-yWu5cXT7Av6mVwzWc8lMsJMHWn4xyjSuGYi4IozbVTLUOEYPSagUB8kiMDUHA1fS3zjr8nkxkn9jdvug4BBRmA==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30000792", + "electron-to-chromium": "^1.3.30" + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30000856", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000856.tgz", + "integrity": "sha512-x3mYcApHMQemyaHuH/RyqtKCGIYTgEA63fdi+VBvDz8xUSmRiVWTLeyKcoGQCGG6UPR9/+4qG4OKrTa6aSQRKg==", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "optional": true, + "requires": { + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", + "dev": true + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-js": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "electron-to-chromium": { + "version": "1.3.48", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.48.tgz", + "integrity": "sha1-07DYWTgUBE4JLs4hCPw6ya6kuQA=", + "dev": true + }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "requires": { + "iconv-lite": "~0.4.13" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "optional": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "optional": true, + "requires": { + "fill-range": "^2.1.0" + } + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "optional": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true, + "optional": true + }, + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "optional": true, + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "flow-copy-source": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flow-copy-source/-/flow-copy-source-1.3.0.tgz", + "integrity": "sha512-F8aRmNmtB5l+RFG7LAWj6IYU22K37BrhIXXCcQyxSsYWm0pNubnhBSEk+eoyGCou3+4aI4tReOfLFtgd5wnnYQ==", + "dev": true, + "requires": { + "chokidar": "^2.0.0", + "fs-extra": "^5.0.0", + "glob": "^7.0.0", + "kefir": "^3.7.3", + "yargs": "^11.0.0" + }, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "chokidar": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.3.tgz", + "integrity": "sha512-zW8iXYZtXMx4kux/nuZVXjkLP+CyIK5Al5FHnj1OgTKGZfp4Oy6/ymtMSKFv3GD8DviEmUPmJg9eFdJ/JzudMg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.0", + "braces": "^2.3.0", + "fsevents": "^1.1.2", + "glob-parent": "^3.1.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^2.1.1", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0", + "upath": "^1.0.0" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-glob": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + } + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "optional": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs-extra": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", + "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "dev": true, + "optional": true, + "requires": { + "nan": "^2.9.2", + "node-pre-gyp": "^0.10.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.21", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": "^2.1.0" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "minipass": { + "version": "2.2.4", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "^5.1.1", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.0", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.1.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.5.1", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.1", + "bundled": true, + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.2.4", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.1", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true, + "dev": true + } + } + }, + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "optional": true, + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + } + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true, + "optional": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "optional": true, + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-odd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", + "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", + "dev": true, + "requires": { + "is-number": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true, + "optional": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true, + "optional": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "optional": true, + "requires": { + "isarray": "1.0.0" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "kefir": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/kefir/-/kefir-3.8.3.tgz", + "integrity": "sha512-HMxsCDX2IzAU6Oj+7Uex8ysK9rl1OKH7D583CXZ0yjScuqeq+CA34nP+SX2Mx3gqKeriOKPWMaKL04Maw9K2xg==", + "dev": true, + "requires": { + "symbol-observable": "1.0.4" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + }, + "loose-envify": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", + "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "dev": true, + "requires": { + "js-tokens": "^3.0.0" + } + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true, + "optional": true + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "optional": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "nan": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", + "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-odd": "^2.0.0", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "requires": { + "encoding": "^0.1.11", + "is-stream": "^1.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "optional": true, + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "output-file-sync": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz", + "integrity": "sha1-0KM+7+YaIF+suQCS6CZZjVJFznY=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.4", + "mkdirp": "^0.5.1", + "object-assign": "^4.1.0" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "optional": true, + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "portable-fetch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/portable-fetch/-/portable-fetch-3.0.0.tgz", + "integrity": "sha1-PL9KptvFpXNLQcBBnJJzMTv9mtg=", + "requires": { + "node-fetch": "^1.0.1", + "whatwg-fetch": ">=0.10.0" + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true, + "optional": true + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "randomatic": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz", + "integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==", + "dev": true, + "optional": true, + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true, + "optional": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "minimatch": "^3.0.2", + "readable-stream": "^2.0.2", + "set-immediate-shim": "^1.0.1" + } + }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, + "regenerator-transform": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", + "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "dev": true, + "requires": { + "babel-runtime": "^6.18.0", + "babel-types": "^6.19.0", + "private": "^0.1.6" + } + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "optional": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "dev": true, + "requires": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "^0.5.6" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "symbol-observable": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.4.tgz", + "integrity": "sha1-Kb9hXUqnEhvdiYsi1LP5vE4qoD0=", + "dev": true + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + } + } + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "universalify": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", + "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "upath": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz", + "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==", + "dev": true + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "use": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", + "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "user-home": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "v8flags": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", + "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", + "dev": true, + "requires": { + "user-home": "^1.1.1" + } + }, + "whatwg-fetch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", + "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.0.0.tgz", + "integrity": "sha512-Rjp+lMYQOWtgqojx1dEWorjCofi1YN7AoFvYV7b1gx/7dAAeuI4kN5SZiEvr0ZmsZTOpDRcCqrpI10L31tFkBw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" + } + }, + "yargs-parser": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } +} diff --git a/samples/client/petstore/javascript-flowtyped/package.json b/samples/client/petstore/javascript-flowtyped/package.json new file mode 100644 index 00000000000..bb22b7971f0 --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/package.json @@ -0,0 +1,31 @@ +{ + "name": "open_api_petstore", + "version": "1.0.0", + "description": "swagger client for open_api_petstore", + "author": "Swagger Codegen Contributors", + "keywords": [ + "fetch", + "flow", + "swagger-client", + "open_api_petstore" + ], + "license": "Unlicense", + "main": "./lib/index.js", + "scripts": { + "build": "npm run build:clean && npm run build:lib && npm run build:flow", + "build:clean": "rimraf lib", + "build:lib": "node_modules/.bin/babel -d lib src --ignore '**/__tests__/**'", + "build:flow": "flow-copy-source -v -i '**/__tests__/**' src lib" + }, + "dependencies": { + "portable-fetch": "^3.0.0" + }, + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.3", + "babel-plugin-transform-flow-strip-types": "^6.22.0", + "babel-preset-react-app": "^3.1.1", + "flow-copy-source": "^1.3.0", + "rimraf": "^2.6.2" + } +} diff --git a/samples/client/petstore/javascript-flowtyped/pom.xml b/samples/client/petstore/javascript-flowtyped/pom.xml new file mode 100644 index 00000000000..42f19fcf2e1 --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + openapi-petstore-javascript-flowtyped + pom + 1.0-SNAPSHOT + Petstore JS Flowtyped Client + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + npm-install + pre-integration-test + + exec + + + npm + + install + + + + + mocha + integration-test + + exec + + + npm + + run + build + + + + + + + + diff --git a/samples/client/petstore/javascript-flowtyped/src/api.js b/samples/client/petstore/javascript-flowtyped/src/api.js new file mode 100644 index 00000000000..9732cb35975 --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/src/api.js @@ -0,0 +1,1374 @@ +// @flow +/* eslint-disable no-use-before-define */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +import * as url from "url"; +import * as portableFetch from "portable-fetch"; +import { Configuration } from "./configuration"; + +const BASE_PATH: string = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + */ +export type FetchAPI = { + (url: string, init?: any): Promise; +} + +/** + * + * @export + */ +export type FetchArgs = { + url: string; + options: {}; +} + + +/** + * + * @export + */ +export type RequestOptions = { + headers?: {}; + query?: {}; + body?: string | FormData; +} + +/** + * * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name:string = "RequiredError" + constructor(field: string, msg?: string) { + super(msg); + } +} + +/** + * Describes the result of uploading an image resource + * @export + */ +export type ApiResponse = { + /** + * + * @type {number} + * @memberof ApiResponse + */ + code?: number; + /** + * + * @type {string} + * @memberof ApiResponse + */ + type?: string; + /** + * + * @type {string} + * @memberof ApiResponse + */ + message?: string; +} + + +/** + * A category for a pet + * @export + */ +export type Category = { + /** + * + * @type {number} + * @memberof Category + */ + id?: number; + /** + * + * @type {string} + * @memberof Category + */ + name?: string; +} + + + + export type OrderStatusEnum = 'placed' | 'approved' | 'delivered'; +/** + * An order for a pets from the pet store + * @export + */ +export type Order = { + /** + * + * @type {number} + * @memberof Order + */ + id?: number; + /** + * + * @type {number} + * @memberof Order + */ + petId?: number; + /** + * + * @type {number} + * @memberof Order + */ + quantity?: number; + /** + * + * @type {Date} + * @memberof Order + */ + shipDate?: Date; + /** + * Order Status + * @type {string} + * @memberof Order + */ + status?: OrderStatusEnum; + /** + * + * @type {boolean} + * @memberof Order + */ + complete?: boolean; +} + + + + export type PetStatusEnum = 'available' | 'pending' | 'sold'; +/** + * A pet for sale in the pet store + * @export + */ +export type Pet = { + /** + * + * @type {number} + * @memberof Pet + */ + id?: number; + /** + * + * @type {Category} + * @memberof Pet + */ + category?: Category; + /** + * + * @type {string} + * @memberof Pet + */ + name: string; + /** + * + * @type {Array} + * @memberof Pet + */ + photoUrls: Array; + /** + * + * @type {Array} + * @memberof Pet + */ + tags?: Array; + /** + * pet status in the store + * @type {string} + * @memberof Pet + */ + status?: PetStatusEnum; +} + + +/** + * A tag for a pet + * @export + */ +export type Tag = { + /** + * + * @type {number} + * @memberof Tag + */ + id?: number; + /** + * + * @type {string} + * @memberof Tag + */ + name?: string; +} + + +/** + * A User who is purchasing from the pet store + * @export + */ +export type User = { + /** + * + * @type {number} + * @memberof User + */ + id?: number; + /** + * + * @type {string} + * @memberof User + */ + username?: string; + /** + * + * @type {string} + * @memberof User + */ + firstName?: string; + /** + * + * @type {string} + * @memberof User + */ + lastName?: string; + /** + * + * @type {string} + * @memberof User + */ + email?: string; + /** + * + * @type {string} + * @memberof User + */ + password?: string; + /** + * + * @type {string} + * @memberof User + */ + phone?: string; + /** + * User Status + * @type {number} + * @memberof User + */ + userStatus?: number; +} + + + + +/** + * PetApi - fetch parameter creator + * @export + */ +export const PetApiFetchParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Add a new pet to the store + * @throws {RequiredError} + */ + addPet(pet: Pet, options: RequestOptions): FetchArgs { + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new RequiredError('pet','Required parameter pet was null or undefined when calling addPet.'); + } + const localVarPath = `/pet`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'POST' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = (typeof pet !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(pet || {}) : (((pet:any):string) || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Deletes a pet + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options: RequestOptions): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); + } + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'DELETE' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (apiKey !== undefined && apiKey !== null) { + localVarHeaderParameter['api_key'] = ((apiKey:any):string); + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @throws {RequiredError} + */ + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options: RequestOptions): FetchArgs { + // verify required parameter 'status' is not null or undefined + if (status === null || status === undefined) { + throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); + } + const localVarPath = `/pet/findByStatus`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'GET' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (status) { + localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS["csv"]); + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options: RequestOptions): FetchArgs { + // verify required parameter 'tags' is not null or undefined + if (tags === null || tags === undefined) { + throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); + } + const localVarPath = `/pet/findByTags`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'GET' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (tags) { + localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS["csv"]); + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @throws {RequiredError} + */ + getPetById(petId: number, options: RequestOptions): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); + } + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'GET' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + // authentication api_key required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("api_key") + : configuration.apiKey; + localVarHeaderParameter["api_key"] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update an existing pet + * @throws {RequiredError} + */ + updatePet(pet: Pet, options: RequestOptions): FetchArgs { + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new RequiredError('pet','Required parameter pet was null or undefined when calling updatePet.'); + } + const localVarPath = `/pet`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'PUT' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = (typeof pet !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(pet || {}) : (((pet:any):string) || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Updates a pet in the store with form data + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options: RequestOptions): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'POST' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + const localVarFormParams = new FormData(); + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (name !== undefined) { + localVarFormParams.set('name', ((name:any):string)); + } + + if (status !== undefined) { + localVarFormParams.set('status', ((status:any):string)); + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = localVarFormParams; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary uploads an image + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options: RequestOptions): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); + } + const localVarPath = `/pet/{petId}/uploadImage` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'POST' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + const localVarFormParams = new FormData(); + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (additionalMetadata !== undefined) { + localVarFormParams.set('additionalMetadata', ((additionalMetadata:any):string)); + } + + if (file !== undefined) { + localVarFormParams.set('file', ((file:any):string)); + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + localVarRequestOptions.body = localVarFormParams; + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +export type PetApiType = { + addPet(pet: Pet, options?: RequestOptions): Promise, + + deletePet(petId: number, apiKey?: string, options?: RequestOptions): Promise, + + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: RequestOptions): Promise>, + + findPetsByTags(tags: Array, options?: RequestOptions): Promise>, + + getPetById(petId: number, options?: RequestOptions): Promise, + + updatePet(pet: Pet, options?: RequestOptions): Promise, + + updatePetWithForm(petId: number, name?: string, status?: string, options?: RequestOptions): Promise, + + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: RequestOptions): Promise, +} + +/** + * PetApi - factory function to inject configuration + * @export + */ +export const PetApi = function(configuration?: Configuration, fetch: FetchAPI = portableFetch): PetApiType { + const basePath: string = (configuration && configuration.basePath) || BASE_PATH; + return { + /** + * + * @summary Add a new pet to the store + * @throws {RequiredError} + */ + addPet(pet: Pet, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = PetApiFetchParamCreator(configuration).addPet(pet, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * + * @summary Deletes a pet + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = PetApiFetchParamCreator(configuration).deletePet(petId, apiKey, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @throws {RequiredError} + */ + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: RequestOptions = {}): Promise> { + const localVarFetchArgs = PetApiFetchParamCreator(configuration).findPetsByStatus(status, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options?: RequestOptions = {}): Promise> { + const localVarFetchArgs = PetApiFetchParamCreator(configuration).findPetsByTags(tags, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @throws {RequiredError} + */ + getPetById(petId: number, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = PetApiFetchParamCreator(configuration).getPetById(petId, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + /** + * + * @summary Update an existing pet + * @throws {RequiredError} + */ + updatePet(pet: Pet, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePet(pet, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * + * @summary Updates a pet in the store with form data + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePetWithForm(petId, name, status, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * + * @summary uploads an image + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = PetApiFetchParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + } +}; + +/** + * StoreApi - fetch parameter creator + * @export + */ +export const StoreApiFetchParamCreator = function (configuration?: Configuration) { + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options: RequestOptions): FetchArgs { + // verify required parameter 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); + } + const localVarPath = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'DELETE' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @throws {RequiredError} + */ + getInventory(options: RequestOptions): FetchArgs { + const localVarPath = `/store/inventory`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'GET' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + // authentication api_key required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("api_key") + : configuration.apiKey; + localVarHeaderParameter["api_key"] = localVarApiKeyValue; + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @throws {RequiredError} + */ + getOrderById(orderId: number, options: RequestOptions): FetchArgs { + // verify required parameter 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); + } + const localVarPath = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'GET' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Place an order for a pet + * @throws {RequiredError} + */ + placeOrder(order: Order, options: RequestOptions): FetchArgs { + // verify required parameter 'order' is not null or undefined + if (order === null || order === undefined) { + throw new RequiredError('order','Required parameter order was null or undefined when calling placeOrder.'); + } + const localVarPath = `/store/order`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'POST' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = (typeof order !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(order || {}) : (((order:any):string) || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +export type StoreApiType = { + deleteOrder(orderId: string, options?: RequestOptions): Promise, + + getInventory(options?: RequestOptions): Promise<{ [key: string]: number; }>, + + getOrderById(orderId: number, options?: RequestOptions): Promise, + + placeOrder(order: Order, options?: RequestOptions): Promise, +} + +/** + * StoreApi - factory function to inject configuration + * @export + */ +export const StoreApi = function(configuration?: Configuration, fetch: FetchAPI = portableFetch): StoreApiType { + const basePath: string = (configuration && configuration.basePath) || BASE_PATH; + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = StoreApiFetchParamCreator(configuration).deleteOrder(orderId, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @throws {RequiredError} + */ + getInventory(options?: RequestOptions = {}): Promise<{ [key: string]: number; }> { + const localVarFetchArgs = StoreApiFetchParamCreator(configuration).getInventory(options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @throws {RequiredError} + */ + getOrderById(orderId: number, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = StoreApiFetchParamCreator(configuration).getOrderById(orderId, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + /** + * + * @summary Place an order for a pet + * @throws {RequiredError} + */ + placeOrder(order: Order, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = StoreApiFetchParamCreator(configuration).placeOrder(order, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + } +}; + +/** + * UserApi - fetch parameter creator + * @export + */ +export const UserApiFetchParamCreator = function (configuration?: Configuration) { + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @throws {RequiredError} + */ + createUser(user: User, options: RequestOptions): FetchArgs { + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError('user','Required parameter user was null or undefined when calling createUser.'); + } + const localVarPath = `/user`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'POST' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = (typeof user !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(user || {}) : (((user:any):string) || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @throws {RequiredError} + */ + createUsersWithArrayInput(user: Array, options: RequestOptions): FetchArgs { + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError('user','Required parameter user was null or undefined when calling createUsersWithArrayInput.'); + } + const localVarPath = `/user/createWithArray`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'POST' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = (typeof user !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(user || {}) : (((user:any):string) || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @throws {RequiredError} + */ + createUsersWithListInput(user: Array, options: RequestOptions): FetchArgs { + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError('user','Required parameter user was null or undefined when calling createUsersWithListInput.'); + } + const localVarPath = `/user/createWithList`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'POST' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = (typeof user !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(user || {}) : (((user:any):string) || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @throws {RequiredError} + */ + deleteUser(username: string, options: RequestOptions): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); + } + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'DELETE' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get user by user name + * @throws {RequiredError} + */ + getUserByName(username: string, options: RequestOptions): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); + } + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'GET' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Logs user into the system + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options: RequestOptions): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling loginUser.'); + } + // verify required parameter 'password' is not null or undefined + if (password === null || password === undefined) { + throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); + } + const localVarPath = `/user/login`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'GET' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + if (username !== undefined) { + localVarQueryParameter['username'] = ((username:any):string); + } + + if (password !== undefined) { + localVarQueryParameter['password'] = ((password:any):string); + } + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Logs out current logged in user session + * @throws {RequiredError} + */ + logoutUser(options: RequestOptions): FetchArgs { + const localVarPath = `/user/logout`; + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'GET' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @throws {RequiredError} + */ + updateUser(username: string, user: User, options: RequestOptions): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling updateUser.'); + } + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError('user','Required parameter user was null or undefined when calling updateUser.'); + } + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + const localVarUrlObj = url.parse(localVarPath, true); + const localVarRequestOptions: RequestOptions = Object.assign({}, { method: 'PUT' }, options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); + const needsSerialization = (typeof user !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.body = needsSerialization ? JSON.stringify(user || {}) : (((user:any):string) || ""); + + return { + url: url.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +export type UserApiType = { + createUser(user: User, options?: RequestOptions): Promise, + + createUsersWithArrayInput(user: Array, options?: RequestOptions): Promise, + + createUsersWithListInput(user: Array, options?: RequestOptions): Promise, + + deleteUser(username: string, options?: RequestOptions): Promise, + + getUserByName(username: string, options?: RequestOptions): Promise, + + loginUser(username: string, password: string, options?: RequestOptions): Promise, + + logoutUser(options?: RequestOptions): Promise, + + updateUser(username: string, user: User, options?: RequestOptions): Promise, +} + +/** + * UserApi - factory function to inject configuration + * @export + */ +export const UserApi = function(configuration?: Configuration, fetch: FetchAPI = portableFetch): UserApiType { + const basePath: string = (configuration && configuration.basePath) || BASE_PATH; + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @throws {RequiredError} + */ + createUser(user: User, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUser(user, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * + * @summary Creates list of users with given input array + * @throws {RequiredError} + */ + createUsersWithArrayInput(user: Array, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithArrayInput(user, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * + * @summary Creates list of users with given input array + * @throws {RequiredError} + */ + createUsersWithListInput(user: Array, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithListInput(user, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @throws {RequiredError} + */ + deleteUser(username: string, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = UserApiFetchParamCreator(configuration).deleteUser(username, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * + * @summary Get user by user name + * @throws {RequiredError} + */ + getUserByName(username: string, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = UserApiFetchParamCreator(configuration).getUserByName(username, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + /** + * + * @summary Logs user into the system + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = UserApiFetchParamCreator(configuration).loginUser(username, password, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }, + /** + * + * @summary Logs out current logged in user session + * @throws {RequiredError} + */ + logoutUser(options?: RequestOptions = {}): Promise { + const localVarFetchArgs = UserApiFetchParamCreator(configuration).logoutUser(options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @throws {RequiredError} + */ + updateUser(username: string, user: User, options?: RequestOptions = {}): Promise { + const localVarFetchArgs = UserApiFetchParamCreator(configuration).updateUser(username, user, options); + return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }, + } +}; + +export type ApiTypes = { + PetApi: PetApiType, + + StoreApi: StoreApiType, + + UserApi: UserApiType, + } diff --git a/samples/client/petstore/javascript-flowtyped/src/configuration.js b/samples/client/petstore/javascript-flowtyped/src/configuration.js new file mode 100644 index 00000000000..ffcb7070880 --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/src/configuration.js @@ -0,0 +1,76 @@ +// @flow +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +export type ConfigurationParameters = { + apiKey?: string | (name: string) => string; + username?: string; + password?: string; + accessToken?: string | (name: string, scopes?: string[]) => string; + basePath?: string; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey: string | (name: string) => string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken: string | ((name: string, scopes?: string[]) => string); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath: string; + + constructor(param: ConfigurationParameters = {}) { + if (param.apiKey) { + this.apiKey = param.apiKey; + } + if (param.username) { + this.username = param.username; + } + if (param.password) { + this.password = param.password; + } + if (param.accessToken) { + this.accessToken = param.accessToken; + } + if (param.basePath) { + this.basePath = param.basePath; + } + } +} diff --git a/samples/client/petstore/javascript-flowtyped/src/index.js b/samples/client/petstore/javascript-flowtyped/src/index.js new file mode 100644 index 00000000000..f8e9fdf37ae --- /dev/null +++ b/samples/client/petstore/javascript-flowtyped/src/index.js @@ -0,0 +1,16 @@ +// @flow +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +export * from "./api"; +export * from "./configuration"; From 38bb732673aa1f01914ba4b0f5d4956392400382 Mon Sep 17 00:00:00 2001 From: tomvangreen Date: Mon, 25 Jun 2018 06:17:32 +0200 Subject: [PATCH 33/35] Typescript Angular 2: Make service suffix configurable (#341) * Added serviceSuffix and serviceFileSuffix parameters to control the suffixes of generated class and file names * Updated TypeScriptAngularClientOptionsProvider to include the new serviceSuffix and serviceFileSuffix parameters * Fixed part in generator where hardcoded 'Service' suffix was used. * Made the . in the service file name part of the config setting * Updated cli message --- .../TypeScriptAngularClientCodegen.java | 19 +++++++++++++++---- ...ypeScriptAngularClientOptionsProvider.java | 4 ++++ .../default/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../npm/.openapi-generator/VERSION | 2 +- .../npm/.openapi-generator/VERSION | 2 +- .../default/.openapi-generator/VERSION | 2 +- .../default/.openapi-generator/VERSION | 2 +- 8 files changed, 25 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index a3cd59c3c20..2ccd6706501 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -43,11 +43,14 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode public static final String TAGGED_UNIONS = "taggedUnions"; public static final String NG_VERSION = "ngVersion"; public static final String PROVIDED_IN_ROOT ="providedInRoot"; - + public static final String SERVICE_SUFFIX = "serviceSuffix"; + public static final String SERVICE_FILE_SUFFIX = "serviceFileSuffix"; protected String npmName = null; protected String npmVersion = "1.0.0"; protected String npmRepository = null; + protected String serviceSuffix = "Service"; + protected String serviceFileSuffix = ".service"; private boolean taggedUnions = false; @@ -81,6 +84,8 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode "Use this property to provide Injectables in root (it is only valid in angular version greater or equal to 6.0.0).", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); this.cliOptions.add(new CliOption(NG_VERSION, "The version of Angular. Default is '4.3'")); + this.cliOptions.add(new CliOption(SERVICE_SUFFIX, "The suffix of the generated service. Default is 'Service'.")); + this.cliOptions.add(new CliOption(SERVICE_FILE_SUFFIX, "The suffix of the file of the generated service (service.ts). Default is '.service'.")); } @Override @@ -159,6 +164,12 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode if (!ngVersion.atLeast("4.3.0")) { supportingFiles.add(new SupportingFile("rxjs-operators.mustache", getIndexDirectory(), "rxjs-operators.ts")); } + if (additionalProperties.containsKey(SERVICE_SUFFIX)) { + serviceSuffix = additionalProperties.get(SERVICE_SUFFIX).toString(); + } + if (additionalProperties.containsKey(SERVICE_FILE_SUFFIX)) { + serviceFileSuffix = additionalProperties.get(SERVICE_FILE_SUFFIX).toString(); + } } private void addNpmPackageGeneration(SemVer ngVersion) { @@ -418,7 +429,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode if (name.length() == 0) { return "DefaultService"; } - return initialCaps(name) + "Service"; + return initialCaps(name) + serviceSuffix; } @Override @@ -426,7 +437,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode if (name.length() == 0) { return "default.service"; } - return camelize(name, true) + ".service"; + return camelize(name, true) + serviceFileSuffix; } @Override @@ -469,7 +480,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode } private String getApiFilenameFromClassname(String classname) { - String name = classname.substring(0, classname.length() - "Service".length()); + String name = classname.substring(0, classname.length() - serviceSuffix.length()); return toApiFilename(name); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java index 35bf14aaa73..8bf3e65827c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java @@ -35,6 +35,8 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider { public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String NG_VERSION = "2"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static String SERVICE_SUFFIX = "Service"; + public static String SERVICE_FILE_SUFFIX = ".service"; @Override public String getLanguage() { @@ -56,6 +58,8 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider { .put(TypeScriptAngularClientCodegen.TAGGED_UNIONS, Boolean.FALSE.toString()) .put(TypeScriptAngularClientCodegen.NPM_REPOSITORY, NPM_REPOSITORY) .put(TypeScriptAngularClientCodegen.NG_VERSION, NG_VERSION) + .put(TypeScriptAngularClientCodegen.SERVICE_SUFFIX, SERVICE_SUFFIX) + .put(TypeScriptAngularClientCodegen.SERVICE_FILE_SUFFIX, SERVICE_FILE_SUFFIX) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .build(); diff --git a/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION index ad121e8340e..1c00c518154 100644 --- a/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.1-SNAPSHOT \ No newline at end of file +3.0.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION index ad121e8340e..1c00c518154 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.1-SNAPSHOT \ No newline at end of file +3.0.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION index ad121e8340e..1c00c518154 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.1-SNAPSHOT \ No newline at end of file +3.0.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION index ad121e8340e..1c00c518154 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.1-SNAPSHOT \ No newline at end of file +3.0.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/default/.openapi-generator/VERSION index ad121e8340e..1c00c518154 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/default/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.1-SNAPSHOT \ No newline at end of file +3.0.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/default/.openapi-generator/VERSION index ad121e8340e..1c00c518154 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/default/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.1-SNAPSHOT \ No newline at end of file +3.0.2-SNAPSHOT \ No newline at end of file From 9e2fcda357572c1646e00336cac5c1f91c2fda95 Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Mon, 25 Jun 2018 14:46:52 +0900 Subject: [PATCH 34/35] [JMeter] Rename codegen class, template folder (#387) * Rename JMeter client generator class name * Rename jmeter template folder * Update samples --- ...{JMeterCodegen.java => JMeterClientCodegen.java} | 13 ++++--------- .../services/org.openapitools.codegen.CodegenConfig | 2 +- .../{JMeter => jmeter-client}/api.mustache | 0 .../testdata-localhost.mustache | 0 .../petstore/jmeter/.openapi-generator/VERSION | 2 +- samples/client/petstore/jmeter/PetApi.csv | 2 +- samples/client/petstore/jmeter/StoreApi.csv | 2 +- samples/client/petstore/jmeter/UserApi.csv | 2 +- 8 files changed, 9 insertions(+), 14 deletions(-) rename modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/{JMeterCodegen.java => JMeterClientCodegen.java} (93%) rename modules/openapi-generator/src/main/resources/{JMeter => jmeter-client}/api.mustache (100%) rename modules/openapi-generator/src/main/resources/{JMeter => jmeter-client}/testdata-localhost.mustache (100%) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java similarity index 93% rename from modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterCodegen.java rename to modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java index a4b35051bdd..830e5b06ade 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JMeterClientCodegen.java @@ -19,18 +19,13 @@ package org.openapitools.codegen.languages; import org.openapitools.codegen.*; import org.openapitools.codegen.utils.*; -import org.openapitools.codegen.mustache.*; -import io.swagger.v3.oas.models.security.SecurityScheme; import io.swagger.v3.oas.models.*; import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.responses.ApiResponse; -import io.swagger.v3.oas.models.parameters.*; -import io.swagger.v3.oas.models.info.Info; import java.util.*; import java.io.File; -public class JMeterCodegen extends DefaultCodegen implements CodegenConfig { +public class JMeterClientCodegen extends DefaultCodegen implements CodegenConfig { // source folder where to write the files protected String sourceFolder = ""; @@ -69,11 +64,11 @@ public class JMeterCodegen extends DefaultCodegen implements CodegenConfig { return "Generates a JMeter .jmx file."; } - public JMeterCodegen() { + public JMeterClientCodegen() { super(); // set the output folder here - outputFolder = "generated-code/JMeterCodegen"; + outputFolder = "generated-code/JMeterClientCodegen"; /* * Api classes. You can write classes for each Api file with the apiTemplateFiles map. @@ -90,7 +85,7 @@ public class JMeterCodegen extends DefaultCodegen implements CodegenConfig { * Template Location. This is the location which templates will be read from. The generator * will use the resource stream to attempt to read the templates. */ - embeddedTemplateDir = templateDir = "JMeter"; + embeddedTemplateDir = templateDir = "jmeter-client"; /* * Api Package. Optional, if needed, this can be used in templates diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index f17eb35a5b0..8080c370504 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -47,7 +47,7 @@ org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen org.openapitools.codegen.languages.JavascriptClientCodegen org.openapitools.codegen.languages.JavascriptFlowtypedClientCodegen org.openapitools.codegen.languages.JavascriptClosureAngularClientCodegen -org.openapitools.codegen.languages.JMeterCodegen +org.openapitools.codegen.languages.JMeterClientCodegen org.openapitools.codegen.languages.LuaClientCodegen org.openapitools.codegen.languages.NodeJSServerCodegen org.openapitools.codegen.languages.ObjcClientCodegen diff --git a/modules/openapi-generator/src/main/resources/JMeter/api.mustache b/modules/openapi-generator/src/main/resources/jmeter-client/api.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/JMeter/api.mustache rename to modules/openapi-generator/src/main/resources/jmeter-client/api.mustache diff --git a/modules/openapi-generator/src/main/resources/JMeter/testdata-localhost.mustache b/modules/openapi-generator/src/main/resources/jmeter-client/testdata-localhost.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/JMeter/testdata-localhost.mustache rename to modules/openapi-generator/src/main/resources/jmeter-client/testdata-localhost.mustache diff --git a/samples/client/petstore/jmeter/.openapi-generator/VERSION b/samples/client/petstore/jmeter/.openapi-generator/VERSION index 7fea99011a6..82602aa4190 100644 --- a/samples/client/petstore/jmeter/.openapi-generator/VERSION +++ b/samples/client/petstore/jmeter/.openapi-generator/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/jmeter/PetApi.csv b/samples/client/petstore/jmeter/PetApi.csv index 29b09a1715d..2ab795b50f7 100644 --- a/samples/client/petstore/jmeter/PetApi.csv +++ b/samples/client/petstore/jmeter/PetApi.csv @@ -1,2 +1,2 @@ -testCase,httpStatusCode,body,petId,apiKey,status,tags,petId,body,petId,name,status,petId,additionalMetadata,file +testCase,httpStatusCode,pet,petId,apiKey,status,tags,petId,pet,petId,name,status,petId,additionalMetadata,file Success,200,0,0,0,0,0,0,0,0,0,0,0,0,0 \ No newline at end of file diff --git a/samples/client/petstore/jmeter/StoreApi.csv b/samples/client/petstore/jmeter/StoreApi.csv index 70fd54e2b20..2ccf8884aff 100644 --- a/samples/client/petstore/jmeter/StoreApi.csv +++ b/samples/client/petstore/jmeter/StoreApi.csv @@ -1,2 +1,2 @@ -testCase,httpStatusCode,orderId,orderId,body +testCase,httpStatusCode,orderId,orderId,order Success,200,0,0,0 \ No newline at end of file diff --git a/samples/client/petstore/jmeter/UserApi.csv b/samples/client/petstore/jmeter/UserApi.csv index 92242d4077c..66fcc84a590 100644 --- a/samples/client/petstore/jmeter/UserApi.csv +++ b/samples/client/petstore/jmeter/UserApi.csv @@ -1,2 +1,2 @@ -testCase,httpStatusCode,body,body,body,username,username,username,password,username,body +testCase,httpStatusCode,user,user,user,username,username,username,password,username,user Success,200,0,0,0,0,0,0,0,0,0 \ No newline at end of file From d3b1721da038b0a559f8232dfdae22f622d004a4 Mon Sep 17 00:00:00 2001 From: Benjamin Gill Date: Mon, 25 Jun 2018 17:17:47 +0100 Subject: [PATCH 35/35] [rust-server] Update to error-chain 0.12 (#395) * Update to error-chain 0.12: 0.11 doesn't work with Rust 1.27.0 (new warnings) * Revert commit 845df89e9511e8b972042a4376230d3d9f974659 --- .../src/main/resources/rust-server/Cargo.mustache | 2 +- pom.xml | 2 +- samples/server/petstore/rust-server/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache index c52c1e88977..f3496ed3856 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache @@ -47,4 +47,4 @@ uuid = {version = "0.5", optional = true, features = ["serde", "v4"]} [dev-dependencies] clap = "2.25" -error-chain = "0.11" +error-chain = "0.12" diff --git a/pom.xml b/pom.xml index b7040100d01..11acff4e3d1 100644 --- a/pom.xml +++ b/pom.xml @@ -959,7 +959,7 @@ samples/client/petstore/typescript-angular-v4.3/npm samples/client/petstore/ruby - + samples/server/petstore/rust-server diff --git a/samples/server/petstore/rust-server/Cargo.toml b/samples/server/petstore/rust-server/Cargo.toml index 536506c88c6..ce79b9f32b6 100644 --- a/samples/server/petstore/rust-server/Cargo.toml +++ b/samples/server/petstore/rust-server/Cargo.toml @@ -45,4 +45,4 @@ serde-xml-rs = {git = "git://github.com/Metaswitch/serde-xml-rs.git" , branch = [dev-dependencies] clap = "2.25" -error-chain = "0.11" +error-chain = "0.12"