diff --git a/.gitignore b/.gitignore index 1644461681c..6fdf7574e3c 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ packages/ .pub .packages .vagrant/ +.vscode/ .settings diff --git a/README.md b/README.md index d4959433bab..8caf5a7d365 100644 --- a/README.md +++ b/README.md @@ -809,6 +809,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [Webever GmbH](https://www.webever.de/) - [WEXO A/S](https://www.wexo.dk/) - [XSky](http://www.xsky.com/) +- [Yelp](http://www.yelp.com/) - [Zalando](https://tech.zalando.com) - [ZEEF.com](https://zeef.com/) diff --git a/bin/java-petstore-all.sh b/bin/java-petstore-all.sh index 226d7eaabc9..d0211895700 100755 --- a/bin/java-petstore-all.sh +++ b/bin/java-petstore-all.sh @@ -9,6 +9,7 @@ ./bin/java-petstore-retrofit.sh ./bin/java-petstore-retrofit2.sh ./bin/java-petstore-retrofit2rx.sh +./bin/java-petstore-retrofit2rx2.sh ./bin/java8-petstore-jersey2.sh ./bin/java-petstore-retrofit2-play24.sh ./bin/java-petstore-jersey2-java6.sh diff --git a/bin/spring-all-pestore.sh b/bin/spring-all-pestore.sh index d14665c42d5..77d67ec37d7 100755 --- a/bin/spring-all-pestore.sh +++ b/bin/spring-all-pestore.sh @@ -7,4 +7,5 @@ ./bin/spring-mvc-petstore-j8-async-server.sh ./bin/springboot-petstore-server.sh ./bin/spring-mvc-petstore-server.sh -./bin/springboot-petstore-server-beanvalidation.sh \ No newline at end of file +./bin/springboot-petstore-server-beanvalidation.sh +./bin/springboot-petstore-server-implicitHeaders.sh diff --git a/bin/typescript-angular2-petstore-all.sh b/bin/typescript-angular2-petstore-all.sh index b3fc0df2126..4932e26bda4 100755 --- a/bin/typescript-angular2-petstore-all.sh +++ b/bin/typescript-angular2-petstore-all.sh @@ -28,9 +28,9 @@ fi export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" echo "Typescript Petstore API client (default)" -ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-angular2 -o samples/client/petstore/typescript-angular2/default" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l typescript-angular2 -o samples/client/petstore/typescript-angular2/default" java $JAVA_OPTS -jar $executable $ags echo "Typescript Petstore API client (npm setting)" -ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-angular2 -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-angular2/npm" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l typescript-angular2 -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-angular2/npm" java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java index 7f89ef738a0..1be1d2706a4 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java @@ -25,6 +25,7 @@ public class CodegenModel { public String discriminator; public String defaultValue; public String arrayModelType; + public boolean isAlias; // Is this effectively an alias of another simple type public List vars = new ArrayList(); public List requiredVars = new ArrayList(); // a list of required properties public List optionalVars = new ArrayList(); // a list of optional properties diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index d5981410a2d..37cf566d899 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -116,6 +116,8 @@ public class DefaultCodegen { // They are translated to words like "Dollar" and prefixed with ' // Then translated back during JSON encoding and decoding protected Map specialCharReplacements = new HashMap(); + // When a model is an alias for a simple type + protected Map typeAliases = new HashMap<>(); protected String ignoreFilePathOverride; @@ -1210,6 +1212,18 @@ public class DefaultCodegen { return swaggerType; } + /** + * Determine the type alias for the given type if it exists. This feature + * is only used for Java, because the language does not have a aliasing + * mechanism of its own. + * @param name The type name. + * @return The alias of the given type, if it exists. If there is no alias + * for this type, then returns the input type name. + */ + public String getAlias(String name) { + return name; + } + /** * Output the API (class) name (capitalized) ending with "Api" * Return DefaultApi if name is empty @@ -1374,6 +1388,10 @@ public class DefaultCodegen { ModelImpl impl = (ModelImpl) model; if (impl.getType() != null) { Property p = PropertyBuilder.build(impl.getType(), impl.getFormat(), null); + if (!impl.getType().equals("object") && impl.getEnum() == null) { + typeAliases.put(name, impl.getType()); + m.isAlias = true; + } m.dataType = getSwaggerType(p); } if(impl.getEnum() != null && impl.getEnum().size() > 0) { @@ -2526,6 +2544,7 @@ public class DefaultCodegen { Model sub = bp.getSchema(); if (sub instanceof RefModel) { String name = ((RefModel) sub).getSimpleRef(); + name = getAlias(name); if (typeMapping.containsKey(name)) { name = typeMapping.get(name); } else { diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java index abd4b0d2c97..a6a08ea1d88 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java @@ -4,6 +4,7 @@ import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; import io.swagger.codegen.ignore.CodegenIgnoreProcessor; import io.swagger.codegen.utils.ImplementationVersion; +import io.swagger.codegen.languages.AbstractJavaCodegen; import io.swagger.models.*; import io.swagger.models.auth.OAuth2Definition; import io.swagger.models.auth.SecuritySchemeDefinition; @@ -327,7 +328,17 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { if(config.importMapping().containsKey(modelName)) { continue; } - allModels.add(((List) models.get("models")).get(0)); + Map modelTemplate = (Map) ((List) models.get("models")).get(0); + if (config instanceof AbstractJavaCodegen) { + // Special handling of aliases only applies to Java + if (modelTemplate != null && modelTemplate.containsKey("model")) { + CodegenModel m = (CodegenModel) modelTemplate.get("model"); + if (m.isAlias) { + continue; // Don't create user-defined classes for aliases + } + } + } + allModels.add(modelTemplate); for (String templateName : config.modelTemplateFiles().keySet()) { String suffix = config.modelTemplateFiles().get(templateName); String filename = config.modelFileFolder() + File.separator + config.toModelFilename(modelName) + suffix; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index 5123472ff36..a1567a33df6 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -581,6 +581,14 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code return super.getTypeDeclaration(p); } + @Override + public String getAlias(String name) { + if (typeAliases.containsKey(name)) { + return typeAliases.get(name); + } + return name; + } + @Override public String toDefaultValue(Property p) { if (p instanceof ArrayProperty) { @@ -730,6 +738,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code public String getSwaggerType(Property p) { String swaggerType = super.getSwaggerType(p); + swaggerType = getAlias(swaggerType); + // don't apply renaming on types from the typeMapping if (typeMapping.containsKey(swaggerType)) { return typeMapping.get(swaggerType); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AndroidClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AndroidClientCodegen.java index ba96eb2e6e9..73a8d9859c7 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AndroidClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AndroidClientCodegen.java @@ -64,7 +64,7 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi "import", "public", "throws", "case", "enum", "instanceof", "return", "transient", "catch", "extends", "int", "short", "try", "char", "final", "interface", "static", "void", "class", "finally", "long", "strictfp", "volatile", "const", "float", - "native", "super", "while") + "native", "super", "while", "null") ); languageSpecificPrimitives = new HashSet( diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java index 0c0993c3e03..c4f9eba2f66 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FlaskConnexionCodegen.java @@ -69,6 +69,17 @@ public class FlaskConnexionCodegen extends DefaultCodegen implements CodegenConf typeMapping.put("file", "file"); typeMapping.put("UUID", "str"); + // from https://docs.python.org/release/2.5.4/ref/keywords.html + setReservedWordsLowerCase( + Arrays.asList( + // @property + "property", + // python reserved words + "and", "del", "from", "not", "while", "as", "elif", "global", "or", "with", + "assert", "else", "if", "pass", "yield", "break", "except", "import", + "print", "class", "exec", "in", "raise", "continue", "finally", "is", + "return", "def", "for", "lambda", "try", "self", "None")); + // set the output folder here outputFolder = "generated-code/connexion"; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java index 92d5a46f19f..f1037c82dec 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java @@ -56,7 +56,8 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig { "case", "defer", "go", "map", "struct", "chan", "else", "goto", "package", "switch", "const", "fallthrough", "if", "range", "type", - "continue", "for", "import", "return", "var", "error", "ApiResponse") + "continue", "for", "import", "return", "var", "error", "ApiResponse", + "nil") // Added "error" as it's used so frequently that it may as well be a keyword ); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoServerCodegen.java index 60fbe839674..a827ed15e77 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoServerCodegen.java @@ -78,7 +78,8 @@ public class GoServerCodegen extends DefaultCodegen implements CodegenConfig { "case", "defer", "go", "map", "struct", "chan", "else", "goto", "package", "switch", "const", "fallthrough", "if", "range", "type", - "continue", "for", "import", "return", "var", "error", "ApiResponse") + "continue", "for", "import", "return", "var", "error", "ApiResponse", + "nil") // Added "error" as it's used so frequently that it may as well be a keyword ); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java index 3261aa153e1..57351f58864 100755 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java @@ -101,7 +101,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig "and", "del", "from", "not", "while", "as", "elif", "global", "or", "with", "assert", "else", "if", "pass", "yield", "break", "except", "import", "print", "class", "exec", "in", "raise", "continue", "finally", "is", - "return", "def", "for", "lambda", "try", "self")); + "return", "def", "for", "lambda", "try", "self", "None")); regexModifiers = new HashMap(); regexModifiers.put('i', "IGNORECASE"); diff --git a/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache index 153867a0a97..8fc859c691c 100644 --- a/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache @@ -75,6 +75,7 @@ public class ApiClient { objectMapper = new ObjectMapper(); objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + objectMapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache index d0dbba06c78..fa1dea42e8a 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache @@ -152,6 +152,7 @@ public class ApiClient { objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + objectMapper.disable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE); objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); objectMapper.setDateFormat(new RFC3339DateFormat()); {{#joda}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/JSON.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/JSON.mustache index b1c4e025ac9..911391a6baf 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/JSON.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/JSON.mustache @@ -27,6 +27,7 @@ public class JSON implements ContextResolver { mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index 8309da3e5d5..5d4d5cdfa20 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -909,6 +909,26 @@ public class ApiClient { * @throws ApiException If fail to serialize the request body object */ public Call buildCall(String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Request request = buildRequest(path, method, queryParams, body, headerParams, formParams, authNames, progressRequestListener); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param progressRequestListener Progress request listener + * @return The HTTP request + * @throws ApiException If fail to serialize the request body object + */ + public Request buildRequest(String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { updateParamsForAuth(authNames, queryParams, headerParams); final String url = buildUrl(path, queryParams); @@ -949,7 +969,7 @@ public class ApiClient { request = reqBuilder.method(method, reqBody).build(); } - return httpClient.newCall(request); + return request; } /** diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/JSON.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/JSON.mustache index ec15354a8a6..27d2aa65d23 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/JSON.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/JSON.mustache @@ -21,6 +21,7 @@ public class JSON implements ContextResolver { mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); diff --git a/modules/swagger-codegen/src/main/resources/flaskConnexion/encoder.mustache b/modules/swagger-codegen/src/main/resources/flaskConnexion/encoder.mustache index 2f2c5416708..996d74f21e7 100644 --- a/modules/swagger-codegen/src/main/resources/flaskConnexion/encoder.mustache +++ b/modules/swagger-codegen/src/main/resources/flaskConnexion/encoder.mustache @@ -1,9 +1,8 @@ -from connexion.decorators import produces from six import iteritems from {{modelPackage}}.base_model_ import Model +from connexion.apps.flask_app import FlaskJSONEncoder - -class JSONEncoder(produces.JSONEncoder): +class JSONEncoder(FlaskJSONEncoder): include_nulls = False def default(self, o): @@ -16,4 +15,4 @@ class JSONEncoder(produces.JSONEncoder): attr = o.attribute_map[attr] dikt[attr] = value return dikt - return produces.JSONEncoder.default(self, o) \ No newline at end of file + return FlaskJSONEncoder.default(self, o) \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/flaskConnexion/requirements.mustache b/modules/swagger-codegen/src/main/resources/flaskConnexion/requirements.mustache index b36f4a65b57..30ec45ba153 100644 --- a/modules/swagger-codegen/src/main/resources/flaskConnexion/requirements.mustache +++ b/modules/swagger-codegen/src/main/resources/flaskConnexion/requirements.mustache @@ -1,4 +1,4 @@ -connexion == 1.0.129 +connexion == 1.1.9 python_dateutil == 2.6.0 {{#supportPython2}} typing == 3.5.2.2 diff --git a/modules/swagger-codegen/src/main/resources/python/api_client.mustache b/modules/swagger-codegen/src/main/resources/python/api_client.mustache index 070e2483ee0..06148fef489 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -593,16 +593,17 @@ class ApiClient(object): :param klass: class literal. :return: model object. """ - instance = klass() - - if not instance.swagger_types: + if not klass.swagger_types: return data - for attr, attr_type in iteritems(instance.swagger_types): + kwargs = {} + for attr, attr_type in iteritems(klass.swagger_types): if data is not None \ - and instance.attribute_map[attr] in data \ + and klass.attribute_map[attr] in data \ and isinstance(data, (list, dict)): - value = data[instance.attribute_map[attr]] - setattr(instance, attr, self.__deserialize(value, attr_type)) + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) return instance diff --git a/modules/swagger-codegen/src/main/resources/python/model.mustache b/modules/swagger-codegen/src/main/resources/python/model.mustache index cea2e4aa33a..78d3925f197 100644 --- a/modules/swagger-codegen/src/main/resources/python/model.mustache +++ b/modules/swagger-codegen/src/main/resources/python/model.mustache @@ -14,42 +14,50 @@ class {{classname}}(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ -{{#allowableValues}} +{{#allowableValues}} + """ + allowed enum values + """ {{#enumVars}} {{name}} = {{{value}}} {{/enumVars}} - {{/allowableValues}} + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + {{#vars}}'{{name}}': '{{{datatype}}}'{{#hasMore}}, + {{/hasMore}}{{/vars}} + } + + attribute_map = { + {{#vars}}'{{name}}': '{{baseName}}'{{#hasMore}}, + {{/hasMore}}{{/vars}} + } + def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}): """ {{classname}} - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - {{#vars}}'{{name}}': '{{{datatype}}}'{{#hasMore}}, - {{/hasMore}}{{/vars}} - } - - self.attribute_map = { - {{#vars}}'{{name}}': '{{baseName}}'{{#hasMore}}, - {{/hasMore}}{{/vars}} - } {{#vars}} self._{{name}} = None {{/vars}} - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well {{#vars}} +{{#required}} + self.{{name}} = {{name}} +{{/required}} +{{^required}} if {{name}} is not None: self.{{name}} = {{name}} +{{/required}} {{/vars}} {{#vars}} diff --git a/modules/swagger-codegen/src/main/resources/python/model_test.mustache b/modules/swagger-codegen/src/main/resources/python/model_test.mustache index 9e1b72b14a0..5f1b116b776 100644 --- a/modules/swagger-codegen/src/main/resources/python/model_test.mustache +++ b/modules/swagger-codegen/src/main/resources/python/model_test.mustache @@ -28,7 +28,9 @@ class Test{{classname}}(unittest.TestCase): """ Test {{classname}} """ - model = {{packageName}}.models.{{classFilename}}.{{classname}}() + # FIXME: construct object with mandatory attributes with example values + #model = {{packageName}}.models.{{classFilename}}.{{classname}}() + pass {{/model}} {{/models}} diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index 4d21a912a52..af6a571b627 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -804,6 +804,74 @@ paths: description: User not found security: - http_basic_test: [] + /fake/outer/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + parameters: + - name: body + in: body + description: Input number as post body + schema: + $ref: '#/definitions/OuterNumber' + responses: + '200': + description: Output number + schema: + $ref: '#/definitions/OuterNumber' + /fake/outer/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + parameters: + - name: body + in: body + description: Input string as post body + schema: + $ref: '#/definitions/OuterString' + responses: + '200': + description: Output string + schema: + $ref: '#/definitions/OuterString' + /fake/outer/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + parameters: + - name: body + in: body + description: Input boolean as post body + schema: + $ref: '#/definitions/OuterBoolean' + responses: + '200': + description: Output boolean + schema: + $ref: '#/definitions/OuterBoolean' + /fake/outer/composite: + post: + tags: + - fake + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + parameters: + - name: body + in: body + description: Input composite as post body + schema: + $ref: '#/definitions/OuterComposite' + responses: + '200': + description: Output composite + schema: + $ref: '#/definitions/OuterComposite' securityDefinitions: petstore_auth: type: oauth2 @@ -1281,6 +1349,21 @@ definitions: - "placed" - "approved" - "delivered" + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + OuterComposite: + type: object + properties: + my_number: + $ref: '#/definitions/OuterNumber' + my_string: + $ref: '#/definitions/OuterString' + my_boolean: + $ref: '#/definitions/OuterBoolean' externalDocs: description: Find out more about Swagger url: 'http://swagger.io' diff --git a/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java index 33534ab256f..365c87ff45e 100644 --- a/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java @@ -1091,6 +1091,26 @@ public class ApiClient { * @throws ApiException If fail to serialize the request body object */ public Call buildCall(String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Request request = buildRequest(path, method, queryParams, body, headerParams, formParams, authNames, progressRequestListener); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param progressRequestListener Progress request listener + * @return The HTTP request + * @throws ApiException If fail to serialize the request body object + */ + public Request buildRequest(String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { updateParamsForAuth(authNames, queryParams, headerParams); final String url = buildUrl(path, queryParams); @@ -1131,7 +1151,7 @@ public class ApiClient { request = reqBuilder.method(method, reqBody).build(); } - return httpClient.newCall(request); + return request; } /** diff --git a/samples/client/petstore/bash/_petstore-cli b/samples/client/petstore/bash/_petstore-cli index 146c4b25ed1..10cd43c62b7 100644 --- a/samples/client/petstore/bash/_petstore-cli +++ b/samples/client/petstore/bash/_petstore-cli @@ -296,6 +296,10 @@ case $state in ops) # Operations _values "Operations" \ + "fakeOuterBooleanSerialize[]" \ + "fakeOuterCompositeSerialize[]" \ + "fakeOuterNumberSerialize[]" \ + "fakeOuterStringSerialize[]" \ "testClientModel[To test \"client\" model]" \ "testEndpointParameters[Fake endpoint for testing various parameters 假端點 @@ -325,6 +329,30 @@ case $state in ;; args) case $line[1] in + fakeOuterBooleanSerialize) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + fakeOuterCompositeSerialize) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + fakeOuterNumberSerialize) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + fakeOuterStringSerialize) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; testClientModel) local -a _op_arguments _op_arguments=( diff --git a/samples/client/petstore/bash/petstore-cli b/samples/client/petstore/bash/petstore-cli index 49f3c81ba16..6d3dffc15f8 100755 --- a/samples/client/petstore/bash/petstore-cli +++ b/samples/client/petstore/bash/petstore-cli @@ -66,6 +66,10 @@ declare -A operation_parameters # 0 - optional # 1 - required declare -A operation_parameters_minimum_occurences +operation_parameters_minimum_occurences["fakeOuterBooleanSerialize:::body"]=0 +operation_parameters_minimum_occurences["fakeOuterCompositeSerialize:::body"]=0 +operation_parameters_minimum_occurences["fakeOuterNumberSerialize:::body"]=0 +operation_parameters_minimum_occurences["fakeOuterStringSerialize:::body"]=0 operation_parameters_minimum_occurences["testClientModel:::body"]=1 operation_parameters_minimum_occurences["testEndpointParameters:::number"]=1 operation_parameters_minimum_occurences["testEndpointParameters:::double"]=1 @@ -123,6 +127,10 @@ operation_parameters_minimum_occurences["updateUser:::body"]=1 # N - N values # 0 - unlimited declare -A operation_parameters_maximum_occurences +operation_parameters_maximum_occurences["fakeOuterBooleanSerialize:::body"]=0 +operation_parameters_maximum_occurences["fakeOuterCompositeSerialize:::body"]=0 +operation_parameters_maximum_occurences["fakeOuterNumberSerialize:::body"]=0 +operation_parameters_maximum_occurences["fakeOuterStringSerialize:::body"]=0 operation_parameters_maximum_occurences["testClientModel:::body"]=0 operation_parameters_maximum_occurences["testEndpointParameters:::number"]=0 operation_parameters_maximum_occurences["testEndpointParameters:::double"]=0 @@ -177,6 +185,10 @@ operation_parameters_maximum_occurences["updateUser:::body"]=0 # The type of collection for specifying multiple values for parameter: # - multi, csv, ssv, tsv declare -A operation_parameters_collection_type +operation_parameters_collection_type["fakeOuterBooleanSerialize:::body"]="" +operation_parameters_collection_type["fakeOuterCompositeSerialize:::body"]="" +operation_parameters_collection_type["fakeOuterNumberSerialize:::body"]="" +operation_parameters_collection_type["fakeOuterStringSerialize:::body"]="" operation_parameters_collection_type["testClientModel:::body"]="" operation_parameters_collection_type["testEndpointParameters:::number"]="" operation_parameters_collection_type["testEndpointParameters:::double"]="" @@ -714,6 +726,10 @@ EOF echo "" echo -e "$(tput bold)$(tput setaf 7)[fake]$(tput sgr0)" read -d '' ops < + /// OuterBoolean + /// + [DataContract] + public partial class OuterBoolean : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public OuterBoolean() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterBoolean {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as OuterBoolean); + } + + /// + /// Returns true if OuterBoolean instances are equal + /// + /// Instance of OuterBoolean to be compared + /// Boolean + public bool Equals(OuterBoolean other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + return hash; + } + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Model/OuterComposite.cs b/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Model/OuterComposite.cs new file mode 100644 index 00000000000..308c26d4f5c --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Model/OuterComposite.cs @@ -0,0 +1,144 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace IO.Swagger.Model +{ + /// + /// OuterComposite + /// + [DataContract] + public partial class OuterComposite : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// MyNumber. + /// MyString. + /// MyBoolean. + public OuterComposite(OuterNumber MyNumber = default(OuterNumber), OuterString MyString = default(OuterString), OuterBoolean MyBoolean = default(OuterBoolean)) + { + this.MyNumber = MyNumber; + this.MyString = MyString; + this.MyBoolean = MyBoolean; + } + + /// + /// Gets or Sets MyNumber + /// + [DataMember(Name="my_number", EmitDefaultValue=false)] + public OuterNumber MyNumber { get; set; } + /// + /// Gets or Sets MyString + /// + [DataMember(Name="my_string", EmitDefaultValue=false)] + public OuterString MyString { get; set; } + /// + /// Gets or Sets MyBoolean + /// + [DataMember(Name="my_boolean", EmitDefaultValue=false)] + public OuterBoolean MyBoolean { get; set; } + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterComposite {\n"); + sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); + sb.Append(" MyString: ").Append(MyString).Append("\n"); + sb.Append(" MyBoolean: ").Append(MyBoolean).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as OuterComposite); + } + + /// + /// Returns true if OuterComposite instances are equal + /// + /// Instance of OuterComposite to be compared + /// Boolean + public bool Equals(OuterComposite other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return + ( + this.MyNumber == other.MyNumber || + this.MyNumber != null && + this.MyNumber.Equals(other.MyNumber) + ) && + ( + this.MyString == other.MyString || + this.MyString != null && + this.MyString.Equals(other.MyString) + ) && + ( + this.MyBoolean == other.MyBoolean || + this.MyBoolean != null && + this.MyBoolean.Equals(other.MyBoolean) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.MyNumber != null) + hash = hash * 59 + this.MyNumber.GetHashCode(); + if (this.MyString != null) + hash = hash * 59 + this.MyString.GetHashCode(); + if (this.MyBoolean != null) + hash = hash * 59 + this.MyBoolean.GetHashCode(); + return hash; + } + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Model/OuterNumber.cs b/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Model/OuterNumber.cs new file mode 100644 index 00000000000..103fd4f69dd --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Model/OuterNumber.cs @@ -0,0 +1,100 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace IO.Swagger.Model +{ + /// + /// OuterNumber + /// + [DataContract] + public partial class OuterNumber : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public OuterNumber() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterNumber {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as OuterNumber); + } + + /// + /// Returns true if OuterNumber instances are equal + /// + /// Instance of OuterNumber to be compared + /// Boolean + public bool Equals(OuterNumber other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + return hash; + } + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Model/OuterString.cs b/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Model/OuterString.cs new file mode 100644 index 00000000000..327fe620b59 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient.v5/src/IO.Swagger/Model/OuterString.cs @@ -0,0 +1,100 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace IO.Swagger.Model +{ + /// + /// OuterString + /// + [DataContract] + public partial class OuterString : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public OuterString() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterString {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as OuterString); + } + + /// + /// Returns true if OuterString instances are equal + /// + /// Instance of OuterString to be compared + /// Boolean + public bool Equals(OuterString other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + return hash; + } + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClient/README.md index c82e8fb71fb..d2f2aa2168e 100644 --- a/samples/client/petstore/csharp/SwaggerClient/README.md +++ b/samples/client/petstore/csharp/SwaggerClient/README.md @@ -69,17 +69,16 @@ namespace Example { var apiInstance = new FakeApi(); - var body = new ModelClient(); // ModelClient | client model + var body = new OuterBoolean(); // OuterBoolean | Input boolean as post body (optional) try { - // To test \"client\" model - ModelClient result = apiInstance.TestClientModel(body); + OuterBoolean result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } catch (Exception e) { - Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); } } } @@ -93,6 +92,10 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | *FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters @@ -148,7 +151,11 @@ Class | Method | HTTP request | Description - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) - [Model.Order](docs/Order.md) + - [Model.OuterBoolean](docs/OuterBoolean.md) + - [Model.OuterComposite](docs/OuterComposite.md) - [Model.OuterEnum](docs/OuterEnum.md) + - [Model.OuterNumber](docs/OuterNumber.md) + - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Model.SpecialModelName](docs/SpecialModelName.md) diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md b/samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md index 82a3463dacb..1277461eb1d 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md @@ -4,11 +4,259 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | [**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model [**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters + +# **FakeOuterBooleanSerialize** +> OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) + + + +Test serialization of outer boolean types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterBooleanSerializeExample + { + public void main() + { + + var apiInstance = new FakeApi(); + var body = new OuterBoolean(); // OuterBoolean | Input boolean as post body (optional) + + try + { + OuterBoolean result = apiInstance.FakeOuterBooleanSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + +### Return type + +[**OuterBoolean**](OuterBoolean.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterCompositeSerialize** +> OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + + + +Test serialization of object with outer number type + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterCompositeSerializeExample + { + public void main() + { + + var apiInstance = new FakeApi(); + var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + + try + { + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterNumberSerialize** +> OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) + + + +Test serialization of outer number types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterNumberSerializeExample + { + public void main() + { + + var apiInstance = new FakeApi(); + var body = new OuterNumber(); // OuterNumber | Input number as post body (optional) + + try + { + OuterNumber result = apiInstance.FakeOuterNumberSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + +### Return type + +[**OuterNumber**](OuterNumber.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterStringSerialize** +> OuterString FakeOuterStringSerialize (OuterString body = null) + + + +Test serialization of outer string types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterStringSerializeExample + { + public void main() + { + + var apiInstance = new FakeApi(); + var body = new OuterString(); // OuterString | Input string as post body (optional) + + try + { + OuterString result = apiInstance.FakeOuterStringSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + +### Return type + +[**OuterString**](OuterString.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **TestClientModel** > ModelClient TestClientModel (ModelClient body) diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/OuterBoolean.md b/samples/client/petstore/csharp/SwaggerClient/docs/OuterBoolean.md new file mode 100644 index 00000000000..84845b35e54 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/docs/OuterBoolean.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.OuterBoolean +## 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/csharp/SwaggerClient/docs/OuterComposite.md b/samples/client/petstore/csharp/SwaggerClient/docs/OuterComposite.md new file mode 100644 index 00000000000..41fae66f136 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/docs/OuterComposite.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.OuterComposite +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyNumber** | [**OuterNumber**](OuterNumber.md) | | [optional] +**MyString** | [**OuterString**](OuterString.md) | | [optional] +**MyBoolean** | [**OuterBoolean**](OuterBoolean.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/csharp/SwaggerClient/docs/OuterNumber.md b/samples/client/petstore/csharp/SwaggerClient/docs/OuterNumber.md new file mode 100644 index 00000000000..7c88274d6ee --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/docs/OuterNumber.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.OuterNumber +## 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/csharp/SwaggerClient/docs/OuterString.md b/samples/client/petstore/csharp/SwaggerClient/docs/OuterString.md new file mode 100644 index 00000000000..524423a5dab --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/docs/OuterString.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.OuterString +## 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/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterBooleanTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterBooleanTests.cs new file mode 100644 index 00000000000..a24e20009cc --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterBooleanTests.cs @@ -0,0 +1,70 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing OuterBoolean + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class OuterBooleanTests + { + // TODO uncomment below to declare an instance variable for OuterBoolean + //private OuterBoolean instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of OuterBoolean + //instance = new OuterBoolean(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of OuterBoolean + /// + [Test] + public void OuterBooleanInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" OuterBoolean + //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterBoolean"); + } + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterCompositeTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterCompositeTests.cs new file mode 100644 index 00000000000..3d2ab500d1a --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterCompositeTests.cs @@ -0,0 +1,94 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing OuterComposite + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class OuterCompositeTests + { + // TODO uncomment below to declare an instance variable for OuterComposite + //private OuterComposite instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of OuterComposite + //instance = new OuterComposite(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of OuterComposite + /// + [Test] + public void OuterCompositeInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" OuterComposite + //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterComposite"); + } + + /// + /// Test the property 'MyNumber' + /// + [Test] + public void MyNumberTest() + { + // TODO unit test for the property 'MyNumber' + } + /// + /// Test the property 'MyString' + /// + [Test] + public void MyStringTest() + { + // TODO unit test for the property 'MyString' + } + /// + /// Test the property 'MyBoolean' + /// + [Test] + public void MyBooleanTest() + { + // TODO unit test for the property 'MyBoolean' + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterNumberTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterNumberTests.cs new file mode 100644 index 00000000000..66a97a03e7b --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterNumberTests.cs @@ -0,0 +1,70 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing OuterNumber + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class OuterNumberTests + { + // TODO uncomment below to declare an instance variable for OuterNumber + //private OuterNumber instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of OuterNumber + //instance = new OuterNumber(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of OuterNumber + /// + [Test] + public void OuterNumberInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" OuterNumber + //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterNumber"); + } + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterStringTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterStringTests.cs new file mode 100644 index 00000000000..f6397957ece --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterStringTests.cs @@ -0,0 +1,70 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing OuterString + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class OuterStringTests + { + // TODO uncomment below to declare an instance variable for OuterString + //private OuterString instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of OuterString + //instance = new OuterString(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of OuterString + /// + [Test] + public void OuterStringInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" OuterString + //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterString"); + } + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs index 03a6ebb97ad..c39d65ed235 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs @@ -25,6 +25,90 @@ namespace IO.Swagger.Api { #region Synchronous Operations /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// OuterBoolean + OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// ApiResponse of OuterBoolean + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null); + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// OuterComposite + OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// ApiResponse of OuterComposite + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null); + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// OuterNumber + OuterNumber FakeOuterNumberSerialize (OuterNumber body = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// ApiResponse of OuterNumber + ApiResponse FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null); + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// OuterString + OuterString FakeOuterStringSerialize (OuterString body = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// ApiResponse of OuterString + ApiResponse FakeOuterStringSerializeWithHttpInfo (OuterString body = null); + /// /// To test \"client\" model /// /// @@ -130,6 +214,90 @@ namespace IO.Swagger.Api #endregion Synchronous Operations #region Asynchronous Operations /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of OuterBoolean + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of ApiResponse (OuterBoolean) + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null); + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of OuterComposite + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of ApiResponse (OuterComposite) + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null); + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of OuterNumber + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of ApiResponse (OuterNumber) + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null); + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of OuterString + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of ApiResponse (OuterString) + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null); + /// /// To test \"client\" model /// /// @@ -344,6 +512,570 @@ namespace IO.Swagger.Api this.Configuration.AddDefaultHeader(key, value); } + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// OuterBoolean + public OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) + { + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// ApiResponse of OuterBoolean + public ApiResponse< OuterBoolean > FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null) + { + + var localVarPath = "/fake/outer/boolean"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (OuterBoolean) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterBoolean))); + + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of OuterBoolean + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null) + { + ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of ApiResponse (OuterBoolean) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null) + { + + var localVarPath = "/fake/outer/boolean"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (OuterBoolean) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterBoolean))); + + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// OuterComposite + public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + { + ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// ApiResponse of OuterComposite + public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null) + { + + var localVarPath = "/fake/outer/composite"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (OuterComposite) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterComposite))); + + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of OuterComposite + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null) + { + ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of ApiResponse (OuterComposite) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null) + { + + var localVarPath = "/fake/outer/composite"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (OuterComposite) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterComposite))); + + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// OuterNumber + public OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) + { + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// ApiResponse of OuterNumber + public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null) + { + + var localVarPath = "/fake/outer/number"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (OuterNumber) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterNumber))); + + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of OuterNumber + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null) + { + ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of ApiResponse (OuterNumber) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null) + { + + var localVarPath = "/fake/outer/number"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (OuterNumber) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterNumber))); + + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// OuterString + public OuterString FakeOuterStringSerialize (OuterString body = null) + { + ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// ApiResponse of OuterString + public ApiResponse< OuterString > FakeOuterStringSerializeWithHttpInfo (OuterString body = null) + { + + var localVarPath = "/fake/outer/string"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterStringSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (OuterString) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterString))); + + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of OuterString + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null) + { + ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of ApiResponse (OuterString) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null) + { + + var localVarPath = "/fake/outer/string"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterStringSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (OuterString) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterString))); + + } + /// /// To test \"client\" model To test \"client\" model /// diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterBoolean.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterBoolean.cs new file mode 100644 index 00000000000..c25f48db758 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterBoolean.cs @@ -0,0 +1,112 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; + +namespace IO.Swagger.Model +{ + /// + /// OuterBoolean + /// + [DataContract] + public partial class OuterBoolean : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public OuterBoolean() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterBoolean {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as OuterBoolean); + } + + /// + /// Returns true if OuterBoolean instances are equal + /// + /// Instance of OuterBoolean to be compared + /// Boolean + public bool Equals(OuterBoolean other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + return hash; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterComposite.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterComposite.cs new file mode 100644 index 00000000000..ce12f7bb6ce --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterComposite.cs @@ -0,0 +1,156 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; + +namespace IO.Swagger.Model +{ + /// + /// OuterComposite + /// + [DataContract] + public partial class OuterComposite : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// MyNumber. + /// MyString. + /// MyBoolean. + public OuterComposite(OuterNumber MyNumber = default(OuterNumber), OuterString MyString = default(OuterString), OuterBoolean MyBoolean = default(OuterBoolean)) + { + this.MyNumber = MyNumber; + this.MyString = MyString; + this.MyBoolean = MyBoolean; + } + + /// + /// Gets or Sets MyNumber + /// + [DataMember(Name="my_number", EmitDefaultValue=false)] + public OuterNumber MyNumber { get; set; } + /// + /// Gets or Sets MyString + /// + [DataMember(Name="my_string", EmitDefaultValue=false)] + public OuterString MyString { get; set; } + /// + /// Gets or Sets MyBoolean + /// + [DataMember(Name="my_boolean", EmitDefaultValue=false)] + public OuterBoolean MyBoolean { get; set; } + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterComposite {\n"); + sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); + sb.Append(" MyString: ").Append(MyString).Append("\n"); + sb.Append(" MyBoolean: ").Append(MyBoolean).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as OuterComposite); + } + + /// + /// Returns true if OuterComposite instances are equal + /// + /// Instance of OuterComposite to be compared + /// Boolean + public bool Equals(OuterComposite other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return + ( + this.MyNumber == other.MyNumber || + this.MyNumber != null && + this.MyNumber.Equals(other.MyNumber) + ) && + ( + this.MyString == other.MyString || + this.MyString != null && + this.MyString.Equals(other.MyString) + ) && + ( + this.MyBoolean == other.MyBoolean || + this.MyBoolean != null && + this.MyBoolean.Equals(other.MyBoolean) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.MyNumber != null) + hash = hash * 59 + this.MyNumber.GetHashCode(); + if (this.MyString != null) + hash = hash * 59 + this.MyString.GetHashCode(); + if (this.MyBoolean != null) + hash = hash * 59 + this.MyBoolean.GetHashCode(); + return hash; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterNumber.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterNumber.cs new file mode 100644 index 00000000000..a53914c4840 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterNumber.cs @@ -0,0 +1,112 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; + +namespace IO.Swagger.Model +{ + /// + /// OuterNumber + /// + [DataContract] + public partial class OuterNumber : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public OuterNumber() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterNumber {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as OuterNumber); + } + + /// + /// Returns true if OuterNumber instances are equal + /// + /// Instance of OuterNumber to be compared + /// Boolean + public bool Equals(OuterNumber other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + return hash; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterString.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterString.cs new file mode 100644 index 00000000000..d2d0905e162 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterString.cs @@ -0,0 +1,112 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; + +namespace IO.Swagger.Model +{ + /// + /// OuterString + /// + [DataContract] + public partial class OuterString : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public OuterString() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterString {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as OuterString); + } + + /// + /// Returns true if OuterString instances are equal + /// + /// Instance of OuterString to be compared + /// Boolean + public bool Equals(OuterString other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + return hash; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/README.md b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/README.md index d56551bfcbc..2ffa0ef9f64 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/README.md +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/README.md @@ -49,17 +49,16 @@ namespace Example { var apiInstance = new FakeApi(); - var body = new ModelClient(); // ModelClient | client model + var body = new OuterBoolean(); // OuterBoolean | Input boolean as post body (optional) try { - // To test \"client\" model - ModelClient result = apiInstance.TestClientModel(body); + OuterBoolean result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } catch (Exception e) { - Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); } } } @@ -73,6 +72,10 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | *FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters @@ -127,7 +130,11 @@ Class | Method | HTTP request | Description - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) - [Model.Order](docs/Order.md) + - [Model.OuterBoolean](docs/OuterBoolean.md) + - [Model.OuterComposite](docs/OuterComposite.md) - [Model.OuterEnum](docs/OuterEnum.md) + - [Model.OuterNumber](docs/OuterNumber.md) + - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Model.SpecialModelName](docs/SpecialModelName.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/FakeApi.md b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/FakeApi.md index 82a3463dacb..1277461eb1d 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/FakeApi.md +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/FakeApi.md @@ -4,11 +4,259 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | [**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model [**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters + +# **FakeOuterBooleanSerialize** +> OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) + + + +Test serialization of outer boolean types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterBooleanSerializeExample + { + public void main() + { + + var apiInstance = new FakeApi(); + var body = new OuterBoolean(); // OuterBoolean | Input boolean as post body (optional) + + try + { + OuterBoolean result = apiInstance.FakeOuterBooleanSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + +### Return type + +[**OuterBoolean**](OuterBoolean.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterCompositeSerialize** +> OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + + + +Test serialization of object with outer number type + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterCompositeSerializeExample + { + public void main() + { + + var apiInstance = new FakeApi(); + var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + + try + { + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterNumberSerialize** +> OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) + + + +Test serialization of outer number types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterNumberSerializeExample + { + public void main() + { + + var apiInstance = new FakeApi(); + var body = new OuterNumber(); // OuterNumber | Input number as post body (optional) + + try + { + OuterNumber result = apiInstance.FakeOuterNumberSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + +### Return type + +[**OuterNumber**](OuterNumber.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterStringSerialize** +> OuterString FakeOuterStringSerialize (OuterString body = null) + + + +Test serialization of outer string types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterStringSerializeExample + { + public void main() + { + + var apiInstance = new FakeApi(); + var body = new OuterString(); // OuterString | Input string as post body (optional) + + try + { + OuterString result = apiInstance.FakeOuterStringSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + +### Return type + +[**OuterString**](OuterString.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **TestClientModel** > ModelClient TestClientModel (ModelClient body) diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/FakeApi.cs index 379cb7d7125..dff670d8a6c 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/FakeApi.cs @@ -25,6 +25,90 @@ namespace IO.Swagger.Api { #region Synchronous Operations /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// OuterBoolean + OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// ApiResponse of OuterBoolean + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null); + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// OuterComposite + OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// ApiResponse of OuterComposite + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null); + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// OuterNumber + OuterNumber FakeOuterNumberSerialize (OuterNumber body = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// ApiResponse of OuterNumber + ApiResponse FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null); + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// OuterString + OuterString FakeOuterStringSerialize (OuterString body = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// ApiResponse of OuterString + ApiResponse FakeOuterStringSerializeWithHttpInfo (OuterString body = null); + /// /// To test \"client\" model /// /// @@ -130,6 +214,90 @@ namespace IO.Swagger.Api #endregion Synchronous Operations #region Asynchronous Operations /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of OuterBoolean + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of ApiResponse (OuterBoolean) + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null); + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of OuterComposite + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of ApiResponse (OuterComposite) + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null); + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of OuterNumber + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of ApiResponse (OuterNumber) + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null); + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of OuterString + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of ApiResponse (OuterString) + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null); + /// /// To test \"client\" model /// /// @@ -344,6 +512,570 @@ namespace IO.Swagger.Api this.Configuration.AddDefaultHeader(key, value); } + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// OuterBoolean + public OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) + { + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// ApiResponse of OuterBoolean + public ApiResponse< OuterBoolean > FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null) + { + + var localVarPath = "./fake/outer/boolean"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (OuterBoolean) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterBoolean))); + + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of OuterBoolean + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null) + { + ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of ApiResponse (OuterBoolean) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null) + { + + var localVarPath = "./fake/outer/boolean"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (OuterBoolean) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterBoolean))); + + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// OuterComposite + public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + { + ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// ApiResponse of OuterComposite + public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null) + { + + var localVarPath = "./fake/outer/composite"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (OuterComposite) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterComposite))); + + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of OuterComposite + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null) + { + ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of ApiResponse (OuterComposite) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null) + { + + var localVarPath = "./fake/outer/composite"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (OuterComposite) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterComposite))); + + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// OuterNumber + public OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) + { + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// ApiResponse of OuterNumber + public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null) + { + + var localVarPath = "./fake/outer/number"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (OuterNumber) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterNumber))); + + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of OuterNumber + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null) + { + ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of ApiResponse (OuterNumber) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null) + { + + var localVarPath = "./fake/outer/number"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (OuterNumber) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterNumber))); + + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// OuterString + public OuterString FakeOuterStringSerialize (OuterString body = null) + { + ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// ApiResponse of OuterString + public ApiResponse< OuterString > FakeOuterStringSerializeWithHttpInfo (OuterString body = null) + { + + var localVarPath = "./fake/outer/string"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterStringSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (OuterString) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterString))); + + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of OuterString + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null) + { + ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of ApiResponse (OuterString) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null) + { + + var localVarPath = "./fake/outer/string"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterStringSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (OuterString) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterString))); + + } + /// /// To test \"client\" model To test \"client\" model /// @@ -416,7 +1148,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (ModelClient) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); - } /// @@ -492,7 +1223,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (ModelClient) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); - } /// @@ -570,7 +1300,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml; charset=utf-8", + "application/xml; charset=utf-8", "application/json; charset=utf-8" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -613,7 +1343,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -695,7 +1424,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml; charset=utf-8", + "application/xml; charset=utf-8", "application/json; charset=utf-8" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -737,7 +1466,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -822,7 +1550,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -908,7 +1635,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/PetApi.cs index c7cad2ff05e..aee02b4ceb3 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/PetApi.cs @@ -534,7 +534,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -570,7 +570,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -617,7 +616,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -653,7 +652,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -699,7 +697,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -729,7 +727,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -776,7 +773,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -806,7 +803,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -851,7 +847,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -883,7 +879,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - } /// @@ -926,7 +921,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -958,7 +953,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - } /// @@ -1000,7 +994,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1032,7 +1026,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - } /// @@ -1075,7 +1068,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1107,7 +1100,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - } /// @@ -1149,7 +1141,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1181,7 +1173,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (Pet) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pet))); - } /// @@ -1224,7 +1215,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1255,7 +1246,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (Pet) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pet))); - } /// @@ -1298,7 +1288,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1334,7 +1324,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -1381,7 +1370,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1417,7 +1406,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -1466,7 +1454,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1497,7 +1485,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -1547,7 +1534,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1578,7 +1565,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -1661,7 +1647,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (ApiResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); - } /// @@ -1742,7 +1727,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (ApiResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); - } } diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/StoreApi.cs index 1b6bb7577d8..a7d3bd9de52 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/StoreApi.cs @@ -340,7 +340,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -363,7 +363,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -408,7 +407,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -431,7 +430,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -501,7 +499,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (Dictionary) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); - } /// @@ -568,7 +565,6 @@ namespace IO.Swagger.Api return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (Dictionary) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); - } /// @@ -610,7 +606,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -636,7 +632,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); - } /// @@ -679,7 +674,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -705,7 +700,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); - } /// @@ -747,7 +741,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -780,7 +774,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); - } /// @@ -823,7 +816,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -856,7 +849,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); - } } diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/UserApi.cs b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/UserApi.cs index a7913683eda..1e3a6d70239 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/UserApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/UserApi.cs @@ -516,7 +516,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -546,7 +546,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -591,7 +590,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -621,7 +620,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -665,7 +663,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -695,7 +693,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -740,7 +737,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -770,7 +767,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -814,7 +810,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -844,7 +840,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -889,7 +884,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -919,7 +914,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -963,7 +957,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -986,7 +980,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -1031,7 +1024,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1054,7 +1047,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -1099,7 +1091,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1125,7 +1117,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (User) Configuration.ApiClient.Deserialize(localVarResponse, typeof(User))); - } /// @@ -1168,7 +1159,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1194,7 +1185,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (User) Configuration.ApiClient.Deserialize(localVarResponse, typeof(User))); - } /// @@ -1241,7 +1231,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1268,7 +1258,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); - } /// @@ -1316,7 +1305,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1343,7 +1332,6 @@ namespace IO.Swagger.Api return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); - } /// @@ -1379,7 +1367,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1401,7 +1389,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -1441,7 +1428,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1463,7 +1450,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -1512,7 +1498,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1543,7 +1529,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); @@ -1593,7 +1578,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/xml", + "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); @@ -1624,7 +1609,6 @@ namespace IO.Swagger.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ApiClient.cs b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ApiClient.cs index 94356fb227f..ef2952a6f70 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Client/ApiClient.cs @@ -115,6 +115,8 @@ namespace IO.Swagger.Client String contentType) { var request = new RestRequest(path, method); + // disable ResetSharp.Portable built-in serialization + request.Serializer = null; // add path parameter, if any foreach(var param in pathParams) @@ -142,11 +144,11 @@ namespace IO.Swagger.Client { if (postBody.GetType() == typeof(String)) { - request.AddParameter("application/json", postBody, ParameterType.RequestBody); + request.AddParameter(new Parameter { Value = postBody, Type = ParameterType.RequestBody, ContentType = "application/json" }); } else if (postBody.GetType() == typeof(byte[])) { - request.AddParameter(contentType, postBody, ParameterType.RequestBody); + request.AddParameter(new Parameter { Value = postBody, Type = ParameterType.RequestBody, ContentType = contentType }); } } diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/IO.Swagger.csproj b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/IO.Swagger.csproj index 883931b3494..cdef810205d 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/IO.Swagger.csproj @@ -1,27 +1,27 @@ - - - - netstandard1.3 - IO.Swagger - IO.Swagger - Library - Swagger - Swagger - Swagger Library - A library generated from a Swagger doc - No Copyright - true - true - true - IO.Swagger - 1.0.0 - - - - - - - - - + + + + netstandard1.3 + IO.Swagger + IO.Swagger + Library + Swagger + Swagger + Swagger Library + A library generated from a Swagger doc + No Copyright + true + true + true + IO.Swagger + 1.0.0 + + + + + + + + + \ No newline at end of file diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/IO.Swagger.csproj b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/IO.Swagger.csproj index bfbb352b574..528dccbf15c 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/IO.Swagger.csproj @@ -43,10 +43,8 @@ Contact: apiteam@swagger.io - - - - + diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md index c82e8fb71fb..d2f2aa2168e 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md @@ -69,17 +69,16 @@ namespace Example { var apiInstance = new FakeApi(); - var body = new ModelClient(); // ModelClient | client model + var body = new OuterBoolean(); // OuterBoolean | Input boolean as post body (optional) try { - // To test \"client\" model - ModelClient result = apiInstance.TestClientModel(body); + OuterBoolean result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } catch (Exception e) { - Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); } } } @@ -93,6 +92,10 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | *FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters @@ -148,7 +151,11 @@ Class | Method | HTTP request | Description - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) - [Model.Order](docs/Order.md) + - [Model.OuterBoolean](docs/OuterBoolean.md) + - [Model.OuterComposite](docs/OuterComposite.md) - [Model.OuterEnum](docs/OuterEnum.md) + - [Model.OuterNumber](docs/OuterNumber.md) + - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Model.SpecialModelName](docs/SpecialModelName.md) diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/FakeApi.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/FakeApi.md index 82a3463dacb..1277461eb1d 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/FakeApi.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/FakeApi.md @@ -4,11 +4,259 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +[**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +[**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +[**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | [**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model [**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters + +# **FakeOuterBooleanSerialize** +> OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) + + + +Test serialization of outer boolean types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterBooleanSerializeExample + { + public void main() + { + + var apiInstance = new FakeApi(); + var body = new OuterBoolean(); // OuterBoolean | Input boolean as post body (optional) + + try + { + OuterBoolean result = apiInstance.FakeOuterBooleanSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + +### Return type + +[**OuterBoolean**](OuterBoolean.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterCompositeSerialize** +> OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + + + +Test serialization of object with outer number type + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterCompositeSerializeExample + { + public void main() + { + + var apiInstance = new FakeApi(); + var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + + try + { + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterNumberSerialize** +> OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) + + + +Test serialization of outer number types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterNumberSerializeExample + { + public void main() + { + + var apiInstance = new FakeApi(); + var body = new OuterNumber(); // OuterNumber | Input number as post body (optional) + + try + { + OuterNumber result = apiInstance.FakeOuterNumberSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + +### Return type + +[**OuterNumber**](OuterNumber.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **FakeOuterStringSerialize** +> OuterString FakeOuterStringSerialize (OuterString body = null) + + + +Test serialization of outer string types + +### Example +```csharp +using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class FakeOuterStringSerializeExample + { + public void main() + { + + var apiInstance = new FakeApi(); + var body = new OuterString(); // OuterString | Input string as post body (optional) + + try + { + OuterString result = apiInstance.FakeOuterStringSerialize(body); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + +### Return type + +[**OuterString**](OuterString.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **TestClientModel** > ModelClient TestClientModel (ModelClient body) diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterBoolean.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterBoolean.md new file mode 100644 index 00000000000..84845b35e54 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterBoolean.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.OuterBoolean +## 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/csharp/SwaggerClientWithPropertyChanged/docs/OuterComposite.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterComposite.md new file mode 100644 index 00000000000..41fae66f136 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterComposite.md @@ -0,0 +1,11 @@ +# IO.Swagger.Model.OuterComposite +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyNumber** | [**OuterNumber**](OuterNumber.md) | | [optional] +**MyString** | [**OuterString**](OuterString.md) | | [optional] +**MyBoolean** | [**OuterBoolean**](OuterBoolean.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/csharp/SwaggerClientWithPropertyChanged/docs/OuterNumber.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterNumber.md new file mode 100644 index 00000000000..7c88274d6ee --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterNumber.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.OuterNumber +## 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/csharp/SwaggerClientWithPropertyChanged/docs/OuterString.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterString.md new file mode 100644 index 00000000000..524423a5dab --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterString.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.OuterString +## 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/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterBooleanTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterBooleanTests.cs new file mode 100644 index 00000000000..a24e20009cc --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterBooleanTests.cs @@ -0,0 +1,70 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing OuterBoolean + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class OuterBooleanTests + { + // TODO uncomment below to declare an instance variable for OuterBoolean + //private OuterBoolean instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of OuterBoolean + //instance = new OuterBoolean(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of OuterBoolean + /// + [Test] + public void OuterBooleanInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" OuterBoolean + //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterBoolean"); + } + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterCompositeTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterCompositeTests.cs new file mode 100644 index 00000000000..3d2ab500d1a --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterCompositeTests.cs @@ -0,0 +1,94 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing OuterComposite + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class OuterCompositeTests + { + // TODO uncomment below to declare an instance variable for OuterComposite + //private OuterComposite instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of OuterComposite + //instance = new OuterComposite(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of OuterComposite + /// + [Test] + public void OuterCompositeInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" OuterComposite + //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterComposite"); + } + + /// + /// Test the property 'MyNumber' + /// + [Test] + public void MyNumberTest() + { + // TODO unit test for the property 'MyNumber' + } + /// + /// Test the property 'MyString' + /// + [Test] + public void MyStringTest() + { + // TODO unit test for the property 'MyString' + } + /// + /// Test the property 'MyBoolean' + /// + [Test] + public void MyBooleanTest() + { + // TODO unit test for the property 'MyBoolean' + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterNumberTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterNumberTests.cs new file mode 100644 index 00000000000..66a97a03e7b --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterNumberTests.cs @@ -0,0 +1,70 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing OuterNumber + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class OuterNumberTests + { + // TODO uncomment below to declare an instance variable for OuterNumber + //private OuterNumber instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of OuterNumber + //instance = new OuterNumber(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of OuterNumber + /// + [Test] + public void OuterNumberInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" OuterNumber + //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterNumber"); + } + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterStringTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterStringTests.cs new file mode 100644 index 00000000000..f6397957ece --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterStringTests.cs @@ -0,0 +1,70 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing OuterString + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class OuterStringTests + { + // TODO uncomment below to declare an instance variable for OuterString + //private OuterString instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of OuterString + //instance = new OuterString(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of OuterString + /// + [Test] + public void OuterStringInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" OuterString + //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterString"); + } + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs index 03a6ebb97ad..c39d65ed235 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs @@ -25,6 +25,90 @@ namespace IO.Swagger.Api { #region Synchronous Operations /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// OuterBoolean + OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// ApiResponse of OuterBoolean + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null); + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// OuterComposite + OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// ApiResponse of OuterComposite + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null); + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// OuterNumber + OuterNumber FakeOuterNumberSerialize (OuterNumber body = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// ApiResponse of OuterNumber + ApiResponse FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null); + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// OuterString + OuterString FakeOuterStringSerialize (OuterString body = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// ApiResponse of OuterString + ApiResponse FakeOuterStringSerializeWithHttpInfo (OuterString body = null); + /// /// To test \"client\" model /// /// @@ -130,6 +214,90 @@ namespace IO.Swagger.Api #endregion Synchronous Operations #region Asynchronous Operations /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of OuterBoolean + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null); + + /// + /// + /// + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of ApiResponse (OuterBoolean) + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null); + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of OuterComposite + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null); + + /// + /// + /// + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of ApiResponse (OuterComposite) + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null); + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of OuterNumber + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null); + + /// + /// + /// + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of ApiResponse (OuterNumber) + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null); + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of OuterString + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null); + + /// + /// + /// + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of ApiResponse (OuterString) + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null); + /// /// To test \"client\" model /// /// @@ -344,6 +512,570 @@ namespace IO.Swagger.Api this.Configuration.AddDefaultHeader(key, value); } + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// OuterBoolean + public OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) + { + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// ApiResponse of OuterBoolean + public ApiResponse< OuterBoolean > FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null) + { + + var localVarPath = "/fake/outer/boolean"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (OuterBoolean) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterBoolean))); + + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of OuterBoolean + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null) + { + ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer boolean types + /// + /// Thrown when fails to make API call + /// Input boolean as post body (optional) + /// Task of ApiResponse (OuterBoolean) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null) + { + + var localVarPath = "/fake/outer/boolean"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterBooleanSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (OuterBoolean) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterBoolean))); + + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// OuterComposite + public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + { + ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// ApiResponse of OuterComposite + public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null) + { + + var localVarPath = "/fake/outer/composite"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (OuterComposite) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterComposite))); + + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of OuterComposite + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null) + { + ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of object with outer number type + /// + /// Thrown when fails to make API call + /// Input composite as post body (optional) + /// Task of ApiResponse (OuterComposite) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null) + { + + var localVarPath = "/fake/outer/composite"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterCompositeSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (OuterComposite) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterComposite))); + + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// OuterNumber + public OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) + { + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// ApiResponse of OuterNumber + public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null) + { + + var localVarPath = "/fake/outer/number"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (OuterNumber) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterNumber))); + + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of OuterNumber + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null) + { + ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer number types + /// + /// Thrown when fails to make API call + /// Input number as post body (optional) + /// Task of ApiResponse (OuterNumber) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null) + { + + var localVarPath = "/fake/outer/number"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterNumberSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (OuterNumber) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterNumber))); + + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// OuterString + public OuterString FakeOuterStringSerialize (OuterString body = null) + { + ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + return localVarResponse.Data; + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// ApiResponse of OuterString + public ApiResponse< OuterString > FakeOuterStringSerializeWithHttpInfo (OuterString body = null) + { + + var localVarPath = "/fake/outer/string"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterStringSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (OuterString) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterString))); + + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of OuterString + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null) + { + ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); + return localVarResponse.Data; + + } + + /// + /// Test serialization of outer string types + /// + /// Thrown when fails to make API call + /// Input string as post body (optional) + /// Task of ApiResponse (OuterString) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null) + { + + var localVarPath = "/fake/outer/string"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new Dictionary(); + var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("FakeOuterStringSerialize", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (OuterString) Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterString))); + + } + /// /// To test \"client\" model To test \"client\" model /// diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterBoolean.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterBoolean.cs new file mode 100644 index 00000000000..2081641d2f8 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterBoolean.cs @@ -0,0 +1,135 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using PropertyChanged; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; + +namespace IO.Swagger.Model +{ + /// + /// OuterBoolean + /// + [DataContract] + [ImplementPropertyChanged] + public partial class OuterBoolean : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public OuterBoolean() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterBoolean {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as OuterBoolean); + } + + /// + /// Returns true if OuterBoolean instances are equal + /// + /// Instance of OuterBoolean to be compared + /// Boolean + public bool Equals(OuterBoolean other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + return hash; + } + } + + /// + /// Property changed event handler + /// + public event PropertyChangedEventHandler PropertyChanged; + + /// + /// Trigger when a property changed + /// + /// Property Name + public virtual void OnPropertyChanged(string propertyName) + { + // NOTE: property changed is handled via "code weaving" using Fody. + // Properties with setters are modified at compile time to notify of changes. + var propertyChanged = PropertyChanged; + if (propertyChanged != null) + { + propertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterComposite.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterComposite.cs new file mode 100644 index 00000000000..14f8b9d756c --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterComposite.cs @@ -0,0 +1,179 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using PropertyChanged; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; + +namespace IO.Swagger.Model +{ + /// + /// OuterComposite + /// + [DataContract] + [ImplementPropertyChanged] + public partial class OuterComposite : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// MyNumber. + /// MyString. + /// MyBoolean. + public OuterComposite(OuterNumber MyNumber = default(OuterNumber), OuterString MyString = default(OuterString), OuterBoolean MyBoolean = default(OuterBoolean)) + { + this.MyNumber = MyNumber; + this.MyString = MyString; + this.MyBoolean = MyBoolean; + } + + /// + /// Gets or Sets MyNumber + /// + [DataMember(Name="my_number", EmitDefaultValue=false)] + public OuterNumber MyNumber { get; set; } + /// + /// Gets or Sets MyString + /// + [DataMember(Name="my_string", EmitDefaultValue=false)] + public OuterString MyString { get; set; } + /// + /// Gets or Sets MyBoolean + /// + [DataMember(Name="my_boolean", EmitDefaultValue=false)] + public OuterBoolean MyBoolean { get; set; } + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterComposite {\n"); + sb.Append(" MyNumber: ").Append(MyNumber).Append("\n"); + sb.Append(" MyString: ").Append(MyString).Append("\n"); + sb.Append(" MyBoolean: ").Append(MyBoolean).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as OuterComposite); + } + + /// + /// Returns true if OuterComposite instances are equal + /// + /// Instance of OuterComposite to be compared + /// Boolean + public bool Equals(OuterComposite other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return + ( + this.MyNumber == other.MyNumber || + this.MyNumber != null && + this.MyNumber.Equals(other.MyNumber) + ) && + ( + this.MyString == other.MyString || + this.MyString != null && + this.MyString.Equals(other.MyString) + ) && + ( + this.MyBoolean == other.MyBoolean || + this.MyBoolean != null && + this.MyBoolean.Equals(other.MyBoolean) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.MyNumber != null) + hash = hash * 59 + this.MyNumber.GetHashCode(); + if (this.MyString != null) + hash = hash * 59 + this.MyString.GetHashCode(); + if (this.MyBoolean != null) + hash = hash * 59 + this.MyBoolean.GetHashCode(); + return hash; + } + } + + /// + /// Property changed event handler + /// + public event PropertyChangedEventHandler PropertyChanged; + + /// + /// Trigger when a property changed + /// + /// Property Name + public virtual void OnPropertyChanged(string propertyName) + { + // NOTE: property changed is handled via "code weaving" using Fody. + // Properties with setters are modified at compile time to notify of changes. + var propertyChanged = PropertyChanged; + if (propertyChanged != null) + { + propertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterNumber.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterNumber.cs new file mode 100644 index 00000000000..1cfdf28555a --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterNumber.cs @@ -0,0 +1,135 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using PropertyChanged; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; + +namespace IO.Swagger.Model +{ + /// + /// OuterNumber + /// + [DataContract] + [ImplementPropertyChanged] + public partial class OuterNumber : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public OuterNumber() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterNumber {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as OuterNumber); + } + + /// + /// Returns true if OuterNumber instances are equal + /// + /// Instance of OuterNumber to be compared + /// Boolean + public bool Equals(OuterNumber other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + return hash; + } + } + + /// + /// Property changed event handler + /// + public event PropertyChangedEventHandler PropertyChanged; + + /// + /// Trigger when a property changed + /// + /// Property Name + public virtual void OnPropertyChanged(string propertyName) + { + // NOTE: property changed is handled via "code weaving" using Fody. + // Properties with setters are modified at compile time to notify of changes. + var propertyChanged = PropertyChanged; + if (propertyChanged != null) + { + propertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterString.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterString.cs new file mode 100644 index 00000000000..9ee02e48db8 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterString.cs @@ -0,0 +1,135 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using PropertyChanged; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; + +namespace IO.Swagger.Model +{ + /// + /// OuterString + /// + [DataContract] + [ImplementPropertyChanged] + public partial class OuterString : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + public OuterString() + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OuterString {\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as OuterString); + } + + /// + /// Returns true if OuterString instances are equal + /// + /// Instance of OuterString to be compared + /// Boolean + public bool Equals(OuterString other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return false; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + return hash; + } + } + + /// + /// Property changed event handler + /// + public event PropertyChangedEventHandler PropertyChanged; + + /// + /// Trigger when a property changed + /// + /// Property Name + public virtual void OnPropertyChanged(string propertyName) + { + // NOTE: property changed is handled via "code weaving" using Fody. + // Properties with setters are modified at compile time to notify of changes. + var propertyChanged = PropertyChanged; + if (propertyChanged != null) + { + propertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex index 9698a6dd416..9537680a4a5 100644 --- a/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/swagger_petstore/api/fake.ex @@ -8,6 +8,82 @@ defmodule SwaggerPetstore.Api.Fake do plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2" plug Tesla.Middleware.JSON + @doc """ + + + Test serialization of outer boolean types + """ + def fake_outer_boolean_serialize(body) do + method = [method: :post] + url = [url: "/fake/outer/boolean"] + query_params = [] + header_params = [] + body_params = [body: body] + form_params = [] + params = query_params ++ header_params ++ body_params ++ form_params + opts = [] + options = method ++ url ++ params ++ opts + + request(options) + end + + @doc """ + + + Test serialization of object with outer number type + """ + def fake_outer_composite_serialize(body) do + method = [method: :post] + url = [url: "/fake/outer/composite"] + query_params = [] + header_params = [] + body_params = [body: body] + form_params = [] + params = query_params ++ header_params ++ body_params ++ form_params + opts = [] + options = method ++ url ++ params ++ opts + + request(options) + end + + @doc """ + + + Test serialization of outer number types + """ + def fake_outer_number_serialize(body) do + method = [method: :post] + url = [url: "/fake/outer/number"] + query_params = [] + header_params = [] + body_params = [body: body] + form_params = [] + params = query_params ++ header_params ++ body_params ++ form_params + opts = [] + options = method ++ url ++ params ++ opts + + request(options) + end + + @doc """ + + + Test serialization of outer string types + """ + def fake_outer_string_serialize(body) do + method = [method: :post] + url = [url: "/fake/outer/string"] + query_params = [] + header_params = [] + body_params = [body: body] + form_params = [] + params = query_params ++ header_params ++ body_params ++ form_params + opts = [] + options = method ++ url ++ params ++ opts + + request(options) + end + @doc """ To test \"client\" model diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outerBoolean.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outerBoolean.ex new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outerComposite.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outerComposite.ex new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outerNumber.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outerNumber.ex new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/elixir/lib/swagger_petstore/model/outerString.ex b/samples/client/petstore/elixir/lib/swagger_petstore/model/outerString.ex new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index 6e77c9ba9e3..cf7b296d524 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -21,6 +21,10 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **Post** /fake/outer/boolean | +*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **Post** /fake/outer/composite | +*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **Post** /fake/outer/number | +*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **Post** /fake/outer/string | *FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **Patch** /fake | To test \"client\" model *FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **Get** /fake | To test enum parameters @@ -75,7 +79,11 @@ Class | Method | HTTP request | Description - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) + - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SpecialModelName](docs/SpecialModelName.md) diff --git a/samples/client/petstore/go/go-petstore/docs/FakeApi.md b/samples/client/petstore/go/go-petstore/docs/FakeApi.md index f7167e26e61..4cbafae7133 100644 --- a/samples/client/petstore/go/go-petstore/docs/FakeApi.md +++ b/samples/client/petstore/go/go-petstore/docs/FakeApi.md @@ -4,11 +4,151 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**FakeOuterBooleanSerialize**](FakeApi.md#FakeOuterBooleanSerialize) | **Post** /fake/outer/boolean | +[**FakeOuterCompositeSerialize**](FakeApi.md#FakeOuterCompositeSerialize) | **Post** /fake/outer/composite | +[**FakeOuterNumberSerialize**](FakeApi.md#FakeOuterNumberSerialize) | **Post** /fake/outer/number | +[**FakeOuterStringSerialize**](FakeApi.md#FakeOuterStringSerialize) | **Post** /fake/outer/string | [**TestClientModel**](FakeApi.md#TestClientModel) | **Patch** /fake | To test \"client\" model [**TestEndpointParameters**](FakeApi.md#TestEndpointParameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**TestEnumParameters**](FakeApi.md#TestEnumParameters) | **Get** /fake | To test enum parameters +# **FakeOuterBooleanSerialize** +> OuterBoolean FakeOuterBooleanSerialize(optional) + + +Test serialization of outer boolean types + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | + +### Return type + +[**OuterBoolean**](OuterBoolean.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **FakeOuterCompositeSerialize** +> OuterComposite FakeOuterCompositeSerialize(optional) + + +Test serialization of object with outer number type + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **FakeOuterNumberSerialize** +> OuterNumber FakeOuterNumberSerialize(optional) + + +Test serialization of outer number types + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | + +### Return type + +[**OuterNumber**](OuterNumber.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **FakeOuterStringSerialize** +> OuterString FakeOuterStringSerialize(optional) + + +Test serialization of outer string types + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterString**](OuterString.md)| Input string as post body | + +### Return type + +[**OuterString**](OuterString.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **TestClientModel** > Client TestClientModel(body) To test \"client\" model diff --git a/samples/client/petstore/go/go-petstore/docs/OuterBoolean.md b/samples/client/petstore/go/go-petstore/docs/OuterBoolean.md new file mode 100644 index 00000000000..8b243399474 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/docs/OuterBoolean.md @@ -0,0 +1,9 @@ +# OuterBoolean + +## 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/docs/OuterComposite.md b/samples/client/petstore/go/go-petstore/docs/OuterComposite.md new file mode 100644 index 00000000000..7b099510362 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/docs/OuterComposite.md @@ -0,0 +1,12 @@ +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyNumber** | [***OuterNumber**](OuterNumber.md) | | [optional] [default to null] +**MyString** | [***OuterString**](OuterString.md) | | [optional] [default to null] +**MyBoolean** | [***OuterBoolean**](OuterBoolean.md) | | [optional] [default to null] + +[[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/OuterNumber.md b/samples/client/petstore/go/go-petstore/docs/OuterNumber.md new file mode 100644 index 00000000000..8aa37f329bd --- /dev/null +++ b/samples/client/petstore/go/go-petstore/docs/OuterNumber.md @@ -0,0 +1,9 @@ +# OuterNumber + +## 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/docs/OuterString.md b/samples/client/petstore/go/go-petstore/docs/OuterString.md new file mode 100644 index 00000000000..9ccaadaf98d --- /dev/null +++ b/samples/client/petstore/go/go-petstore/docs/OuterString.md @@ -0,0 +1,9 @@ +# OuterString + +## 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/fake_api.go b/samples/client/petstore/go/go-petstore/fake_api.go index e8e19318eb2..25daa9ce92f 100644 --- a/samples/client/petstore/go/go-petstore/fake_api.go +++ b/samples/client/petstore/go/go-petstore/fake_api.go @@ -27,6 +27,274 @@ var ( type FakeApiService service +/* FakeApiService + Test serialization of outer boolean types + + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (OuterBoolean) Input boolean as post body + @return OuterBoolean*/ +func (a *FakeApiService) FakeOuterBooleanSerialize(localVarOptionals map[string]interface{}) (OuterBoolean, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload OuterBoolean + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/outer/boolean" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(OuterBoolean); localVarOk { + localVarPostBody = &localVarTempParam + } + r, err := a.client.prepareRequest(nil, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* FakeApiService + Test serialization of object with outer number type + + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (OuterComposite) Input composite as post body + @return OuterComposite*/ +func (a *FakeApiService) FakeOuterCompositeSerialize(localVarOptionals map[string]interface{}) (OuterComposite, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload OuterComposite + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/outer/composite" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(OuterComposite); localVarOk { + localVarPostBody = &localVarTempParam + } + r, err := a.client.prepareRequest(nil, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* FakeApiService + Test serialization of outer number types + + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (OuterNumber) Input number as post body + @return OuterNumber*/ +func (a *FakeApiService) FakeOuterNumberSerialize(localVarOptionals map[string]interface{}) (OuterNumber, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload OuterNumber + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/outer/number" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(OuterNumber); localVarOk { + localVarPostBody = &localVarTempParam + } + r, err := a.client.prepareRequest(nil, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* FakeApiService + Test serialization of outer string types + + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (OuterString) Input string as post body + @return OuterString*/ +func (a *FakeApiService) FakeOuterStringSerialize(localVarOptionals map[string]interface{}) (OuterString, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload OuterString + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/outer/string" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(OuterString); localVarOk { + localVarPostBody = &localVarTempParam + } + r, err := a.client.prepareRequest(nil, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + return successPayload, localVarHttpResponse, reportError(localVarHttpResponse.Status) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + /* FakeApiService To test \"client\" model To test \"client\" model diff --git a/samples/client/petstore/go/go-petstore/outer_boolean.go b/samples/client/petstore/go/go-petstore/outer_boolean.go new file mode 100644 index 00000000000..bdd8378715a --- /dev/null +++ b/samples/client/petstore/go/go-petstore/outer_boolean.go @@ -0,0 +1,14 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +package petstore + +type OuterBoolean struct { +} diff --git a/samples/client/petstore/go/go-petstore/outer_composite.go b/samples/client/petstore/go/go-petstore/outer_composite.go new file mode 100644 index 00000000000..9e4ae6a131c --- /dev/null +++ b/samples/client/petstore/go/go-petstore/outer_composite.go @@ -0,0 +1,20 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +package petstore + +type OuterComposite struct { + + MyNumber *OuterNumber `json:"my_number,omitempty"` + + MyString *OuterString `json:"my_string,omitempty"` + + MyBoolean *OuterBoolean `json:"my_boolean,omitempty"` +} diff --git a/samples/client/petstore/go/go-petstore/outer_number.go b/samples/client/petstore/go/go-petstore/outer_number.go new file mode 100644 index 00000000000..c83626abd2a --- /dev/null +++ b/samples/client/petstore/go/go-petstore/outer_number.go @@ -0,0 +1,14 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +package petstore + +type OuterNumber struct { +} diff --git a/samples/client/petstore/go/go-petstore/outer_string.go b/samples/client/petstore/go/go-petstore/outer_string.go new file mode 100644 index 00000000000..f1f4cf9fbe0 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/outer_string.go @@ -0,0 +1,14 @@ +/* + * 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 + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +package petstore + +type OuterString struct { +} diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java index a9861e18c5c..9c646d6e8f0 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java @@ -133,6 +133,7 @@ public class ApiClient { objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + objectMapper.disable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE); objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); objectMapper.setDateFormat(new RFC3339DateFormat()); ThreeTenModule module = new ThreeTenModule(); diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java index 04b4b05e6bc..1bda8ac4de9 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java @@ -7,6 +7,7 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; import java.util.ArrayList; import java.util.HashMap; @@ -18,6 +19,58 @@ import feign.*; public interface FakeApi extends ApiClient.Api { + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Boolean + */ + @RequestLine("POST /fake/outer/boolean") + @Headers({ + "Content-Type: application/json", + "Accept: application/json", + }) + Boolean fakeOuterBooleanSerialize(Boolean body); + + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return OuterComposite + */ + @RequestLine("POST /fake/outer/composite") + @Headers({ + "Content-Type: application/json", + "Accept: application/json", + }) + OuterComposite fakeOuterCompositeSerialize(OuterComposite body); + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return BigDecimal + */ + @RequestLine("POST /fake/outer/number") + @Headers({ + "Content-Type: application/json", + "Accept: application/json", + }) + BigDecimal fakeOuterNumberSerialize(BigDecimal body); + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return String + */ + @RequestLine("POST /fake/outer/string") + @Headers({ + "Content-Type: application/json", + "Accept: application/json", + }) + String fakeOuterStringSerialize(String body); + /** * To test \"client\" model * To test \"client\" model diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterComposite.java new file mode 100644 index 00000000000..7b1786ea96d --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterComposite.java @@ -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. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; + +/** + * OuterComposite + */ + +public class OuterComposite { + @JsonProperty("my_number") + private BigDecimal myNumber = null; + + @JsonProperty("my_string") + private String myString = null; + + @JsonProperty("my_boolean") + private Boolean myBoolean = null; + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @ApiModelProperty(value = "") + public String getMyString() { + return myString; + } + + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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/feign/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/FakeApiTest.java index 0717e435bcd..bc6cb13b3b2 100644 --- a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -1,10 +1,11 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; -import io.swagger.client.model.Client; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.LocalDate; import java.math.BigDecimal; +import io.swagger.client.model.Client; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; import org.junit.Before; import org.junit.Test; @@ -26,10 +27,66 @@ public class FakeApiTest { } + /** + * + * + * Test serialization of outer boolean types + */ + @Test + public void fakeOuterBooleanSerializeTest() { + Boolean body = null; + // Boolean response = api.fakeOuterBooleanSerialize(body); + + // TODO: test validations + } + + + /** + * + * + * Test serialization of object with outer number type + */ + @Test + public void fakeOuterCompositeSerializeTest() { + OuterComposite body = null; + // OuterComposite response = api.fakeOuterCompositeSerialize(body); + + // TODO: test validations + } + + + /** + * + * + * Test serialization of outer number types + */ + @Test + public void fakeOuterNumberSerializeTest() { + BigDecimal body = null; + // BigDecimal response = api.fakeOuterNumberSerialize(body); + + // TODO: test validations + } + + + /** + * + * + * Test serialization of outer string types + */ + @Test + public void fakeOuterStringSerializeTest() { + String body = null; + // String response = api.fakeOuterStringSerialize(body); + + // TODO: test validations + } + + /** * To test \"client\" model * - * + * To test \"client\" model */ @Test public void testClientModelTest() { @@ -38,6 +95,7 @@ public class FakeApiTest { // TODO: test validations } + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -64,11 +122,12 @@ public class FakeApiTest { // TODO: test validations } + /** * To test enum parameters * - * + * To test enum parameters */ @Test public void testEnumParametersTest() { @@ -78,11 +137,35 @@ public class FakeApiTest { String enumHeaderString = null; List enumQueryStringArray = null; String enumQueryString = null; - BigDecimal enumQueryInteger = null; + Integer enumQueryInteger = null; Double enumQueryDouble = null; // api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); // TODO: test validations } + + /** + * To test enum parameters + * + * To test enum parameters + * + * This tests the overload of the method that uses a Map for query parameters instead of + * listing them out individually. + */ + @Test + public void testEnumParametersTestQueryMap() { + List enumFormStringArray = null; + String enumFormString = null; + List enumHeaderStringArray = null; + String enumHeaderString = null; + Double enumQueryDouble = null; + FakeApi.TestEnumParametersQueryParams queryParams = new FakeApi.TestEnumParametersQueryParams() + .enumQueryStringArray(null) + .enumQueryString(null) + .enumQueryInteger(null); + // api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryDouble, queryParams); + + // TODO: test validations + } } diff --git a/samples/client/petstore/java/jersey1/docs/FakeApi.md b/samples/client/petstore/java/jersey1/docs/FakeApi.md index 01dcb19a054..87e4b69c8e2 100644 --- a/samples/client/petstore/java/jersey1/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey1/docs/FakeApi.md @@ -4,11 +4,195 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters + +# **fakeOuterBooleanSerialize** +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +Boolean body = true; // Boolean | Input boolean as post body +try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(body) + + + +Test serialization of object with outer number type + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterNumberSerialize** +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body +try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String body = "body_example"; // String | Input string as post body +try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**String**](String.md)| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + # **testClientModel** > Client testClientModel(body) diff --git a/samples/client/petstore/java/jersey1/docs/OuterComposite.md b/samples/client/petstore/java/jersey1/docs/OuterComposite.md new file mode 100644 index 00000000000..3f5a633c998 --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java index 43bafe38099..39ec9eb647e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java @@ -76,6 +76,7 @@ public class ApiClient { objectMapper = new ObjectMapper(); objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + objectMapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java index 823149a5345..6a2f0c267fb 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java @@ -24,6 +24,7 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; import java.util.ArrayList; @@ -51,6 +52,150 @@ public class FakeApi { this.apiClient = apiClient; } + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/boolean"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return OuterComposite + * @throws ApiException if fails to make API call + */ + public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/composite"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return BigDecimal + * @throws ApiException if fails to make API call + */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/number"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return String + * @throws ApiException if fails to make API call + */ + public String fakeOuterStringSerialize(String body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/string"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } /** * To test \"client\" model * To test \"client\" model diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterComposite.java new file mode 100644 index 00000000000..7b1786ea96d --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterComposite.java @@ -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. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; + +/** + * OuterComposite + */ + +public class OuterComposite { + @JsonProperty("my_number") + private BigDecimal myNumber = null; + + @JsonProperty("my_string") + private String myString = null; + + @JsonProperty("my_boolean") + private Boolean myBoolean = null; + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @ApiModelProperty(value = "") + public String getMyString() { + return myString; + } + + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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/FakeApi.md b/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md index 01dcb19a054..87e4b69c8e2 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md @@ -4,11 +4,195 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters + +# **fakeOuterBooleanSerialize** +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +Boolean body = true; // Boolean | Input boolean as post body +try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(body) + + + +Test serialization of object with outer number type + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterNumberSerialize** +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body +try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String body = "body_example"; // String | Input string as post body +try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**String**](String.md)| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + # **testClientModel** > Client testClientModel(body) diff --git a/samples/client/petstore/java/jersey2-java6/docs/OuterComposite.md b/samples/client/petstore/java/jersey2-java6/docs/OuterComposite.md new file mode 100644 index 00000000000..3f5a633c998 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/JSON.java index 4ade3277cc0..433f1a313e1 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/JSON.java @@ -17,6 +17,7 @@ public class JSON implements ContextResolver { mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java index 208886d5bed..b741b6179d8 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java @@ -11,6 +11,7 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; import java.util.ArrayList; import java.util.HashMap; @@ -37,6 +38,150 @@ public class FakeApi { this.apiClient = apiClient; } + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/boolean"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return OuterComposite + * @throws ApiException if fails to make API call + */ + public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/composite"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return BigDecimal + * @throws ApiException if fails to make API call + */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/number"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return String + * @throws ApiException if fails to make API call + */ + public String fakeOuterStringSerialize(String body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/string"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } /** * To test \"client\" model * To test \"client\" model diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterComposite.java new file mode 100644 index 00000000000..0b80c71974a --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterComposite.java @@ -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. + */ + + +package io.swagger.client.model; + +import org.apache.commons.lang3.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; + +/** + * OuterComposite + */ + +public class OuterComposite { + @JsonProperty("my_number") + private BigDecimal myNumber = null; + + @JsonProperty("my_string") + private String myString = null; + + @JsonProperty("my_boolean") + private Boolean myBoolean = null; + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @ApiModelProperty(value = "") + public String getMyString() { + return myString; + } + + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return ObjectUtils.equals(this.myNumber, outerComposite.myNumber) && + ObjectUtils.equals(this.myString, outerComposite.myString) && + ObjectUtils.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return ObjectUtils.hashCodeMulti(myNumber, myString, myBoolean); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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/FakeApi.md b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md index 01dcb19a054..87e4b69c8e2 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -4,11 +4,195 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters + +# **fakeOuterBooleanSerialize** +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +Boolean body = true; // Boolean | Input boolean as post body +try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(body) + + + +Test serialization of object with outer number type + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterNumberSerialize** +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body +try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String body = "body_example"; // String | Input string as post body +try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**String**](String.md)| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + # **testClientModel** > Client testClientModel(body) diff --git a/samples/client/petstore/java/jersey2-java8/docs/OuterComposite.md b/samples/client/petstore/java/jersey2-java8/docs/OuterComposite.md new file mode 100644 index 00000000000..3f5a633c998 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/JSON.java index f768699c7f6..fa10243e548 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/JSON.java @@ -16,6 +16,7 @@ public class JSON implements ContextResolver { mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/FakeApi.java index 974daecfc97..0e76aa22374 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/FakeApi.java @@ -11,6 +11,7 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; import java.time.LocalDate; import java.time.OffsetDateTime; +import io.swagger.client.model.OuterComposite; import java.util.ArrayList; import java.util.HashMap; @@ -37,6 +38,150 @@ public class FakeApi { this.apiClient = apiClient; } + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/boolean"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return OuterComposite + * @throws ApiException if fails to make API call + */ + public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/composite"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return BigDecimal + * @throws ApiException if fails to make API call + */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/number"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return String + * @throws ApiException if fails to make API call + */ + public String fakeOuterStringSerialize(String body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/string"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } /** * To test \"client\" model * To test \"client\" model diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterComposite.java new file mode 100644 index 00000000000..7b1786ea96d --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterComposite.java @@ -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. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; + +/** + * OuterComposite + */ + +public class OuterComposite { + @JsonProperty("my_number") + private BigDecimal myNumber = null; + + @JsonProperty("my_string") + private String myString = null; + + @JsonProperty("my_boolean") + private Boolean myBoolean = null; + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @ApiModelProperty(value = "") + public String getMyString() { + return myString; + } + + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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/src/test/java/io/swagger/client/ConfigurationTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/ConfigurationTest.java index b95eb74605e..ccdf25feb30 100644 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/ConfigurationTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/ConfigurationTest.java @@ -9,7 +9,7 @@ public class ConfigurationTest { public void testDefaultApiClient() { ApiClient apiClient = Configuration.getDefaultApiClient(); assertNotNull(apiClient); - assertEquals("http://petstore.swagger.io/v2", apiClient.getBasePath()); + assertEquals("http://petstore.swagger.io:80/v2", apiClient.getBasePath()); assertFalse(apiClient.isDebugging()); } } diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/PetApiTest.java index 7f4d27c8b77..694e9c152b0 100644 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/PetApiTest.java @@ -36,7 +36,7 @@ public class PetApiTest { // the default api client is used assertEquals(Configuration.getDefaultApiClient(), api.getApiClient()); assertNotNull(api.getApiClient()); - assertEquals("http://petstore.swagger.io/v2", api.getApiClient().getBasePath()); + assertEquals("http://petstore.swagger.io:80/v2", api.getApiClient().getBasePath()); assertFalse(api.getApiClient().isDebugging()); ApiClient oldClient = api.getApiClient(); @@ -54,7 +54,7 @@ public class PetApiTest { // set api client via setter method api.setApiClient(oldClient); assertNotNull(api.getApiClient()); - assertEquals("http://petstore.swagger.io/v2", api.getApiClient().getBasePath()); + assertEquals("http://petstore.swagger.io:80/v2", api.getApiClient().getBasePath()); assertFalse(api.getApiClient().isDebugging()); } diff --git a/samples/client/petstore/java/jersey2/docs/FakeApi.md b/samples/client/petstore/java/jersey2/docs/FakeApi.md index 01dcb19a054..87e4b69c8e2 100644 --- a/samples/client/petstore/java/jersey2/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2/docs/FakeApi.md @@ -4,11 +4,195 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters + +# **fakeOuterBooleanSerialize** +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +Boolean body = true; // Boolean | Input boolean as post body +try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(body) + + + +Test serialization of object with outer number type + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterNumberSerialize** +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body +try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String body = "body_example"; // String | Input string as post body +try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**String**](String.md)| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + # **testClientModel** > Client testClientModel(body) diff --git a/samples/client/petstore/java/jersey2/docs/OuterComposite.md b/samples/client/petstore/java/jersey2/docs/OuterComposite.md new file mode 100644 index 00000000000..3f5a633c998 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/JSON.java index 4ade3277cc0..433f1a313e1 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/JSON.java @@ -17,6 +17,7 @@ public class JSON implements ContextResolver { mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeApi.java index 208886d5bed..b741b6179d8 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeApi.java @@ -11,6 +11,7 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; import java.util.ArrayList; import java.util.HashMap; @@ -37,6 +38,150 @@ public class FakeApi { this.apiClient = apiClient; } + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/boolean"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return OuterComposite + * @throws ApiException if fails to make API call + */ + public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/composite"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return BigDecimal + * @throws ApiException if fails to make API call + */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/number"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return String + * @throws ApiException if fails to make API call + */ + public String fakeOuterStringSerialize(String body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/string"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } /** * To test \"client\" model * To test \"client\" model diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterComposite.java new file mode 100644 index 00000000000..7b1786ea96d --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterComposite.java @@ -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. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; + +/** + * OuterComposite + */ + +public class OuterComposite { + @JsonProperty("my_number") + private BigDecimal myNumber = null; + + @JsonProperty("my_string") + private String myString = null; + + @JsonProperty("my_boolean") + private Boolean myBoolean = null; + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @ApiModelProperty(value = "") + public String getMyString() { + return myString; + } + + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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/FakeApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md index 01dcb19a054..87e4b69c8e2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md @@ -4,11 +4,195 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters + +# **fakeOuterBooleanSerialize** +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +Boolean body = true; // Boolean | Input boolean as post body +try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(body) + + + +Test serialization of object with outer number type + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterNumberSerialize** +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body +try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String body = "body_example"; // String | Input string as post body +try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**String**](String.md)| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + # **testClientModel** > Client testClientModel(body) diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterComposite.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterComposite.md new file mode 100644 index 00000000000..3f5a633c998 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java index 132462af980..553e0eeba0f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java @@ -890,6 +890,26 @@ public class ApiClient { * @throws ApiException If fail to serialize the request body object */ public Call buildCall(String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Request request = buildRequest(path, method, queryParams, body, headerParams, formParams, authNames, progressRequestListener); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param progressRequestListener Progress request listener + * @return The HTTP request + * @throws ApiException If fail to serialize the request body object + */ + public Request buildRequest(String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { updateParamsForAuth(authNames, queryParams, headerParams); final String url = buildUrl(path, queryParams); @@ -930,7 +950,7 @@ public class ApiClient { request = reqBuilder.method(method, reqBody).build(); } - return httpClient.newCall(request); + return request; } /** diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java index 29c010ba5b9..6f777bb701d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java @@ -31,6 +31,7 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; import java.lang.reflect.Type; import java.util.ArrayList; @@ -57,6 +58,486 @@ public class FakeApi { this.apiClient = apiClient; } + /** + * Build call for fakeOuterBooleanSerialize + * @param body Input boolean as post body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call fakeOuterBooleanSerializeCall(Boolean body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/boolean"; + + List localVarQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call fakeOuterBooleanSerializeValidateBeforeCall(Boolean body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + + com.squareup.okhttp.Call call = fakeOuterBooleanSerializeCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Boolean + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { + ApiResponse resp = fakeOuterBooleanSerializeWithHttpInfo(body); + return resp.getData(); + } + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return ApiResponse<Boolean> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { + com.squareup.okhttp.Call call = fakeOuterBooleanSerializeValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * (asynchronously) + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call fakeOuterBooleanSerializeAsync(Boolean body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = fakeOuterBooleanSerializeValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for fakeOuterCompositeSerialize + * @param body Input composite as post body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call fakeOuterCompositeSerializeCall(OuterComposite body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/composite"; + + List localVarQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return OuterComposite + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { + ApiResponse resp = fakeOuterCompositeSerializeWithHttpInfo(body); + return resp.getData(); + } + + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return ApiResponse<OuterComposite> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * (asynchronously) + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call fakeOuterCompositeSerializeAsync(OuterComposite body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for fakeOuterNumberSerialize + * @param body Input number as post body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call fakeOuterNumberSerializeCall(BigDecimal body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/number"; + + List localVarQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call fakeOuterNumberSerializeValidateBeforeCall(BigDecimal body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + + com.squareup.okhttp.Call call = fakeOuterNumberSerializeCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return BigDecimal + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { + ApiResponse resp = fakeOuterNumberSerializeWithHttpInfo(body); + return resp.getData(); + } + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return ApiResponse<BigDecimal> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { + com.squareup.okhttp.Call call = fakeOuterNumberSerializeValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * (asynchronously) + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call fakeOuterNumberSerializeAsync(BigDecimal body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = fakeOuterNumberSerializeValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for fakeOuterStringSerialize + * @param body Input string as post body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call fakeOuterStringSerializeCall(String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/string"; + + List localVarQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call fakeOuterStringSerializeValidateBeforeCall(String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + + com.squareup.okhttp.Call call = fakeOuterStringSerializeCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public String fakeOuterStringSerialize(String body) throws ApiException { + ApiResponse resp = fakeOuterStringSerializeWithHttpInfo(body); + return resp.getData(); + } + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { + com.squareup.okhttp.Call call = fakeOuterStringSerializeValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * (asynchronously) + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call fakeOuterStringSerializeAsync(String body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = fakeOuterStringSerializeValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } /** * Build call for testClientModel * @param body client model (required) diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterComposite.java new file mode 100644 index 00000000000..7bf953b41d6 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterComposite.java @@ -0,0 +1,169 @@ +/* + * 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. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import android.os.Parcelable; +import android.os.Parcel; + +/** + * OuterComposite + */ + +public class OuterComposite implements Parcelable { + @SerializedName("my_number") + private BigDecimal myNumber = null; + + @SerializedName("my_string") + private String myString = null; + + @SerializedName("my_boolean") + private Boolean myBoolean = null; + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @ApiModelProperty(value = "") + public String getMyString() { + return myString; + } + + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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) { + + out.writeValue(myNumber); + + out.writeValue(myString); + + out.writeValue(myBoolean); + } + + public OuterComposite() { + super(); + } + + OuterComposite(Parcel in) { + + myNumber = (BigDecimal)in.readValue(BigDecimal.class.getClassLoader()); + myString = (String)in.readValue(null); + myBoolean = (Boolean)in.readValue(null); + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public OuterComposite createFromParcel(Parcel in) { + return new OuterComposite(in); + } + public OuterComposite[] newArray(int size) { + return new OuterComposite[size]; + } + }; +} + diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md index 01dcb19a054..87e4b69c8e2 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md @@ -4,11 +4,195 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters + +# **fakeOuterBooleanSerialize** +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +Boolean body = true; // Boolean | Input boolean as post body +try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(body) + + + +Test serialization of object with outer number type + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterNumberSerialize** +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body +try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String body = "body_example"; // String | Input string as post body +try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**String**](String.md)| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + # **testClientModel** > Client testClientModel(body) diff --git a/samples/client/petstore/java/okhttp-gson/docs/OuterComposite.md b/samples/client/petstore/java/okhttp-gson/docs/OuterComposite.md new file mode 100644 index 00000000000..3f5a633c998 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java index 132462af980..553e0eeba0f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java @@ -890,6 +890,26 @@ public class ApiClient { * @throws ApiException If fail to serialize the request body object */ public Call buildCall(String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Request request = buildRequest(path, method, queryParams, body, headerParams, formParams, authNames, progressRequestListener); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param progressRequestListener Progress request listener + * @return The HTTP request + * @throws ApiException If fail to serialize the request body object + */ + public Request buildRequest(String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { updateParamsForAuth(authNames, queryParams, headerParams); final String url = buildUrl(path, queryParams); @@ -930,7 +950,7 @@ public class ApiClient { request = reqBuilder.method(method, reqBody).build(); } - return httpClient.newCall(request); + return request; } /** diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java index 29c010ba5b9..6f777bb701d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java @@ -31,6 +31,7 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; import java.lang.reflect.Type; import java.util.ArrayList; @@ -57,6 +58,486 @@ public class FakeApi { this.apiClient = apiClient; } + /** + * Build call for fakeOuterBooleanSerialize + * @param body Input boolean as post body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call fakeOuterBooleanSerializeCall(Boolean body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/boolean"; + + List localVarQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call fakeOuterBooleanSerializeValidateBeforeCall(Boolean body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + + com.squareup.okhttp.Call call = fakeOuterBooleanSerializeCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Boolean + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { + ApiResponse resp = fakeOuterBooleanSerializeWithHttpInfo(body); + return resp.getData(); + } + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return ApiResponse<Boolean> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { + com.squareup.okhttp.Call call = fakeOuterBooleanSerializeValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * (asynchronously) + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call fakeOuterBooleanSerializeAsync(Boolean body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = fakeOuterBooleanSerializeValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for fakeOuterCompositeSerialize + * @param body Input composite as post body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call fakeOuterCompositeSerializeCall(OuterComposite body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/composite"; + + List localVarQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return OuterComposite + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { + ApiResponse resp = fakeOuterCompositeSerializeWithHttpInfo(body); + return resp.getData(); + } + + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return ApiResponse<OuterComposite> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * (asynchronously) + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call fakeOuterCompositeSerializeAsync(OuterComposite body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for fakeOuterNumberSerialize + * @param body Input number as post body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call fakeOuterNumberSerializeCall(BigDecimal body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/number"; + + List localVarQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call fakeOuterNumberSerializeValidateBeforeCall(BigDecimal body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + + com.squareup.okhttp.Call call = fakeOuterNumberSerializeCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return BigDecimal + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { + ApiResponse resp = fakeOuterNumberSerializeWithHttpInfo(body); + return resp.getData(); + } + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return ApiResponse<BigDecimal> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { + com.squareup.okhttp.Call call = fakeOuterNumberSerializeValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * (asynchronously) + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call fakeOuterNumberSerializeAsync(BigDecimal body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = fakeOuterNumberSerializeValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for fakeOuterStringSerialize + * @param body Input string as post body (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call fakeOuterStringSerializeCall(String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/string"; + + List localVarQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call fakeOuterStringSerializeValidateBeforeCall(String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + + com.squareup.okhttp.Call call = fakeOuterStringSerializeCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public String fakeOuterStringSerialize(String body) throws ApiException { + ApiResponse resp = fakeOuterStringSerializeWithHttpInfo(body); + return resp.getData(); + } + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { + com.squareup.okhttp.Call call = fakeOuterStringSerializeValidateBeforeCall(body, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * (asynchronously) + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call fakeOuterStringSerializeAsync(String body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = fakeOuterStringSerializeValidateBeforeCall(body, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } /** * Build call for testClientModel * @param body client model (required) diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterComposite.java new file mode 100644 index 00000000000..85c5f2e3c65 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterComposite.java @@ -0,0 +1,135 @@ +/* + * 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. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; + +/** + * OuterComposite + */ + +public class OuterComposite { + @SerializedName("my_number") + private BigDecimal myNumber = null; + + @SerializedName("my_string") + private String myString = null; + + @SerializedName("my_boolean") + private Boolean myBoolean = null; + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @ApiModelProperty(value = "") + public String getMyString() { + return myString; + } + + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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/FakeApi.md b/samples/client/petstore/java/resteasy/docs/FakeApi.md index 01dcb19a054..87e4b69c8e2 100644 --- a/samples/client/petstore/java/resteasy/docs/FakeApi.md +++ b/samples/client/petstore/java/resteasy/docs/FakeApi.md @@ -4,11 +4,195 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters + +# **fakeOuterBooleanSerialize** +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +Boolean body = true; // Boolean | Input boolean as post body +try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(body) + + + +Test serialization of object with outer number type + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterNumberSerialize** +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body +try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String body = "body_example"; // String | Input string as post body +try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**String**](String.md)| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + # **testClientModel** > Client testClientModel(body) diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/JSON.java index 126fa1c856a..f44d1e5c5ab 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/JSON.java @@ -16,6 +16,7 @@ public class JSON implements ContextResolver { mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/FakeApi.java index 60192509f52..1f6d9885ac8 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/api/FakeApi.java @@ -11,6 +11,7 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; import java.util.ArrayList; import java.util.HashMap; @@ -37,6 +38,150 @@ public class FakeApi { this.apiClient = apiClient; } + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/boolean".replaceAll("\\{format\\}","json"); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return OuterComposite + * @throws ApiException if fails to make API call + */ + public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/composite".replaceAll("\\{format\\}","json"); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return BigDecimal + * @throws ApiException if fails to make API call + */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/number".replaceAll("\\{format\\}","json"); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return String + * @throws ApiException if fails to make API call + */ + public String fakeOuterStringSerialize(String body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/string".replaceAll("\\{format\\}","json"); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } /** * To test \"client\" model * To test \"client\" model diff --git a/samples/client/petstore/java/resttemplate/docs/FakeApi.md b/samples/client/petstore/java/resttemplate/docs/FakeApi.md index 01dcb19a054..87e4b69c8e2 100644 --- a/samples/client/petstore/java/resttemplate/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate/docs/FakeApi.md @@ -4,11 +4,195 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters + +# **fakeOuterBooleanSerialize** +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +Boolean body = true; // Boolean | Input boolean as post body +try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(body) + + + +Test serialization of object with outer number type + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterNumberSerialize** +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body +try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String body = "body_example"; // String | Input string as post body +try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**String**](String.md)| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + # **testClientModel** > Client testClientModel(body) diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/FakeApi.java index b948228e33b..58dd1238126 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/api/FakeApi.java @@ -6,6 +6,7 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; import java.util.ArrayList; import java.util.HashMap; @@ -48,6 +49,114 @@ public class FakeApi { this.apiClient = apiClient; } + /** + * + * Test serialization of outer boolean types + *

200 - Output boolean + * @param body Input boolean as post body + * @return Boolean + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public Boolean fakeOuterBooleanSerialize(Boolean body) throws RestClientException { + Object postBody = body; + + String path = UriComponentsBuilder.fromPath("/fake/outer/boolean").build().toUriString(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] accepts = { }; + final List accept = apiClient.selectHeaderAccept(accepts); + final String[] contentTypes = { }; + final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); + + String[] authNames = new String[] { }; + + ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); + } + /** + * + * Test serialization of object with outer number type + *

200 - Output composite + * @param body Input composite as post body + * @return OuterComposite + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws RestClientException { + Object postBody = body; + + String path = UriComponentsBuilder.fromPath("/fake/outer/composite").build().toUriString(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] accepts = { }; + final List accept = apiClient.selectHeaderAccept(accepts); + final String[] contentTypes = { }; + final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); + + String[] authNames = new String[] { }; + + ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); + } + /** + * + * Test serialization of outer number types + *

200 - Output number + * @param body Input number as post body + * @return BigDecimal + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientException { + Object postBody = body; + + String path = UriComponentsBuilder.fromPath("/fake/outer/number").build().toUriString(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] accepts = { }; + final List accept = apiClient.selectHeaderAccept(accepts); + final String[] contentTypes = { }; + final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); + + String[] authNames = new String[] { }; + + ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); + } + /** + * + * Test serialization of outer string types + *

200 - Output string + * @param body Input string as post body + * @return String + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public String fakeOuterStringSerialize(String body) throws RestClientException { + Object postBody = body; + + String path = UriComponentsBuilder.fromPath("/fake/outer/string").build().toUriString(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] accepts = { }; + final List accept = apiClient.selectHeaderAccept(accepts); + final String[] contentTypes = { }; + final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); + + String[] authNames = new String[] { }; + + ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); + } /** * To test \"client\" model * To test \"client\" model diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java index 67eb33f195e..1300721375a 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java @@ -10,6 +10,7 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; import org.joda.time.DateTime; import org.joda.time.LocalDate; +import io.swagger.client.model.OuterComposite; import java.util.ArrayList; import java.util.HashMap; @@ -17,6 +18,102 @@ import java.util.List; import java.util.Map; public interface FakeApi { + /** + * + * Sync method + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Boolean + */ + + @POST("/fake/outer/boolean") + Boolean fakeOuterBooleanSerialize( + @retrofit.http.Body Boolean body + ); + + /** + * + * Async method + * @param body Input boolean as post body (optional) + * @param cb callback method + */ + + @POST("/fake/outer/boolean") + void fakeOuterBooleanSerialize( + @retrofit.http.Body Boolean body, Callback cb + ); + /** + * + * Sync method + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return OuterComposite + */ + + @POST("/fake/outer/composite") + OuterComposite fakeOuterCompositeSerialize( + @retrofit.http.Body OuterComposite body + ); + + /** + * + * Async method + * @param body Input composite as post body (optional) + * @param cb callback method + */ + + @POST("/fake/outer/composite") + void fakeOuterCompositeSerialize( + @retrofit.http.Body OuterComposite body, Callback cb + ); + /** + * + * Sync method + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return BigDecimal + */ + + @POST("/fake/outer/number") + BigDecimal fakeOuterNumberSerialize( + @retrofit.http.Body BigDecimal body + ); + + /** + * + * Async method + * @param body Input number as post body (optional) + * @param cb callback method + */ + + @POST("/fake/outer/number") + void fakeOuterNumberSerialize( + @retrofit.http.Body BigDecimal body, Callback cb + ); + /** + * + * Sync method + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return String + */ + + @POST("/fake/outer/string") + String fakeOuterStringSerialize( + @retrofit.http.Body String body + ); + + /** + * + * Async method + * @param body Input string as post body (optional) + * @param cb callback method + */ + + @POST("/fake/outer/string") + void fakeOuterStringSerialize( + @retrofit.http.Body String body, Callback cb + ); /** * To test \"client\" model * Sync method diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterComposite.java new file mode 100644 index 00000000000..85c5f2e3c65 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterComposite.java @@ -0,0 +1,135 @@ +/* + * 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. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; + +/** + * OuterComposite + */ + +public class OuterComposite { + @SerializedName("my_number") + private BigDecimal myNumber = null; + + @SerializedName("my_string") + private String myString = null; + + @SerializedName("my_boolean") + private Boolean myBoolean = null; + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @ApiModelProperty(value = "") + public String getMyString() { + return myString; + } + + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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/FakeApi.md b/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md index 4316352e675..406b36b676c 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md @@ -4,11 +4,195 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** fake/outer/string | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** fake | To test enum parameters + +# **fakeOuterBooleanSerialize** +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +Boolean body = true; // Boolean | Input boolean as post body +try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(body) + + + +Test serialization of object with outer number type + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterNumberSerialize** +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body +try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String body = "body_example"; // String | Input string as post body +try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**String**](String.md)| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + # **testClientModel** > Client testClientModel(body) diff --git a/samples/client/petstore/java/retrofit2-play24/docs/OuterComposite.md b/samples/client/petstore/java/retrofit2-play24/docs/OuterComposite.md new file mode 100644 index 00000000000..3f5a633c998 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/FakeApi.java index b2169b7f5a5..88d1ecea222 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/FakeApi.java @@ -13,6 +13,7 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; import java.util.ArrayList; import java.util.HashMap; @@ -23,6 +24,50 @@ import play.libs.F; import retrofit2.Response; public interface FakeApi { + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Call<Boolean> + */ + @POST("fake/outer/boolean") + F.Promise> fakeOuterBooleanSerialize( + @retrofit2.http.Body Boolean body + ); + + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return Call<OuterComposite> + */ + @POST("fake/outer/composite") + F.Promise> fakeOuterCompositeSerialize( + @retrofit2.http.Body OuterComposite body + ); + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return Call<BigDecimal> + */ + @POST("fake/outer/number") + F.Promise> fakeOuterNumberSerialize( + @retrofit2.http.Body BigDecimal body + ); + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return Call<String> + */ + @POST("fake/outer/string") + F.Promise> fakeOuterStringSerialize( + @retrofit2.http.Body String body + ); + /** * To test \"client\" model * To test \"client\" model diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterComposite.java new file mode 100644 index 00000000000..1fb8683f555 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterComposite.java @@ -0,0 +1,140 @@ +/* + * 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. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * OuterComposite + */ + +public class OuterComposite { + @JsonProperty("my_number") + private BigDecimal myNumber = null; + + @JsonProperty("my_string") + private String myString = null; + + @JsonProperty("my_boolean") + private Boolean myBoolean = null; + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @Valid + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @ApiModelProperty(value = "") + public String getMyString() { + return myString; + } + + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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/FakeApi.md b/samples/client/petstore/java/retrofit2/docs/FakeApi.md index 4316352e675..406b36b676c 100644 --- a/samples/client/petstore/java/retrofit2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2/docs/FakeApi.md @@ -4,11 +4,195 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** fake/outer/string | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** fake | To test enum parameters + +# **fakeOuterBooleanSerialize** +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +Boolean body = true; // Boolean | Input boolean as post body +try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(body) + + + +Test serialization of object with outer number type + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterNumberSerialize** +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body +try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String body = "body_example"; // String | Input string as post body +try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**String**](String.md)| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + # **testClientModel** > Client testClientModel(body) diff --git a/samples/client/petstore/java/retrofit2/docs/OuterComposite.md b/samples/client/petstore/java/retrofit2/docs/OuterComposite.md new file mode 100644 index 00000000000..3f5a633c998 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java index e452625c19b..3eeb3180bb3 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java @@ -13,6 +13,7 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; import java.util.ArrayList; import java.util.HashMap; @@ -21,6 +22,50 @@ import java.util.Map; public interface FakeApi { + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Call<Boolean> + */ + @POST("fake/outer/boolean") + Call fakeOuterBooleanSerialize( + @retrofit2.http.Body Boolean body + ); + + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return Call<OuterComposite> + */ + @POST("fake/outer/composite") + Call fakeOuterCompositeSerialize( + @retrofit2.http.Body OuterComposite body + ); + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return Call<BigDecimal> + */ + @POST("fake/outer/number") + Call fakeOuterNumberSerialize( + @retrofit2.http.Body BigDecimal body + ); + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return Call<String> + */ + @POST("fake/outer/string") + Call fakeOuterStringSerialize( + @retrofit2.http.Body String body + ); + /** * To test \"client\" model * To test \"client\" model diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterComposite.java new file mode 100644 index 00000000000..85c5f2e3c65 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterComposite.java @@ -0,0 +1,135 @@ +/* + * 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. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; + +/** + * OuterComposite + */ + +public class OuterComposite { + @SerializedName("my_number") + private BigDecimal myNumber = null; + + @SerializedName("my_string") + private String myString = null; + + @SerializedName("my_boolean") + private Boolean myBoolean = null; + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @ApiModelProperty(value = "") + public String getMyString() { + return myString; + } + + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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/FakeApi.md b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md index 4316352e675..406b36b676c 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md @@ -4,11 +4,195 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** fake/outer/string | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** fake | To test enum parameters + +# **fakeOuterBooleanSerialize** +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +Boolean body = true; // Boolean | Input boolean as post body +try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(body) + + + +Test serialization of object with outer number type + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterNumberSerialize** +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body +try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String body = "body_example"; // String | Input string as post body +try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**String**](String.md)| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + # **testClientModel** > Client testClientModel(body) diff --git a/samples/client/petstore/java/retrofit2rx/docs/OuterComposite.md b/samples/client/petstore/java/retrofit2rx/docs/OuterComposite.md new file mode 100644 index 00000000000..3f5a633c998 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java index b0c30a0ab8d..67288f1b02e 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java @@ -13,6 +13,7 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; import java.util.ArrayList; import java.util.HashMap; @@ -21,6 +22,50 @@ import java.util.Map; public interface FakeApi { + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Call<Boolean> + */ + @POST("fake/outer/boolean") + Observable fakeOuterBooleanSerialize( + @retrofit2.http.Body Boolean body + ); + + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return Call<OuterComposite> + */ + @POST("fake/outer/composite") + Observable fakeOuterCompositeSerialize( + @retrofit2.http.Body OuterComposite body + ); + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return Call<BigDecimal> + */ + @POST("fake/outer/number") + Observable fakeOuterNumberSerialize( + @retrofit2.http.Body BigDecimal body + ); + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return Call<String> + */ + @POST("fake/outer/string") + Observable fakeOuterStringSerialize( + @retrofit2.http.Body String body + ); + /** * To test \"client\" model * To test \"client\" model diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterComposite.java new file mode 100644 index 00000000000..85c5f2e3c65 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterComposite.java @@ -0,0 +1,135 @@ +/* + * 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. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; + +/** + * OuterComposite + */ + +public class OuterComposite { + @SerializedName("my_number") + private BigDecimal myNumber = null; + + @SerializedName("my_string") + private String myString = null; + + @SerializedName("my_boolean") + private Boolean myBoolean = null; + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @ApiModelProperty(value = "") + public String getMyString() { + return myString; + } + + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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/build.gradle b/samples/client/petstore/java/retrofit2rx2/build.gradle index 8957df1202a..d658b9d2ab4 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.gradle +++ b/samples/client/petstore/java/retrofit2rx2/build.gradle @@ -9,8 +9,8 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.5.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' } } @@ -21,76 +21,76 @@ repositories { if(hasProperty('target') && target == 'android') { - apply plugin: 'com.android.library' - apply plugin: 'com.github.dcendents.android-maven' + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' - android { - compileSdkVersion 23 - buildToolsVersion '23.0.2' - defaultConfig { - minSdkVersion 14 - targetSdkVersion 23 - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - } + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + } - // Rename the aar correctly - libraryVariants.all { variant -> - variant.outputs.each { output -> - def outputFile = output.outputFile - if (outputFile != null && outputFile.name.endsWith('.aar')) { - def fileName = "${project.name}-${variant.baseName}-${version}.aar" - output.outputFile = new File(outputFile.parent, fileName) - } - } - } + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } - dependencies { - provided 'javax.annotation:jsr250-api:1.0' - } - } + dependencies { + provided 'javax.annotation:jsr250-api:1.0' + } + } - afterEvaluate { - android.libraryVariants.all { variant -> - def task = project.tasks.create "jar${variant.name.capitalize()}", Jar - task.description = "Create jar artifact for ${variant.name}" - task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); - } - } + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } - task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' - } + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } - artifacts { - archives sourcesJar - } + artifacts { + archives sourcesJar + } } else { - apply plugin: 'java' - apply plugin: 'maven' + apply plugin: 'java' + apply plugin: 'maven' sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 - install { - repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-retrofit2-rx2' - } - } + install { + repositories.mavenInstaller { + pom.artifactId = 'swagger-petstore-retrofit2-rx2' + } + } - task execute(type:JavaExec) { - main = System.getProperty('mainClass') - classpath = sourceSets.main.runtimeClasspath - } + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } } ext { diff --git a/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md index 4316352e675..406b36b676c 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md @@ -4,11 +4,195 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** fake/outer/string | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** fake | To test enum parameters + +# **fakeOuterBooleanSerialize** +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +Boolean body = true; // Boolean | Input boolean as post body +try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(body) + + + +Test serialization of object with outer number type + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body +try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterNumberSerialize** +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body +try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + +FakeApi apiInstance = new FakeApi(); +String body = "body_example"; // String | Input string as post body +try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**String**](String.md)| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + # **testClientModel** > Client testClientModel(body) diff --git a/samples/client/petstore/java/retrofit2rx2/docs/OuterComposite.md b/samples/client/petstore/java/retrofit2rx2/docs/OuterComposite.md new file mode 100644 index 00000000000..3f5a633c998 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeApi.java index d584e519141..a724bd647bc 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeApi.java @@ -13,6 +13,7 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import io.swagger.client.model.OuterComposite; import java.util.ArrayList; import java.util.HashMap; @@ -21,6 +22,50 @@ import java.util.Map; public interface FakeApi { + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Call<Boolean> + */ + @POST("fake/outer/boolean") + Observable fakeOuterBooleanSerialize( + @retrofit2.http.Body Boolean body + ); + + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return Call<OuterComposite> + */ + @POST("fake/outer/composite") + Observable fakeOuterCompositeSerialize( + @retrofit2.http.Body OuterComposite body + ); + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return Call<BigDecimal> + */ + @POST("fake/outer/number") + Observable fakeOuterNumberSerialize( + @retrofit2.http.Body BigDecimal body + ); + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return Call<String> + */ + @POST("fake/outer/string") + Observable fakeOuterStringSerialize( + @retrofit2.http.Body String body + ); + /** * To test \"client\" model * To test \"client\" model diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterComposite.java new file mode 100644 index 00000000000..85c5f2e3c65 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterComposite.java @@ -0,0 +1,135 @@ +/* + * 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. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; + +/** + * OuterComposite + */ + +public class OuterComposite { + @SerializedName("my_number") + private BigDecimal myNumber = null; + + @SerializedName("my_string") + private String myString = null; + + @SerializedName("my_boolean") + private Boolean myBoolean = null; + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @ApiModelProperty(value = "") + public BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @ApiModelProperty(value = "") + public String getMyString() { + return myString; + } + + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @ApiModelProperty(value = "") + public Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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/javascript-promise/.swagger-codegen/VERSION b/samples/client/petstore/javascript-promise/.swagger-codegen/VERSION index 7fea99011a6..f9f7450d135 100644 --- a/samples/client/petstore/javascript-promise/.swagger-codegen/VERSION +++ b/samples/client/petstore/javascript-promise/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise/README.md b/samples/client/petstore/javascript-promise/README.md index 5c927af0e7c..601da7b03da 100644 --- a/samples/client/petstore/javascript-promise/README.md +++ b/samples/client/petstore/javascript-promise/README.md @@ -54,9 +54,10 @@ var SwaggerPetstore = require('swagger_petstore'); var api = new SwaggerPetstore.FakeApi() -var body = new SwaggerPetstore.Client(); // {Client} client model - -api.testClientModel(body).then(function(data) { +var opts = { + 'body': new SwaggerPetstore.OuterBoolean() // {OuterBoolean} Input boolean as post body +}; +api.fakeOuterBooleanSerialize(opts).then(function(data) { console.log('API called successfully. Returned data: ' + data); }, function(error) { console.error(error); @@ -71,6 +72,10 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*SwaggerPetstore.FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +*SwaggerPetstore.FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +*SwaggerPetstore.FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +*SwaggerPetstore.FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | *SwaggerPetstore.FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -125,7 +130,11 @@ Class | Method | HTTP request | Description - [SwaggerPetstore.Name](docs/Name.md) - [SwaggerPetstore.NumberOnly](docs/NumberOnly.md) - [SwaggerPetstore.Order](docs/Order.md) + - [SwaggerPetstore.OuterBoolean](docs/OuterBoolean.md) + - [SwaggerPetstore.OuterComposite](docs/OuterComposite.md) - [SwaggerPetstore.OuterEnum](docs/OuterEnum.md) + - [SwaggerPetstore.OuterNumber](docs/OuterNumber.md) + - [SwaggerPetstore.OuterString](docs/OuterString.md) - [SwaggerPetstore.Pet](docs/Pet.md) - [SwaggerPetstore.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SwaggerPetstore.SpecialModelName](docs/SpecialModelName.md) diff --git a/samples/client/petstore/javascript-promise/docs/FakeApi.md b/samples/client/petstore/javascript-promise/docs/FakeApi.md index a6ff5402cec..7bfea4df889 100644 --- a/samples/client/petstore/javascript-promise/docs/FakeApi.md +++ b/samples/client/petstore/javascript-promise/docs/FakeApi.md @@ -4,11 +4,191 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters + +# **fakeOuterBooleanSerialize** +> OuterBoolean fakeOuterBooleanSerialize(opts) + + + +Test serialization of outer boolean types + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); + +var apiInstance = new SwaggerPetstore.FakeApi(); + +var opts = { + 'body': new SwaggerPetstore.OuterBoolean() // OuterBoolean | Input boolean as post body +}; +apiInstance.fakeOuterBooleanSerialize(opts).then(function(data) { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + +### Return type + +[**OuterBoolean**](OuterBoolean.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(opts) + + + +Test serialization of object with outer number type + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); + +var apiInstance = new SwaggerPetstore.FakeApi(); + +var opts = { + 'body': new SwaggerPetstore.OuterComposite() // OuterComposite | Input composite as post body +}; +apiInstance.fakeOuterCompositeSerialize(opts).then(function(data) { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterNumberSerialize** +> OuterNumber fakeOuterNumberSerialize(opts) + + + +Test serialization of outer number types + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); + +var apiInstance = new SwaggerPetstore.FakeApi(); + +var opts = { + 'body': new SwaggerPetstore.OuterNumber() // OuterNumber | Input number as post body +}; +apiInstance.fakeOuterNumberSerialize(opts).then(function(data) { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + +### Return type + +[**OuterNumber**](OuterNumber.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterStringSerialize** +> OuterString fakeOuterStringSerialize(opts) + + + +Test serialization of outer string types + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); + +var apiInstance = new SwaggerPetstore.FakeApi(); + +var opts = { + 'body': new SwaggerPetstore.OuterString() // OuterString | Input string as post body +}; +apiInstance.fakeOuterStringSerialize(opts).then(function(data) { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + +### Return type + +[**OuterString**](OuterString.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + # **testClientModel** > Client testClientModel(body) diff --git a/samples/client/petstore/javascript-promise/docs/OuterBoolean.md b/samples/client/petstore/javascript-promise/docs/OuterBoolean.md new file mode 100644 index 00000000000..61ea0d56615 --- /dev/null +++ b/samples/client/petstore/javascript-promise/docs/OuterBoolean.md @@ -0,0 +1,7 @@ +# SwaggerPetstore.OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/javascript-promise/docs/OuterComposite.md b/samples/client/petstore/javascript-promise/docs/OuterComposite.md new file mode 100644 index 00000000000..e4cb57f35af --- /dev/null +++ b/samples/client/petstore/javascript-promise/docs/OuterComposite.md @@ -0,0 +1,10 @@ +# SwaggerPetstore.OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**OuterNumber**](OuterNumber.md) | | [optional] +**myString** | [**OuterString**](OuterString.md) | | [optional] +**myBoolean** | [**OuterBoolean**](OuterBoolean.md) | | [optional] + + diff --git a/samples/client/petstore/javascript-promise/docs/OuterNumber.md b/samples/client/petstore/javascript-promise/docs/OuterNumber.md new file mode 100644 index 00000000000..efbbfa83535 --- /dev/null +++ b/samples/client/petstore/javascript-promise/docs/OuterNumber.md @@ -0,0 +1,7 @@ +# SwaggerPetstore.OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/javascript-promise/docs/OuterString.md b/samples/client/petstore/javascript-promise/docs/OuterString.md new file mode 100644 index 00000000000..22eba5351a9 --- /dev/null +++ b/samples/client/petstore/javascript-promise/docs/OuterString.md @@ -0,0 +1,7 @@ +# SwaggerPetstore.OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/javascript-promise/src/ApiClient.js b/samples/client/petstore/javascript-promise/src/ApiClient.js index c91f045b203..32d95e0434a 100644 --- a/samples/client/petstore/javascript-promise/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise/src/ApiClient.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/FakeApi.js b/samples/client/petstore/javascript-promise/src/api/FakeApi.js index efafa82f64f..74a03d71017 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * @@ -17,18 +17,18 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/Client'], factory); + define(['ApiClient', 'model/Client', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterNumber', 'model/OuterString'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../model/Client')); + module.exports = factory(require('../ApiClient'), require('../model/Client'), require('../model/OuterBoolean'), require('../model/OuterComposite'), require('../model/OuterNumber'), require('../model/OuterString')); } else { // Browser globals (root is window) if (!root.SwaggerPetstore) { root.SwaggerPetstore = {}; } - root.SwaggerPetstore.FakeApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client); + root.SwaggerPetstore.FakeApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client, root.SwaggerPetstore.OuterBoolean, root.SwaggerPetstore.OuterComposite, root.SwaggerPetstore.OuterNumber, root.SwaggerPetstore.OuterString); } -}(this, function(ApiClient, Client) { +}(this, function(ApiClient, Client, OuterBoolean, OuterComposite, OuterNumber, OuterString) { 'use strict'; /** @@ -49,6 +49,198 @@ + /** + * Test serialization of outer boolean types + * @param {Object} opts Optional parameters + * @param {module:model/OuterBoolean} opts.body Input boolean as post body + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OuterBoolean} and HTTP response + */ + this.fakeOuterBooleanSerializeWithHttpInfo = function(opts) { + opts = opts || {}; + var postBody = opts['body']; + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = []; + var accepts = []; + var returnType = OuterBoolean; + + return this.apiClient.callApi( + '/fake/outer/boolean', 'POST', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * Test serialization of outer boolean types + * @param {Object} opts Optional parameters + * @param {module:model/OuterBoolean} opts.body Input boolean as post body + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OuterBoolean} + */ + this.fakeOuterBooleanSerialize = function(opts) { + return this.fakeOuterBooleanSerializeWithHttpInfo(opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Test serialization of object with outer number type + * @param {Object} opts Optional parameters + * @param {module:model/OuterComposite} opts.body Input composite as post body + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OuterComposite} and HTTP response + */ + this.fakeOuterCompositeSerializeWithHttpInfo = function(opts) { + opts = opts || {}; + var postBody = opts['body']; + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = []; + var accepts = []; + var returnType = OuterComposite; + + return this.apiClient.callApi( + '/fake/outer/composite', 'POST', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * Test serialization of object with outer number type + * @param {Object} opts Optional parameters + * @param {module:model/OuterComposite} opts.body Input composite as post body + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OuterComposite} + */ + this.fakeOuterCompositeSerialize = function(opts) { + return this.fakeOuterCompositeSerializeWithHttpInfo(opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Test serialization of outer number types + * @param {Object} opts Optional parameters + * @param {module:model/OuterNumber} opts.body Input number as post body + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OuterNumber} and HTTP response + */ + this.fakeOuterNumberSerializeWithHttpInfo = function(opts) { + opts = opts || {}; + var postBody = opts['body']; + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = []; + var accepts = []; + var returnType = OuterNumber; + + return this.apiClient.callApi( + '/fake/outer/number', 'POST', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * Test serialization of outer number types + * @param {Object} opts Optional parameters + * @param {module:model/OuterNumber} opts.body Input number as post body + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OuterNumber} + */ + this.fakeOuterNumberSerialize = function(opts) { + return this.fakeOuterNumberSerializeWithHttpInfo(opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Test serialization of outer string types + * @param {Object} opts Optional parameters + * @param {module:model/OuterString} opts.body Input string as post body + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OuterString} and HTTP response + */ + this.fakeOuterStringSerializeWithHttpInfo = function(opts) { + opts = opts || {}; + var postBody = opts['body']; + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = []; + var accepts = []; + var returnType = OuterString; + + return this.apiClient.callApi( + '/fake/outer/string', 'POST', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * Test serialization of outer string types + * @param {Object} opts Optional parameters + * @param {module:model/OuterString} opts.body Input string as post body + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OuterString} + */ + this.fakeOuterStringSerialize = function(opts) { + return this.fakeOuterStringSerializeWithHttpInfo(opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + /** * To test \"client\" model * To test \"client\" model diff --git a/samples/client/petstore/javascript-promise/src/api/Fake_classname_tags123Api.js b/samples/client/petstore/javascript-promise/src/api/Fake_classname_tags123Api.js index 1715c9f8da0..7d9a624e19e 100644 --- a/samples/client/petstore/javascript-promise/src/api/Fake_classname_tags123Api.js +++ b/samples/client/petstore/javascript-promise/src/api/Fake_classname_tags123Api.js @@ -7,6 +7,9 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * * Do not edit the class manually. * */ diff --git a/samples/client/petstore/javascript-promise/src/api/PetApi.js b/samples/client/petstore/javascript-promise/src/api/PetApi.js index e3a5a506185..6aada6cbc14 100644 --- a/samples/client/petstore/javascript-promise/src/api/PetApi.js +++ b/samples/client/petstore/javascript-promise/src/api/PetApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/StoreApi.js b/samples/client/petstore/javascript-promise/src/api/StoreApi.js index bd090371c42..48f7bbfce43 100644 --- a/samples/client/petstore/javascript-promise/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise/src/api/StoreApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/UserApi.js b/samples/client/petstore/javascript-promise/src/api/UserApi.js index 7936ab8d413..05f37528d95 100644 --- a/samples/client/petstore/javascript-promise/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise/src/api/UserApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/index.js b/samples/client/petstore/javascript-promise/src/index.js index 966908ebee0..94648435400 100644 --- a/samples/client/petstore/javascript-promise/src/index.js +++ b/samples/client/petstore/javascript-promise/src/index.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * @@ -17,12 +17,12 @@ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Cat', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterEnum', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'api/FakeApi', 'api/Fake_classname_tags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); + define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Cat', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterEnum', 'model/OuterNumber', 'model/OuterString', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'api/FakeApi', 'api/Fake_classname_tags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Cat'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterEnum'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/FakeApi'), require('./api/Fake_classname_tags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); + module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Cat'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterBoolean'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/OuterNumber'), require('./model/OuterString'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/FakeApi'), require('./api/Fake_classname_tags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); } -}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Cat, Category, ClassModel, Client, Dog, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterEnum, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, FakeApi, Fake_classname_tags123Api, PetApi, StoreApi, UserApi) { +}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Cat, Category, ClassModel, Client, Dog, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterBoolean, OuterComposite, OuterEnum, OuterNumber, OuterString, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, FakeApi, Fake_classname_tags123Api, PetApi, StoreApi, UserApi) { 'use strict'; /** @@ -192,11 +192,31 @@ * @property {module:model/Order} */ Order: Order, + /** + * The OuterBoolean model constructor. + * @property {module:model/OuterBoolean} + */ + OuterBoolean: OuterBoolean, + /** + * The OuterComposite model constructor. + * @property {module:model/OuterComposite} + */ + OuterComposite: OuterComposite, /** * The OuterEnum model constructor. * @property {module:model/OuterEnum} */ OuterEnum: OuterEnum, + /** + * The OuterNumber model constructor. + * @property {module:model/OuterNumber} + */ + OuterNumber: OuterNumber, + /** + * The OuterString model constructor. + * @property {module:model/OuterString} + */ + OuterString: OuterString, /** * The Pet model constructor. * @property {module:model/Pet} diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js index 2744647b18a..4399d89bdc3 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Animal.js b/samples/client/petstore/javascript-promise/src/model/Animal.js index 09119420568..eee2768eeb6 100644 --- a/samples/client/petstore/javascript-promise/src/model/Animal.js +++ b/samples/client/petstore/javascript-promise/src/model/Animal.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AnimalFarm.js b/samples/client/petstore/javascript-promise/src/model/AnimalFarm.js index 891009dab71..b24078dee2a 100644 --- a/samples/client/petstore/javascript-promise/src/model/AnimalFarm.js +++ b/samples/client/petstore/javascript-promise/src/model/AnimalFarm.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ApiResponse.js b/samples/client/petstore/javascript-promise/src/model/ApiResponse.js index 12e9e16275f..9588ce4cf31 100644 --- a/samples/client/petstore/javascript-promise/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript-promise/src/model/ApiResponse.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js index c620c19e667..0b91fc04338 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js index 66980b9b8d1..f79ab37c076 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayTest.js b/samples/client/petstore/javascript-promise/src/model/ArrayTest.js index 2fb4ecb6c24..8698b21a153 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Capitalization.js b/samples/client/petstore/javascript-promise/src/model/Capitalization.js index 54154d396f8..e4d1cce1e92 100644 --- a/samples/client/petstore/javascript-promise/src/model/Capitalization.js +++ b/samples/client/petstore/javascript-promise/src/model/Capitalization.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Cat.js b/samples/client/petstore/javascript-promise/src/model/Cat.js index 862e7b0c910..55f0a0c9834 100644 --- a/samples/client/petstore/javascript-promise/src/model/Cat.js +++ b/samples/client/petstore/javascript-promise/src/model/Cat.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Category.js b/samples/client/petstore/javascript-promise/src/model/Category.js index d7ecc2207da..37f547c79a1 100644 --- a/samples/client/petstore/javascript-promise/src/model/Category.js +++ b/samples/client/petstore/javascript-promise/src/model/Category.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ClassModel.js b/samples/client/petstore/javascript-promise/src/model/ClassModel.js index c3b7b83f9c5..bd390a22524 100644 --- a/samples/client/petstore/javascript-promise/src/model/ClassModel.js +++ b/samples/client/petstore/javascript-promise/src/model/ClassModel.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Client.js b/samples/client/petstore/javascript-promise/src/model/Client.js index a2912224910..21add8d7f98 100644 --- a/samples/client/petstore/javascript-promise/src/model/Client.js +++ b/samples/client/petstore/javascript-promise/src/model/Client.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Dog.js b/samples/client/petstore/javascript-promise/src/model/Dog.js index 2cd286fb741..f567953b625 100644 --- a/samples/client/petstore/javascript-promise/src/model/Dog.js +++ b/samples/client/petstore/javascript-promise/src/model/Dog.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/EnumArrays.js b/samples/client/petstore/javascript-promise/src/model/EnumArrays.js index 079cfe25084..00036542ba7 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumArrays.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/EnumClass.js b/samples/client/petstore/javascript-promise/src/model/EnumClass.js index 881a7503047..f03ab350d2f 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumClass.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/EnumTest.js b/samples/client/petstore/javascript-promise/src/model/EnumTest.js index 215bea59d38..3e7c9311aaf 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/FormatTest.js b/samples/client/petstore/javascript-promise/src/model/FormatTest.js index 238224d0132..9b93b06b7ca 100644 --- a/samples/client/petstore/javascript-promise/src/model/FormatTest.js +++ b/samples/client/petstore/javascript-promise/src/model/FormatTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js index 566e0663de0..17c09dfca7b 100644 --- a/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/List.js b/samples/client/petstore/javascript-promise/src/model/List.js index b5db0490fe4..ce54341bb18 100644 --- a/samples/client/petstore/javascript-promise/src/model/List.js +++ b/samples/client/petstore/javascript-promise/src/model/List.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/MapTest.js b/samples/client/petstore/javascript-promise/src/model/MapTest.js index 59f089976c1..b7d0164b998 100644 --- a/samples/client/petstore/javascript-promise/src/model/MapTest.js +++ b/samples/client/petstore/javascript-promise/src/model/MapTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index 334b0773a04..973ca5a65e2 100644 --- a/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Model200Response.js b/samples/client/petstore/javascript-promise/src/model/Model200Response.js index a10e470be5c..c382f333344 100644 --- a/samples/client/petstore/javascript-promise/src/model/Model200Response.js +++ b/samples/client/petstore/javascript-promise/src/model/Model200Response.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ModelReturn.js b/samples/client/petstore/javascript-promise/src/model/ModelReturn.js index 07467bbaa63..fa5bc9910f8 100644 --- a/samples/client/petstore/javascript-promise/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript-promise/src/model/ModelReturn.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Name.js b/samples/client/petstore/javascript-promise/src/model/Name.js index d79c05387fe..0671311976c 100644 --- a/samples/client/petstore/javascript-promise/src/model/Name.js +++ b/samples/client/petstore/javascript-promise/src/model/Name.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/NumberOnly.js b/samples/client/petstore/javascript-promise/src/model/NumberOnly.js index c5edb0b0a50..d9ee8fcd3ab 100644 --- a/samples/client/petstore/javascript-promise/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/NumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Order.js b/samples/client/petstore/javascript-promise/src/model/Order.js index f4f9087001d..f082668517f 100644 --- a/samples/client/petstore/javascript-promise/src/model/Order.js +++ b/samples/client/petstore/javascript-promise/src/model/Order.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/OuterBoolean.js b/samples/client/petstore/javascript-promise/src/model/OuterBoolean.js new file mode 100644 index 00000000000..96b8b11d1bc --- /dev/null +++ b/samples/client/petstore/javascript-promise/src/model/OuterBoolean.js @@ -0,0 +1,74 @@ +/** + * 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 + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.OuterBoolean = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The OuterBoolean model module. + * @module model/OuterBoolean + * @version 1.0.0 + */ + + /** + * Constructs a new OuterBoolean. + * @alias module:model/OuterBoolean + * @class + */ + var exports = function() { + var _this = this; + + }; + + /** + * 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. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + } + return obj; + } + + + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript-promise/src/model/OuterComposite.js b/samples/client/petstore/javascript-promise/src/model/OuterComposite.js new file mode 100644 index 00000000000..14e7775588b --- /dev/null +++ b/samples/client/petstore/javascript-promise/src/model/OuterComposite.js @@ -0,0 +1,98 @@ +/** + * 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 + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/OuterBoolean', 'model/OuterNumber', 'model/OuterString'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./OuterBoolean'), require('./OuterNumber'), require('./OuterString')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.OuterComposite = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.OuterBoolean, root.SwaggerPetstore.OuterNumber, root.SwaggerPetstore.OuterString); + } +}(this, function(ApiClient, OuterBoolean, OuterNumber, OuterString) { + 'use strict'; + + + + + /** + * The OuterComposite model module. + * @module model/OuterComposite + * @version 1.0.0 + */ + + /** + * Constructs a new OuterComposite. + * @alias module:model/OuterComposite + * @class + */ + var exports = function() { + var _this = 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. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('my_number')) { + obj['my_number'] = OuterNumber.constructFromObject(data['my_number']); + } + if (data.hasOwnProperty('my_string')) { + obj['my_string'] = OuterString.constructFromObject(data['my_string']); + } + if (data.hasOwnProperty('my_boolean')) { + obj['my_boolean'] = OuterBoolean.constructFromObject(data['my_boolean']); + } + } + return obj; + } + + /** + * @member {module:model/OuterNumber} my_number + */ + exports.prototype['my_number'] = undefined; + /** + * @member {module:model/OuterString} my_string + */ + exports.prototype['my_string'] = undefined; + /** + * @member {module:model/OuterBoolean} my_boolean + */ + exports.prototype['my_boolean'] = undefined; + + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript-promise/src/model/OuterEnum.js b/samples/client/petstore/javascript-promise/src/model/OuterEnum.js index 4ba975cf97a..cdd43098369 100644 --- a/samples/client/petstore/javascript-promise/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript-promise/src/model/OuterEnum.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/OuterNumber.js b/samples/client/petstore/javascript-promise/src/model/OuterNumber.js new file mode 100644 index 00000000000..1128dcb8afe --- /dev/null +++ b/samples/client/petstore/javascript-promise/src/model/OuterNumber.js @@ -0,0 +1,74 @@ +/** + * 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 + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.OuterNumber = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The OuterNumber model module. + * @module model/OuterNumber + * @version 1.0.0 + */ + + /** + * Constructs a new OuterNumber. + * @alias module:model/OuterNumber + * @class + */ + var exports = function() { + var _this = this; + + }; + + /** + * 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. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + } + return obj; + } + + + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript-promise/src/model/OuterString.js b/samples/client/petstore/javascript-promise/src/model/OuterString.js new file mode 100644 index 00000000000..3a012fbb0c9 --- /dev/null +++ b/samples/client/petstore/javascript-promise/src/model/OuterString.js @@ -0,0 +1,74 @@ +/** + * 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 + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.OuterString = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The OuterString model module. + * @module model/OuterString + * @version 1.0.0 + */ + + /** + * Constructs a new OuterString. + * @alias module:model/OuterString + * @class + */ + var exports = function() { + var _this = this; + + }; + + /** + * 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. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + } + return obj; + } + + + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript-promise/src/model/Pet.js b/samples/client/petstore/javascript-promise/src/model/Pet.js index d5e8d5010ac..7edd65724ba 100644 --- a/samples/client/petstore/javascript-promise/src/model/Pet.js +++ b/samples/client/petstore/javascript-promise/src/model/Pet.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js index 91612f15351..f6f0064fd96 100644 --- a/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js b/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js index bb13c09d956..921a1e87379 100644 --- a/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Tag.js b/samples/client/petstore/javascript-promise/src/model/Tag.js index 1066827e11e..6308751e08f 100644 --- a/samples/client/petstore/javascript-promise/src/model/Tag.js +++ b/samples/client/petstore/javascript-promise/src/model/Tag.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/User.js b/samples/client/petstore/javascript-promise/src/model/User.js index e96af875697..1d251e22b3c 100644 --- a/samples/client/petstore/javascript-promise/src/model/User.js +++ b/samples/client/petstore/javascript-promise/src/model/User.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/test/model/OuterBoolean.spec.js b/samples/client/petstore/javascript-promise/test/model/OuterBoolean.spec.js new file mode 100644 index 00000000000..d5495a638d8 --- /dev/null +++ b/samples/client/petstore/javascript-promise/test/model/OuterBoolean.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.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-promise/test/model/OuterComposite.spec.js b/samples/client/petstore/javascript-promise/test/model/OuterComposite.spec.js new file mode 100644 index 00000000000..6fd830b7c0e --- /dev/null +++ b/samples/client/petstore/javascript-promise/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-promise/test/model/OuterNumber.spec.js b/samples/client/petstore/javascript-promise/test/model/OuterNumber.spec.js new file mode 100644 index 00000000000..7b0e4ebf119 --- /dev/null +++ b/samples/client/petstore/javascript-promise/test/model/OuterNumber.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.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-promise/test/model/OuterString.spec.js b/samples/client/petstore/javascript-promise/test/model/OuterString.spec.js new file mode 100644 index 00000000000..4e7f99ca88d --- /dev/null +++ b/samples/client/petstore/javascript-promise/test/model/OuterString.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.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/.swagger-codegen/VERSION b/samples/client/petstore/javascript/.swagger-codegen/VERSION index 7fea99011a6..f9f7450d135 100644 --- a/samples/client/petstore/javascript/.swagger-codegen/VERSION +++ b/samples/client/petstore/javascript/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md index 3d8ca3acf66..6bb9ce51d2a 100644 --- a/samples/client/petstore/javascript/README.md +++ b/samples/client/petstore/javascript/README.md @@ -54,8 +54,9 @@ var SwaggerPetstore = require('swagger_petstore'); var api = new SwaggerPetstore.FakeApi() -var body = new SwaggerPetstore.Client(); // {Client} client model - +var opts = { + 'body': new SwaggerPetstore.OuterBoolean() // {OuterBoolean} Input boolean as post body +}; var callback = function(error, data, response) { if (error) { @@ -64,7 +65,7 @@ var callback = function(error, data, response) { console.log('API called successfully. Returned data: ' + data); } }; -api.testClientModel(body, callback); +api.fakeOuterBooleanSerialize(opts, callback); ``` @@ -74,6 +75,10 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*SwaggerPetstore.FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +*SwaggerPetstore.FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +*SwaggerPetstore.FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +*SwaggerPetstore.FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | *SwaggerPetstore.FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -128,7 +133,11 @@ Class | Method | HTTP request | Description - [SwaggerPetstore.Name](docs/Name.md) - [SwaggerPetstore.NumberOnly](docs/NumberOnly.md) - [SwaggerPetstore.Order](docs/Order.md) + - [SwaggerPetstore.OuterBoolean](docs/OuterBoolean.md) + - [SwaggerPetstore.OuterComposite](docs/OuterComposite.md) - [SwaggerPetstore.OuterEnum](docs/OuterEnum.md) + - [SwaggerPetstore.OuterNumber](docs/OuterNumber.md) + - [SwaggerPetstore.OuterString](docs/OuterString.md) - [SwaggerPetstore.Pet](docs/Pet.md) - [SwaggerPetstore.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SwaggerPetstore.SpecialModelName](docs/SpecialModelName.md) diff --git a/samples/client/petstore/javascript/docs/FakeApi.md b/samples/client/petstore/javascript/docs/FakeApi.md index 88cb5cf0f2f..85ac0b3d8a2 100644 --- a/samples/client/petstore/javascript/docs/FakeApi.md +++ b/samples/client/petstore/javascript/docs/FakeApi.md @@ -4,11 +4,203 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters + +# **fakeOuterBooleanSerialize** +> OuterBoolean fakeOuterBooleanSerialize(opts) + + + +Test serialization of outer boolean types + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); + +var apiInstance = new SwaggerPetstore.FakeApi(); + +var opts = { + 'body': new SwaggerPetstore.OuterBoolean() // OuterBoolean | Input boolean as post body +}; + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}; +apiInstance.fakeOuterBooleanSerialize(opts, callback); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + +### Return type + +[**OuterBoolean**](OuterBoolean.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(opts) + + + +Test serialization of object with outer number type + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); + +var apiInstance = new SwaggerPetstore.FakeApi(); + +var opts = { + 'body': new SwaggerPetstore.OuterComposite() // OuterComposite | Input composite as post body +}; + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}; +apiInstance.fakeOuterCompositeSerialize(opts, callback); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterNumberSerialize** +> OuterNumber fakeOuterNumberSerialize(opts) + + + +Test serialization of outer number types + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); + +var apiInstance = new SwaggerPetstore.FakeApi(); + +var opts = { + 'body': new SwaggerPetstore.OuterNumber() // OuterNumber | Input number as post body +}; + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}; +apiInstance.fakeOuterNumberSerialize(opts, callback); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + +### Return type + +[**OuterNumber**](OuterNumber.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **fakeOuterStringSerialize** +> OuterString fakeOuterStringSerialize(opts) + + + +Test serialization of outer string types + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); + +var apiInstance = new SwaggerPetstore.FakeApi(); + +var opts = { + 'body': new SwaggerPetstore.OuterString() // OuterString | Input string as post body +}; + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}; +apiInstance.fakeOuterStringSerialize(opts, callback); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + +### Return type + +[**OuterString**](OuterString.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + # **testClientModel** > Client testClientModel(body) diff --git a/samples/client/petstore/javascript/docs/OuterBoolean.md b/samples/client/petstore/javascript/docs/OuterBoolean.md new file mode 100644 index 00000000000..61ea0d56615 --- /dev/null +++ b/samples/client/petstore/javascript/docs/OuterBoolean.md @@ -0,0 +1,7 @@ +# SwaggerPetstore.OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/javascript/docs/OuterComposite.md b/samples/client/petstore/javascript/docs/OuterComposite.md new file mode 100644 index 00000000000..e4cb57f35af --- /dev/null +++ b/samples/client/petstore/javascript/docs/OuterComposite.md @@ -0,0 +1,10 @@ +# SwaggerPetstore.OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**OuterNumber**](OuterNumber.md) | | [optional] +**myString** | [**OuterString**](OuterString.md) | | [optional] +**myBoolean** | [**OuterBoolean**](OuterBoolean.md) | | [optional] + + diff --git a/samples/client/petstore/javascript/docs/OuterNumber.md b/samples/client/petstore/javascript/docs/OuterNumber.md new file mode 100644 index 00000000000..efbbfa83535 --- /dev/null +++ b/samples/client/petstore/javascript/docs/OuterNumber.md @@ -0,0 +1,7 @@ +# SwaggerPetstore.OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/javascript/docs/OuterString.md b/samples/client/petstore/javascript/docs/OuterString.md new file mode 100644 index 00000000000..22eba5351a9 --- /dev/null +++ b/samples/client/petstore/javascript/docs/OuterString.md @@ -0,0 +1,7 @@ +# SwaggerPetstore.OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/javascript/src/ApiClient.js b/samples/client/petstore/javascript/src/ApiClient.js index 7cd2f5298db..52a3af4d25a 100644 --- a/samples/client/petstore/javascript/src/ApiClient.js +++ b/samples/client/petstore/javascript/src/ApiClient.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index 02d12ee26c6..7353eb33f40 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * @@ -17,18 +17,18 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/Client'], factory); + define(['ApiClient', 'model/Client', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterNumber', 'model/OuterString'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../model/Client')); + module.exports = factory(require('../ApiClient'), require('../model/Client'), require('../model/OuterBoolean'), require('../model/OuterComposite'), require('../model/OuterNumber'), require('../model/OuterString')); } else { // Browser globals (root is window) if (!root.SwaggerPetstore) { root.SwaggerPetstore = {}; } - root.SwaggerPetstore.FakeApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client); + root.SwaggerPetstore.FakeApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client, root.SwaggerPetstore.OuterBoolean, root.SwaggerPetstore.OuterComposite, root.SwaggerPetstore.OuterNumber, root.SwaggerPetstore.OuterString); } -}(this, function(ApiClient, Client) { +}(this, function(ApiClient, Client, OuterBoolean, OuterComposite, OuterNumber, OuterString) { 'use strict'; /** @@ -48,6 +48,178 @@ this.apiClient = apiClient || ApiClient.instance; + /** + * Callback function to receive the result of the fakeOuterBooleanSerialize operation. + * @callback module:api/FakeApi~fakeOuterBooleanSerializeCallback + * @param {String} error Error message, if any. + * @param {module:model/OuterBoolean} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Test serialization of outer boolean types + * @param {Object} opts Optional parameters + * @param {module:model/OuterBoolean} opts.body Input boolean as post body + * @param {module:api/FakeApi~fakeOuterBooleanSerializeCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/OuterBoolean} + */ + this.fakeOuterBooleanSerialize = function(opts, callback) { + opts = opts || {}; + var postBody = opts['body']; + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = []; + var accepts = []; + var returnType = OuterBoolean; + + return this.apiClient.callApi( + '/fake/outer/boolean', 'POST', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + + /** + * Callback function to receive the result of the fakeOuterCompositeSerialize operation. + * @callback module:api/FakeApi~fakeOuterCompositeSerializeCallback + * @param {String} error Error message, if any. + * @param {module:model/OuterComposite} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Test serialization of object with outer number type + * @param {Object} opts Optional parameters + * @param {module:model/OuterComposite} opts.body Input composite as post body + * @param {module:api/FakeApi~fakeOuterCompositeSerializeCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/OuterComposite} + */ + this.fakeOuterCompositeSerialize = function(opts, callback) { + opts = opts || {}; + var postBody = opts['body']; + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = []; + var accepts = []; + var returnType = OuterComposite; + + return this.apiClient.callApi( + '/fake/outer/composite', 'POST', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + + /** + * Callback function to receive the result of the fakeOuterNumberSerialize operation. + * @callback module:api/FakeApi~fakeOuterNumberSerializeCallback + * @param {String} error Error message, if any. + * @param {module:model/OuterNumber} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Test serialization of outer number types + * @param {Object} opts Optional parameters + * @param {module:model/OuterNumber} opts.body Input number as post body + * @param {module:api/FakeApi~fakeOuterNumberSerializeCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/OuterNumber} + */ + this.fakeOuterNumberSerialize = function(opts, callback) { + opts = opts || {}; + var postBody = opts['body']; + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = []; + var accepts = []; + var returnType = OuterNumber; + + return this.apiClient.callApi( + '/fake/outer/number', 'POST', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + + /** + * Callback function to receive the result of the fakeOuterStringSerialize operation. + * @callback module:api/FakeApi~fakeOuterStringSerializeCallback + * @param {String} error Error message, if any. + * @param {module:model/OuterString} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Test serialization of outer string types + * @param {Object} opts Optional parameters + * @param {module:model/OuterString} opts.body Input string as post body + * @param {module:api/FakeApi~fakeOuterStringSerializeCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/OuterString} + */ + this.fakeOuterStringSerialize = function(opts, callback) { + opts = opts || {}; + var postBody = opts['body']; + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = []; + var accepts = []; + var returnType = OuterString; + + return this.apiClient.callApi( + '/fake/outer/string', 'POST', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + /** * Callback function to receive the result of the testClientModel operation. * @callback module:api/FakeApi~testClientModelCallback diff --git a/samples/client/petstore/javascript/src/api/Fake_classname_tags123Api.js b/samples/client/petstore/javascript/src/api/Fake_classname_tags123Api.js index 87caab43ce8..67c002e26c0 100644 --- a/samples/client/petstore/javascript/src/api/Fake_classname_tags123Api.js +++ b/samples/client/petstore/javascript/src/api/Fake_classname_tags123Api.js @@ -7,6 +7,9 @@ * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * * Do not edit the class manually. * */ diff --git a/samples/client/petstore/javascript/src/api/PetApi.js b/samples/client/petstore/javascript/src/api/PetApi.js index 4d76a91c60e..dffd8db2bcb 100644 --- a/samples/client/petstore/javascript/src/api/PetApi.js +++ b/samples/client/petstore/javascript/src/api/PetApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/StoreApi.js b/samples/client/petstore/javascript/src/api/StoreApi.js index b440ba189da..8be29a01f55 100644 --- a/samples/client/petstore/javascript/src/api/StoreApi.js +++ b/samples/client/petstore/javascript/src/api/StoreApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/UserApi.js b/samples/client/petstore/javascript/src/api/UserApi.js index c6cddf8b32a..829b5ea4bc9 100644 --- a/samples/client/petstore/javascript/src/api/UserApi.js +++ b/samples/client/petstore/javascript/src/api/UserApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/index.js b/samples/client/petstore/javascript/src/index.js index 966908ebee0..94648435400 100644 --- a/samples/client/petstore/javascript/src/index.js +++ b/samples/client/petstore/javascript/src/index.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * @@ -17,12 +17,12 @@ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Cat', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterEnum', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'api/FakeApi', 'api/Fake_classname_tags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); + define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Cat', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterEnum', 'model/OuterNumber', 'model/OuterString', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'api/FakeApi', 'api/Fake_classname_tags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Cat'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterEnum'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/FakeApi'), require('./api/Fake_classname_tags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); + module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Cat'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterBoolean'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/OuterNumber'), require('./model/OuterString'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/FakeApi'), require('./api/Fake_classname_tags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); } -}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Cat, Category, ClassModel, Client, Dog, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterEnum, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, FakeApi, Fake_classname_tags123Api, PetApi, StoreApi, UserApi) { +}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Cat, Category, ClassModel, Client, Dog, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterBoolean, OuterComposite, OuterEnum, OuterNumber, OuterString, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, FakeApi, Fake_classname_tags123Api, PetApi, StoreApi, UserApi) { 'use strict'; /** @@ -192,11 +192,31 @@ * @property {module:model/Order} */ Order: Order, + /** + * The OuterBoolean model constructor. + * @property {module:model/OuterBoolean} + */ + OuterBoolean: OuterBoolean, + /** + * The OuterComposite model constructor. + * @property {module:model/OuterComposite} + */ + OuterComposite: OuterComposite, /** * The OuterEnum model constructor. * @property {module:model/OuterEnum} */ OuterEnum: OuterEnum, + /** + * The OuterNumber model constructor. + * @property {module:model/OuterNumber} + */ + OuterNumber: OuterNumber, + /** + * The OuterString model constructor. + * @property {module:model/OuterString} + */ + OuterString: OuterString, /** * The Pet model constructor. * @property {module:model/Pet} diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js index 2744647b18a..4399d89bdc3 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Animal.js b/samples/client/petstore/javascript/src/model/Animal.js index 09119420568..eee2768eeb6 100644 --- a/samples/client/petstore/javascript/src/model/Animal.js +++ b/samples/client/petstore/javascript/src/model/Animal.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AnimalFarm.js b/samples/client/petstore/javascript/src/model/AnimalFarm.js index 891009dab71..b24078dee2a 100644 --- a/samples/client/petstore/javascript/src/model/AnimalFarm.js +++ b/samples/client/petstore/javascript/src/model/AnimalFarm.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ApiResponse.js b/samples/client/petstore/javascript/src/model/ApiResponse.js index 12e9e16275f..9588ce4cf31 100644 --- a/samples/client/petstore/javascript/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript/src/model/ApiResponse.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js index c620c19e667..0b91fc04338 100644 --- a/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js index 66980b9b8d1..f79ab37c076 100644 --- a/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ArrayTest.js b/samples/client/petstore/javascript/src/model/ArrayTest.js index 2fb4ecb6c24..8698b21a153 100644 --- a/samples/client/petstore/javascript/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript/src/model/ArrayTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Capitalization.js b/samples/client/petstore/javascript/src/model/Capitalization.js index 54154d396f8..e4d1cce1e92 100644 --- a/samples/client/petstore/javascript/src/model/Capitalization.js +++ b/samples/client/petstore/javascript/src/model/Capitalization.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Cat.js b/samples/client/petstore/javascript/src/model/Cat.js index 862e7b0c910..55f0a0c9834 100644 --- a/samples/client/petstore/javascript/src/model/Cat.js +++ b/samples/client/petstore/javascript/src/model/Cat.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Category.js b/samples/client/petstore/javascript/src/model/Category.js index d7ecc2207da..37f547c79a1 100644 --- a/samples/client/petstore/javascript/src/model/Category.js +++ b/samples/client/petstore/javascript/src/model/Category.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ClassModel.js b/samples/client/petstore/javascript/src/model/ClassModel.js index c3b7b83f9c5..bd390a22524 100644 --- a/samples/client/petstore/javascript/src/model/ClassModel.js +++ b/samples/client/petstore/javascript/src/model/ClassModel.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Client.js b/samples/client/petstore/javascript/src/model/Client.js index a2912224910..21add8d7f98 100644 --- a/samples/client/petstore/javascript/src/model/Client.js +++ b/samples/client/petstore/javascript/src/model/Client.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Dog.js b/samples/client/petstore/javascript/src/model/Dog.js index 2cd286fb741..f567953b625 100644 --- a/samples/client/petstore/javascript/src/model/Dog.js +++ b/samples/client/petstore/javascript/src/model/Dog.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/EnumArrays.js b/samples/client/petstore/javascript/src/model/EnumArrays.js index 079cfe25084..00036542ba7 100644 --- a/samples/client/petstore/javascript/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript/src/model/EnumArrays.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/EnumClass.js b/samples/client/petstore/javascript/src/model/EnumClass.js index 881a7503047..f03ab350d2f 100644 --- a/samples/client/petstore/javascript/src/model/EnumClass.js +++ b/samples/client/petstore/javascript/src/model/EnumClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/EnumTest.js b/samples/client/petstore/javascript/src/model/EnumTest.js index 215bea59d38..3e7c9311aaf 100644 --- a/samples/client/petstore/javascript/src/model/EnumTest.js +++ b/samples/client/petstore/javascript/src/model/EnumTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/FormatTest.js b/samples/client/petstore/javascript/src/model/FormatTest.js index 238224d0132..9b93b06b7ca 100644 --- a/samples/client/petstore/javascript/src/model/FormatTest.js +++ b/samples/client/petstore/javascript/src/model/FormatTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js index 566e0663de0..17c09dfca7b 100644 --- a/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/List.js b/samples/client/petstore/javascript/src/model/List.js index b5db0490fe4..ce54341bb18 100644 --- a/samples/client/petstore/javascript/src/model/List.js +++ b/samples/client/petstore/javascript/src/model/List.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/MapTest.js b/samples/client/petstore/javascript/src/model/MapTest.js index 59f089976c1..b7d0164b998 100644 --- a/samples/client/petstore/javascript/src/model/MapTest.js +++ b/samples/client/petstore/javascript/src/model/MapTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index 334b0773a04..973ca5a65e2 100644 --- a/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Model200Response.js b/samples/client/petstore/javascript/src/model/Model200Response.js index a10e470be5c..c382f333344 100644 --- a/samples/client/petstore/javascript/src/model/Model200Response.js +++ b/samples/client/petstore/javascript/src/model/Model200Response.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ModelReturn.js b/samples/client/petstore/javascript/src/model/ModelReturn.js index 07467bbaa63..fa5bc9910f8 100644 --- a/samples/client/petstore/javascript/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript/src/model/ModelReturn.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Name.js b/samples/client/petstore/javascript/src/model/Name.js index d79c05387fe..0671311976c 100644 --- a/samples/client/petstore/javascript/src/model/Name.js +++ b/samples/client/petstore/javascript/src/model/Name.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/NumberOnly.js b/samples/client/petstore/javascript/src/model/NumberOnly.js index c5edb0b0a50..d9ee8fcd3ab 100644 --- a/samples/client/petstore/javascript/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript/src/model/NumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Order.js b/samples/client/petstore/javascript/src/model/Order.js index f4f9087001d..f082668517f 100644 --- a/samples/client/petstore/javascript/src/model/Order.js +++ b/samples/client/petstore/javascript/src/model/Order.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/OuterBoolean.js b/samples/client/petstore/javascript/src/model/OuterBoolean.js new file mode 100644 index 00000000000..96b8b11d1bc --- /dev/null +++ b/samples/client/petstore/javascript/src/model/OuterBoolean.js @@ -0,0 +1,74 @@ +/** + * 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 + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.OuterBoolean = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The OuterBoolean model module. + * @module model/OuterBoolean + * @version 1.0.0 + */ + + /** + * Constructs a new OuterBoolean. + * @alias module:model/OuterBoolean + * @class + */ + var exports = function() { + var _this = this; + + }; + + /** + * 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. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + } + return obj; + } + + + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript/src/model/OuterComposite.js b/samples/client/petstore/javascript/src/model/OuterComposite.js new file mode 100644 index 00000000000..14e7775588b --- /dev/null +++ b/samples/client/petstore/javascript/src/model/OuterComposite.js @@ -0,0 +1,98 @@ +/** + * 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 + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/OuterBoolean', 'model/OuterNumber', 'model/OuterString'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('./OuterBoolean'), require('./OuterNumber'), require('./OuterString')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.OuterComposite = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.OuterBoolean, root.SwaggerPetstore.OuterNumber, root.SwaggerPetstore.OuterString); + } +}(this, function(ApiClient, OuterBoolean, OuterNumber, OuterString) { + 'use strict'; + + + + + /** + * The OuterComposite model module. + * @module model/OuterComposite + * @version 1.0.0 + */ + + /** + * Constructs a new OuterComposite. + * @alias module:model/OuterComposite + * @class + */ + var exports = function() { + var _this = 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. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + if (data.hasOwnProperty('my_number')) { + obj['my_number'] = OuterNumber.constructFromObject(data['my_number']); + } + if (data.hasOwnProperty('my_string')) { + obj['my_string'] = OuterString.constructFromObject(data['my_string']); + } + if (data.hasOwnProperty('my_boolean')) { + obj['my_boolean'] = OuterBoolean.constructFromObject(data['my_boolean']); + } + } + return obj; + } + + /** + * @member {module:model/OuterNumber} my_number + */ + exports.prototype['my_number'] = undefined; + /** + * @member {module:model/OuterString} my_string + */ + exports.prototype['my_string'] = undefined; + /** + * @member {module:model/OuterBoolean} my_boolean + */ + exports.prototype['my_boolean'] = undefined; + + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript/src/model/OuterEnum.js b/samples/client/petstore/javascript/src/model/OuterEnum.js index 4ba975cf97a..cdd43098369 100644 --- a/samples/client/petstore/javascript/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript/src/model/OuterEnum.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/OuterNumber.js b/samples/client/petstore/javascript/src/model/OuterNumber.js new file mode 100644 index 00000000000..1128dcb8afe --- /dev/null +++ b/samples/client/petstore/javascript/src/model/OuterNumber.js @@ -0,0 +1,74 @@ +/** + * 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 + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.OuterNumber = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The OuterNumber model module. + * @module model/OuterNumber + * @version 1.0.0 + */ + + /** + * Constructs a new OuterNumber. + * @alias module:model/OuterNumber + * @class + */ + var exports = function() { + var _this = this; + + }; + + /** + * 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. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + } + return obj; + } + + + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript/src/model/OuterString.js b/samples/client/petstore/javascript/src/model/OuterString.js new file mode 100644 index 00000000000..3a012fbb0c9 --- /dev/null +++ b/samples/client/petstore/javascript/src/model/OuterString.js @@ -0,0 +1,74 @@ +/** + * 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 + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.OuterString = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + + + + /** + * The OuterString model module. + * @module model/OuterString + * @version 1.0.0 + */ + + /** + * Constructs a new OuterString. + * @alias module:model/OuterString + * @class + */ + var exports = function() { + var _this = this; + + }; + + /** + * 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. + */ + exports.constructFromObject = function(data, obj) { + if (data) { + obj = obj || new exports(); + + } + return obj; + } + + + + + return exports; +})); + + diff --git a/samples/client/petstore/javascript/src/model/Pet.js b/samples/client/petstore/javascript/src/model/Pet.js index d5e8d5010ac..7edd65724ba 100644 --- a/samples/client/petstore/javascript/src/model/Pet.js +++ b/samples/client/petstore/javascript/src/model/Pet.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js index 91612f15351..f6f0064fd96 100644 --- a/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/SpecialModelName.js b/samples/client/petstore/javascript/src/model/SpecialModelName.js index bb13c09d956..921a1e87379 100644 --- a/samples/client/petstore/javascript/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript/src/model/SpecialModelName.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Tag.js b/samples/client/petstore/javascript/src/model/Tag.js index 1066827e11e..6308751e08f 100644 --- a/samples/client/petstore/javascript/src/model/Tag.js +++ b/samples/client/petstore/javascript/src/model/Tag.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/User.js b/samples/client/petstore/javascript/src/model/User.js index e96af875697..1d251e22b3c 100644 --- a/samples/client/petstore/javascript/src/model/User.js +++ b/samples/client/petstore/javascript/src/model/User.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.2.3-SNAPSHOT + * Swagger Codegen version: 2.3.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/test/model/OuterBoolean.spec.js b/samples/client/petstore/javascript/test/model/OuterBoolean.spec.js new file mode 100644 index 00000000000..d5495a638d8 --- /dev/null +++ b/samples/client/petstore/javascript/test/model/OuterBoolean.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.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/test/model/OuterComposite.spec.js b/samples/client/petstore/javascript/test/model/OuterComposite.spec.js new file mode 100644 index 00000000000..6fd830b7c0e --- /dev/null +++ b/samples/client/petstore/javascript/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/test/model/OuterNumber.spec.js b/samples/client/petstore/javascript/test/model/OuterNumber.spec.js new file mode 100644 index 00000000000..7b0e4ebf119 --- /dev/null +++ b/samples/client/petstore/javascript/test/model/OuterNumber.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.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/test/model/OuterString.spec.js b/samples/client/petstore/javascript/test/model/OuterString.spec.js new file mode 100644 index 00000000000..4e7f99ca88d --- /dev/null +++ b/samples/client/petstore/javascript/test/model/OuterString.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.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/objc/core-data/README.md b/samples/client/petstore/objc/core-data/README.md index aca3b5b6e33..c75a6ea81c6 100644 --- a/samples/client/petstore/objc/core-data/README.md +++ b/samples/client/petstore/objc/core-data/README.md @@ -1,6 +1,6 @@ # SwaggerClient -This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. This ObjC package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: @@ -41,6 +41,7 @@ Import the following: #import #import // load models +#import #import #import #import @@ -69,7 +70,7 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* *body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +SWGPet* *body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; @@ -113,6 +114,7 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [SWGApiResponse](docs/SWGApiResponse.md) - [SWGCategory](docs/SWGCategory.md) - [SWGOrder](docs/SWGOrder.md) - [SWGPet](docs/SWGPet.md) @@ -141,6 +143,6 @@ Class | Method | HTTP request | Description ## Author -apiteam@wordnik.com +apiteam@swagger.io diff --git a/samples/client/petstore/objc/core-data/SwaggerClient.podspec b/samples/client/petstore/objc/core-data/SwaggerClient.podspec index d00714358b1..d5562712293 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient.podspec +++ b/samples/client/petstore/objc/core-data/SwaggerClient.podspec @@ -13,7 +13,7 @@ Pod::Spec.new do |s| s.summary = "Swagger Petstore" s.description = <<-DESC - This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. DESC s.platform = :ios, '7.0' diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h index 74ba6e6b482..f1896f51e64 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h @@ -1,13 +1,14 @@ #import +#import "SWGApiResponse.h" #import "SWGPet.h" #import "SWGApi.h" /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -26,7 +27,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Add a new pet to the store /// /// -/// @param body Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store /// /// code:405 message:"Invalid input" /// @@ -52,7 +53,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Finds Pets by status /// Multiple status values can be provided with comma separated strings /// -/// @param status Status values that need to be considered for filter (optional) (default to available) +/// @param status Status values that need to be considered for filter /// /// code:200 message:"successful operation", /// code:400 message:"Invalid status value" @@ -65,7 +66,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Finds Pets by tags /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// -/// @param tags Tags to filter by (optional) +/// @param tags Tags to filter by /// /// code:200 message:"successful operation", /// code:400 message:"Invalid tag value" @@ -76,9 +77,9 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Find pet by ID -/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions +/// Returns a single pet /// -/// @param petId ID of pet that needs to be fetched +/// @param petId ID of pet to return /// /// code:200 message:"successful operation", /// code:400 message:"Invalid ID supplied", @@ -92,7 +93,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Update an existing pet /// /// -/// @param body Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store /// /// code:400 message:"Invalid ID supplied", /// code:404 message:"Pet not found", @@ -113,7 +114,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:405 message:"Invalid input" /// /// @return --(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSNumber*) petId name: (NSString*) name status: (NSString*) status completionHandler: (void (^)(NSError* error)) handler; @@ -126,13 +127,13 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// @param additionalMetadata Additional data to pass to server (optional) /// @param file file to upload (optional) /// -/// code:0 message:"successful operation" +/// code:200 message:"successful operation" /// -/// @return +/// @return SWGApiResponse* -(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (NSURL*) file - completionHandler: (void (^)(NSError* error)) handler; + completionHandler: (void (^)(SWGApiResponse* output, NSError* error)) handler; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m index 36a2a6d700a..9d4b64f9326 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m @@ -1,6 +1,7 @@ #import "SWGPetApi.h" #import "SWGQueryParamCollection.h" #import "SWGApiClient.h" +#import "SWGApiResponse.h" #import "SWGPet.h" @@ -52,12 +53,23 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Add a new pet to the store /// -/// @param body Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store /// /// @returns void /// -(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'body' is set + if (body == nil) { + NSParameterAssert(body); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"body"] }; + NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; @@ -66,7 +78,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -141,7 +153,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; headerParams[@"api_key"] = apiKey; } // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -181,25 +193,36 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Finds Pets by status /// Multiple status values can be provided with comma separated strings -/// @param status Status values that need to be considered for filter (optional, default to available) +/// @param status Status values that need to be considered for filter /// /// @returns NSArray* /// -(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status completionHandler: (void (^)(NSArray* output, NSError* error)) handler { + // verify the required parameter 'status' is set + if (status == nil) { + NSParameterAssert(status); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"status"] }; + NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (status != nil) { - queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; + queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"csv"]; } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -239,25 +262,36 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Finds Pets by tags /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -/// @param tags Tags to filter by (optional) +/// @param tags Tags to filter by /// /// @returns NSArray* /// -(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags completionHandler: (void (^)(NSArray* output, NSError* error)) handler { + // verify the required parameter 'tags' is set + if (tags == nil) { + NSParameterAssert(tags); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"tags"] }; + NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (tags != nil) { - queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; + queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"csv"]; } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -296,8 +330,8 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Find pet by ID -/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions -/// @param petId ID of pet that needs to be fetched +/// Returns a single pet +/// @param petId ID of pet to return /// /// @returns SWGPet* /// @@ -325,7 +359,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -337,7 +371,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; // Authentication setting - NSArray *authSettings = @[@"petstore_auth", @"api_key"]; + NSArray *authSettings = @[@"api_key"]; id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; @@ -365,12 +399,23 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Update an existing pet /// -/// @param body Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store /// /// @returns void /// -(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'body' is set + if (body == nil) { + NSParameterAssert(body); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"body"] }; + NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; @@ -379,7 +424,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -428,7 +473,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSNumber*) petId name: (NSString*) name status: (NSString*) status completionHandler: (void (^)(NSError* error)) handler { @@ -454,7 +499,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -506,19 +551,19 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @param file file to upload (optional) /// -/// @returns void +/// @returns SWGApiResponse* /// -(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (NSURL*) file - completionHandler: (void (^)(NSError* error)) handler { + completionHandler: (void (^)(SWGApiResponse* output, NSError* error)) handler { // verify the required parameter 'petId' is set if (petId == nil) { NSParameterAssert(petId); if(handler) { NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; - handler(error); + handler(nil, error); } return nil; } @@ -534,7 +579,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -567,10 +612,10 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; authSettings: authSettings requestContentType: requestContentType responseContentType: responseContentType - responseType: nil + responseType: @"SWGApiResponse*" completionBlock: ^(id data, NSError *error) { if(handler) { - handler(error); + handler((SWGApiResponse*)data, error); } }]; } diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h index 6cfc765cd0b..37253c8670e 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h @@ -4,10 +4,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -57,14 +57,14 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// code:404 message:"Order not found" /// /// @return SWGOrder* --(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSNumber*) orderId completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; /// Place an order for a pet /// /// -/// @param body order placed for purchasing the pet (optional) +/// @param body order placed for purchasing the pet /// /// code:200 message:"successful operation", /// code:400 message:"Invalid Order" diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m index ebf27ab982a..1e13dc5c6ab 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m @@ -80,7 +80,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -132,7 +132,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -176,7 +176,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// @returns SWGOrder* /// --(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSNumber*) orderId completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { // verify the required parameter 'orderId' is set if (orderId == nil) { @@ -200,7 +200,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -240,12 +240,23 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// Place an order for a pet /// -/// @param body order placed for purchasing the pet (optional) +/// @param body order placed for purchasing the pet /// /// @returns SWGOrder* /// -(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { + // verify the required parameter 'body' is set + if (body == nil) { + NSParameterAssert(body); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"body"] }; + NSError* error = [NSError errorWithDomain:kSWGStoreApiErrorDomain code:kSWGStoreApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; @@ -254,7 +265,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h index 9695c16918b..e900073dfb0 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h @@ -4,10 +4,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -26,7 +26,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// Create user /// This can only be done by the logged in user. /// -/// @param body Created user object (optional) +/// @param body Created user object /// /// code:0 message:"successful operation" /// @@ -38,7 +38,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// Creates list of users with given input array /// /// -/// @param body List of user object (optional) +/// @param body List of user object /// /// code:0 message:"successful operation" /// @@ -50,7 +50,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// Creates list of users with given input array /// /// -/// @param body List of user object (optional) +/// @param body List of user object /// /// code:0 message:"successful operation" /// @@ -89,8 +89,8 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// Logs user into the system /// /// -/// @param username The user name for login (optional) -/// @param password The password for login in clear text (optional) +/// @param username The user name for login +/// @param password The password for login in clear text /// /// code:200 message:"successful operation", /// code:400 message:"Invalid username/password supplied" @@ -116,7 +116,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// This can only be done by the logged in user. /// /// @param username name that need to be deleted -/// @param body Updated user object (optional) +/// @param body Updated user object /// /// code:400 message:"Invalid user supplied", /// code:404 message:"User not found" diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m index 2a1c4ecda81..5531b82753f 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m @@ -52,12 +52,23 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Create user /// This can only be done by the logged in user. -/// @param body Created user object (optional) +/// @param body Created user object /// /// @returns void /// -(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'body' is set + if (body == nil) { + NSParameterAssert(body); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"body"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; @@ -66,7 +77,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -107,12 +118,23 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Creates list of users with given input array /// -/// @param body List of user object (optional) +/// @param body List of user object /// /// @returns void /// -(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'body' is set + if (body == nil) { + NSParameterAssert(body); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"body"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; @@ -121,7 +143,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -162,12 +184,23 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Creates list of users with given input array /// -/// @param body List of user object (optional) +/// @param body List of user object /// /// @returns void /// -(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'body' is set + if (body == nil) { + NSParameterAssert(body); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"body"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; @@ -176,7 +209,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -245,7 +278,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -313,7 +346,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -353,15 +386,37 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Logs user into the system /// -/// @param username The user name for login (optional) +/// @param username The user name for login /// -/// @param password The password for login in clear text (optional) +/// @param password The password for login in clear text /// /// @returns NSString* /// -(NSURLSessionTask*) loginUserWithUsername: (NSString*) username password: (NSString*) password completionHandler: (void (^)(NSString* output, NSError* error)) handler { + // verify the required parameter 'username' is set + if (username == nil) { + NSParameterAssert(username); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + // verify the required parameter 'password' is set + if (password == nil) { + NSParameterAssert(password); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"password"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/login"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; @@ -376,7 +431,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -428,7 +483,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -470,7 +525,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// This can only be done by the logged in user. /// @param username name that need to be deleted /// -/// @param body Updated user object (optional) +/// @param body Updated user object /// /// @returns void /// @@ -488,6 +543,17 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; return nil; } + // verify the required parameter 'body' is set + if (body == nil) { + NSParameterAssert(body); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"body"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; @@ -499,7 +565,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h index d5b3e9291bc..8b9ab6bf212 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h index bdc690332f5..323071de751 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h @@ -4,10 +4,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h index 099fb88c335..8b9b15565c7 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h @@ -5,10 +5,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h index 195b8192494..43928456399 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h @@ -4,10 +4,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h index d3e02965656..c8d135e4937 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h index 6307790a23b..a4da92a9229 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h index 40c11c52c0d..95e682a725c 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h @@ -2,10 +2,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h index 1cfb88daf0b..f1dbdf78449 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h index 72a14a6e68b..005c11beb9a 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h @@ -2,10 +2,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h index 3ee3c90569c..038662649d4 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h @@ -2,10 +2,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h index 28e84d83714..5352cf0e250 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h @@ -2,10 +2,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponse.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponse.h new file mode 100644 index 00000000000..1b2aa67b316 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponse.h @@ -0,0 +1,31 @@ +#import +#import "SWGObject.h" + +/** +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. +* +* 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. +*/ + + + + +@protocol SWGApiResponse +@end + +@interface SWGApiResponse : SWGObject + + +@property(nonatomic) NSNumber* code; + +@property(nonatomic) NSString* type; + +@property(nonatomic) NSString* message; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponse.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponse.m new file mode 100644 index 00000000000..cfa8aa1eb20 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponse.m @@ -0,0 +1,34 @@ +#import "SWGApiResponse.h" + +@implementation SWGApiResponse + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"code": @"code", @"type": @"type", @"message": @"message" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"code", @"type", @"message"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponseManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponseManagedObject.h new file mode 100644 index 00000000000..4eeba6cb416 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponseManagedObject.h @@ -0,0 +1,36 @@ +#import +#import + +/** +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. +* +* 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. +*/ + + + + +NS_ASSUME_NONNULL_BEGIN + +@interface SWGApiResponseManagedObject : NSManagedObject + + +@property (nullable, nonatomic, retain) NSNumber* code; + +@property (nullable, nonatomic, retain) NSString* type; + +@property (nullable, nonatomic, retain) NSString* message; +@end + +@interface SWGApiResponseManagedObject (GeneratedAccessors) + +@end + + +NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponseManagedObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponseManagedObject.m new file mode 100644 index 00000000000..037aaa68561 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponseManagedObject.m @@ -0,0 +1,13 @@ +#import "SWGApiResponseManagedObject.h" + +/** +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen +* Do not edit the class manually. +*/ +@implementation SWGApiResponseManagedObject + +@dynamic code; +@dynamic type; +@dynamic message; +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponseManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponseManagedObjectBuilder.h new file mode 100644 index 00000000000..82fc07dc0da --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponseManagedObjectBuilder.h @@ -0,0 +1,35 @@ +#import +#import + + +#import "SWGApiResponseManagedObject.h" +#import "SWGApiResponse.h" + +/** +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. +* +* 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. +*/ + + +@interface SWGApiResponseManagedObjectBuilder : NSObject + + + +-(SWGApiResponseManagedObject*)createNewSWGApiResponseManagedObjectInContext:(NSManagedObjectContext*)context; + +-(SWGApiResponseManagedObject*)SWGApiResponseManagedObjectFromSWGApiResponse:(SWGApiResponse*)object context:(NSManagedObjectContext*)context; + +-(void)updateSWGApiResponseManagedObject:(SWGApiResponseManagedObject*)object withSWGApiResponse:(SWGApiResponse*)object2; + +-(SWGApiResponse*)SWGApiResponseFromSWGApiResponseManagedObject:(SWGApiResponseManagedObject*)obj; + +-(void)updateSWGApiResponse:(SWGApiResponse*)object withSWGApiResponseManagedObject:(SWGApiResponseManagedObject*)object2; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponseManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponseManagedObjectBuilder.m new file mode 100644 index 00000000000..3a3c1b9148b --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGApiResponseManagedObjectBuilder.m @@ -0,0 +1,56 @@ + + +#import "SWGApiResponseManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by the swagger code generator program. +* https://github.com/swagger-api/swagger-codegen +* Do not edit the class manually. +*/ + +@implementation SWGApiResponseManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(SWGApiResponseManagedObject*)createNewSWGApiResponseManagedObjectInContext:(NSManagedObjectContext*)context { + SWGApiResponseManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGApiResponseManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(SWGApiResponseManagedObject*)SWGApiResponseManagedObjectFromSWGApiResponse:(SWGApiResponse*)object context:(NSManagedObjectContext*)context { + SWGApiResponseManagedObject* newSWGApiResponse = [self createNewSWGApiResponseManagedObjectInContext:context]; + [self updateSWGApiResponseManagedObject:newSWGApiResponse withSWGApiResponse:object]; + return newSWGApiResponse; +} + +-(void)updateSWGApiResponseManagedObject:(SWGApiResponseManagedObject*)managedObject withSWGApiResponse:(SWGApiResponse*)object { + if(!managedObject || !object) { + return; + } + managedObject.code = [object.code copy]; + managedObject.type = [object.type copy]; + managedObject.message = [object.message copy]; + +} + +-(SWGApiResponse*)SWGApiResponseFromSWGApiResponseManagedObject:(SWGApiResponseManagedObject*)obj { + if(!obj) { + return nil; + } + SWGApiResponse* newSWGApiResponse = [[SWGApiResponse alloc] init]; + [self updateSWGApiResponse:newSWGApiResponse withSWGApiResponseManagedObject:obj]; + return newSWGApiResponse; +} + +-(void)updateSWGApiResponse:(SWGApiResponse*)newSWGApiResponse withSWGApiResponseManagedObject:(SWGApiResponseManagedObject*)obj { + newSWGApiResponse.code = [obj.code copy]; + newSWGApiResponse.type = [obj.type copy]; + newSWGApiResponse.message = [obj.message copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h index aba4f712480..67cb616c743 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h index 07b9a6a3544..c9f0b0ba8b3 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h index 2b2bf631551..28285c79518 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h @@ -7,10 +7,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents index 4ec7a3b456b..8343cf3adfd 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents @@ -1,6 +1,11 @@ + + + + + diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h index d8a48516b78..e297ef31bd4 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.m index 7f93b0212c4..d6cb03ff9d1 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.m @@ -6,6 +6,7 @@ self = [super init]; if (self) { // initialize property's default value, if any + self.complete = @0; } return self; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h index 99d6149fb35..4f1b5960837 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h index 54233ce98b7..591210912ac 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h @@ -7,10 +7,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h index 0db2ead28dc..987a036f800 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h index 8e7564d2248..90945d25095 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h index 350924cfa2a..25b662ffb72 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h @@ -9,10 +9,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h index 05844b7438e..51ddb08e71a 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h index f6724495b37..e5698033caf 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h index 04d9a0a13e9..cc168147339 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h @@ -7,10 +7,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h index 4db4b03f1b4..59f3d0cfc48 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h index 75b8f477d48..f16dc5f8f13 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h index 23d83e0e603..2b87b847efb 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h @@ -7,10 +7,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/README.md b/samples/client/petstore/objc/default/README.md index aca3b5b6e33..c75a6ea81c6 100644 --- a/samples/client/petstore/objc/default/README.md +++ b/samples/client/petstore/objc/default/README.md @@ -1,6 +1,6 @@ # SwaggerClient -This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. This ObjC package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: @@ -41,6 +41,7 @@ Import the following: #import #import // load models +#import #import #import #import @@ -69,7 +70,7 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* *body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +SWGPet* *body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; @@ -113,6 +114,7 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [SWGApiResponse](docs/SWGApiResponse.md) - [SWGCategory](docs/SWGCategory.md) - [SWGOrder](docs/SWGOrder.md) - [SWGPet](docs/SWGPet.md) @@ -141,6 +143,6 @@ Class | Method | HTTP request | Description ## Author -apiteam@wordnik.com +apiteam@swagger.io diff --git a/samples/client/petstore/objc/default/SwaggerClient.podspec b/samples/client/petstore/objc/default/SwaggerClient.podspec index e43cdfd5a09..b9f04f810be 100644 --- a/samples/client/petstore/objc/default/SwaggerClient.podspec +++ b/samples/client/petstore/objc/default/SwaggerClient.podspec @@ -13,7 +13,7 @@ Pod::Spec.new do |s| s.summary = "Swagger Petstore" s.description = <<-DESC - This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. DESC s.platform = :ios, '7.0' diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h index 74ba6e6b482..f1896f51e64 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h @@ -1,13 +1,14 @@ #import +#import "SWGApiResponse.h" #import "SWGPet.h" #import "SWGApi.h" /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -26,7 +27,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Add a new pet to the store /// /// -/// @param body Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store /// /// code:405 message:"Invalid input" /// @@ -52,7 +53,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Finds Pets by status /// Multiple status values can be provided with comma separated strings /// -/// @param status Status values that need to be considered for filter (optional) (default to available) +/// @param status Status values that need to be considered for filter /// /// code:200 message:"successful operation", /// code:400 message:"Invalid status value" @@ -65,7 +66,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Finds Pets by tags /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// -/// @param tags Tags to filter by (optional) +/// @param tags Tags to filter by /// /// code:200 message:"successful operation", /// code:400 message:"Invalid tag value" @@ -76,9 +77,9 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Find pet by ID -/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions +/// Returns a single pet /// -/// @param petId ID of pet that needs to be fetched +/// @param petId ID of pet to return /// /// code:200 message:"successful operation", /// code:400 message:"Invalid ID supplied", @@ -92,7 +93,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Update an existing pet /// /// -/// @param body Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store /// /// code:400 message:"Invalid ID supplied", /// code:404 message:"Pet not found", @@ -113,7 +114,7 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// code:405 message:"Invalid input" /// /// @return --(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSNumber*) petId name: (NSString*) name status: (NSString*) status completionHandler: (void (^)(NSError* error)) handler; @@ -126,13 +127,13 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// @param additionalMetadata Additional data to pass to server (optional) /// @param file file to upload (optional) /// -/// code:0 message:"successful operation" +/// code:200 message:"successful operation" /// -/// @return +/// @return SWGApiResponse* -(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (NSURL*) file - completionHandler: (void (^)(NSError* error)) handler; + completionHandler: (void (^)(SWGApiResponse* output, NSError* error)) handler; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m index 36a2a6d700a..9d4b64f9326 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m @@ -1,6 +1,7 @@ #import "SWGPetApi.h" #import "SWGQueryParamCollection.h" #import "SWGApiClient.h" +#import "SWGApiResponse.h" #import "SWGPet.h" @@ -52,12 +53,23 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Add a new pet to the store /// -/// @param body Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store /// /// @returns void /// -(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'body' is set + if (body == nil) { + NSParameterAssert(body); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"body"] }; + NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; @@ -66,7 +78,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -141,7 +153,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; headerParams[@"api_key"] = apiKey; } // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -181,25 +193,36 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Finds Pets by status /// Multiple status values can be provided with comma separated strings -/// @param status Status values that need to be considered for filter (optional, default to available) +/// @param status Status values that need to be considered for filter /// /// @returns NSArray* /// -(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status completionHandler: (void (^)(NSArray* output, NSError* error)) handler { + // verify the required parameter 'status' is set + if (status == nil) { + NSParameterAssert(status); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"status"] }; + NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (status != nil) { - queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; + queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"csv"]; } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -239,25 +262,36 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Finds Pets by tags /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -/// @param tags Tags to filter by (optional) +/// @param tags Tags to filter by /// /// @returns NSArray* /// -(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags completionHandler: (void (^)(NSArray* output, NSError* error)) handler { + // verify the required parameter 'tags' is set + if (tags == nil) { + NSParameterAssert(tags); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"tags"] }; + NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (tags != nil) { - queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; + queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"csv"]; } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -296,8 +330,8 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Find pet by ID -/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions -/// @param petId ID of pet that needs to be fetched +/// Returns a single pet +/// @param petId ID of pet to return /// /// @returns SWGPet* /// @@ -325,7 +359,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -337,7 +371,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; // Authentication setting - NSArray *authSettings = @[@"petstore_auth", @"api_key"]; + NSArray *authSettings = @[@"api_key"]; id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; @@ -365,12 +399,23 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// Update an existing pet /// -/// @param body Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store /// /// @returns void /// -(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'body' is set + if (body == nil) { + NSParameterAssert(body); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"body"] }; + NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; @@ -379,7 +424,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -428,7 +473,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @returns void /// --(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSNumber*) petId name: (NSString*) name status: (NSString*) status completionHandler: (void (^)(NSError* error)) handler { @@ -454,7 +499,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -506,19 +551,19 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; /// /// @param file file to upload (optional) /// -/// @returns void +/// @returns SWGApiResponse* /// -(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (NSURL*) file - completionHandler: (void (^)(NSError* error)) handler { + completionHandler: (void (^)(SWGApiResponse* output, NSError* error)) handler { // verify the required parameter 'petId' is set if (petId == nil) { NSParameterAssert(petId); if(handler) { NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; - handler(error); + handler(nil, error); } return nil; } @@ -534,7 +579,7 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -567,10 +612,10 @@ NSInteger kSWGPetApiMissingParamErrorCode = 234513; authSettings: authSettings requestContentType: requestContentType responseContentType: responseContentType - responseType: nil + responseType: @"SWGApiResponse*" completionBlock: ^(id data, NSError *error) { if(handler) { - handler(error); + handler((SWGApiResponse*)data, error); } }]; } diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h index 6cfc765cd0b..37253c8670e 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h @@ -4,10 +4,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -57,14 +57,14 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// code:404 message:"Order not found" /// /// @return SWGOrder* --(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSNumber*) orderId completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; /// Place an order for a pet /// /// -/// @param body order placed for purchasing the pet (optional) +/// @param body order placed for purchasing the pet /// /// code:200 message:"successful operation", /// code:400 message:"Invalid Order" diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m index ebf27ab982a..1e13dc5c6ab 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m @@ -80,7 +80,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -132,7 +132,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -176,7 +176,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// @returns SWGOrder* /// --(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSNumber*) orderId completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { // verify the required parameter 'orderId' is set if (orderId == nil) { @@ -200,7 +200,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -240,12 +240,23 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; /// /// Place an order for a pet /// -/// @param body order placed for purchasing the pet (optional) +/// @param body order placed for purchasing the pet /// /// @returns SWGOrder* /// -(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { + // verify the required parameter 'body' is set + if (body == nil) { + NSParameterAssert(body); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"body"] }; + NSError* error = [NSError errorWithDomain:kSWGStoreApiErrorDomain code:kSWGStoreApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; @@ -254,7 +265,7 @@ NSInteger kSWGStoreApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h index 9695c16918b..e900073dfb0 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h @@ -4,10 +4,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -26,7 +26,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// Create user /// This can only be done by the logged in user. /// -/// @param body Created user object (optional) +/// @param body Created user object /// /// code:0 message:"successful operation" /// @@ -38,7 +38,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// Creates list of users with given input array /// /// -/// @param body List of user object (optional) +/// @param body List of user object /// /// code:0 message:"successful operation" /// @@ -50,7 +50,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// Creates list of users with given input array /// /// -/// @param body List of user object (optional) +/// @param body List of user object /// /// code:0 message:"successful operation" /// @@ -89,8 +89,8 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// Logs user into the system /// /// -/// @param username The user name for login (optional) -/// @param password The password for login in clear text (optional) +/// @param username The user name for login +/// @param password The password for login in clear text /// /// code:200 message:"successful operation", /// code:400 message:"Invalid username/password supplied" @@ -116,7 +116,7 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// This can only be done by the logged in user. /// /// @param username name that need to be deleted -/// @param body Updated user object (optional) +/// @param body Updated user object /// /// code:400 message:"Invalid user supplied", /// code:404 message:"User not found" diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m index 2a1c4ecda81..5531b82753f 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m @@ -52,12 +52,23 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Create user /// This can only be done by the logged in user. -/// @param body Created user object (optional) +/// @param body Created user object /// /// @returns void /// -(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'body' is set + if (body == nil) { + NSParameterAssert(body); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"body"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; @@ -66,7 +77,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -107,12 +118,23 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Creates list of users with given input array /// -/// @param body List of user object (optional) +/// @param body List of user object /// /// @returns void /// -(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'body' is set + if (body == nil) { + NSParameterAssert(body); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"body"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; @@ -121,7 +143,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -162,12 +184,23 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Creates list of users with given input array /// -/// @param body List of user object (optional) +/// @param body List of user object /// /// @returns void /// -(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'body' is set + if (body == nil) { + NSParameterAssert(body); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"body"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; @@ -176,7 +209,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -245,7 +278,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -313,7 +346,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -353,15 +386,37 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// /// Logs user into the system /// -/// @param username The user name for login (optional) +/// @param username The user name for login /// -/// @param password The password for login in clear text (optional) +/// @param password The password for login in clear text /// /// @returns NSString* /// -(NSURLSessionTask*) loginUserWithUsername: (NSString*) username password: (NSString*) password completionHandler: (void (^)(NSString* output, NSError* error)) handler { + // verify the required parameter 'username' is set + if (username == nil) { + NSParameterAssert(username); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + // verify the required parameter 'password' is set + if (password == nil) { + NSParameterAssert(password); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"password"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/login"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; @@ -376,7 +431,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -428,7 +483,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } @@ -470,7 +525,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; /// This can only be done by the logged in user. /// @param username name that need to be deleted /// -/// @param body Updated user object (optional) +/// @param body Updated user object /// /// @returns void /// @@ -488,6 +543,17 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; return nil; } + // verify the required parameter 'body' is set + if (body == nil) { + NSParameterAssert(body); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"body"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; @@ -499,7 +565,7 @@ NSInteger kSWGUserApiMissingParamErrorCode = 234513; NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/xml", @"application/json"]]; if(acceptHeader.length > 0) { headerParams[@"Accept"] = acceptHeader; } diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h index d5b3e9291bc..8b9ab6bf212 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h index bdc690332f5..323071de751 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h @@ -4,10 +4,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h index 099fb88c335..8b9b15565c7 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h @@ -5,10 +5,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h index 195b8192494..43928456399 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h @@ -4,10 +4,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h index d3e02965656..c8d135e4937 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h index 6307790a23b..a4da92a9229 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h index 40c11c52c0d..95e682a725c 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h @@ -2,10 +2,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h index 1cfb88daf0b..f1dbdf78449 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h index 72a14a6e68b..005c11beb9a 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h @@ -2,10 +2,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h index 3ee3c90569c..038662649d4 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h @@ -2,10 +2,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h index 28e84d83714..5352cf0e250 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h @@ -2,10 +2,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGApiResponse.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGApiResponse.h new file mode 100644 index 00000000000..1b2aa67b316 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGApiResponse.h @@ -0,0 +1,31 @@ +#import +#import "SWGObject.h" + +/** +* Swagger Petstore +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. +* +* 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. +*/ + + + + +@protocol SWGApiResponse +@end + +@interface SWGApiResponse : SWGObject + + +@property(nonatomic) NSNumber* code; + +@property(nonatomic) NSString* type; + +@property(nonatomic) NSString* message; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGApiResponse.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGApiResponse.m new file mode 100644 index 00000000000..cfa8aa1eb20 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGApiResponse.m @@ -0,0 +1,34 @@ +#import "SWGApiResponse.h" + +@implementation SWGApiResponse + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"code": @"code", @"type": @"type", @"message": @"message" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"code", @"type", @"message"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h index aba4f712480..67cb616c743 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h index d8a48516b78..e297ef31bd4 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.m index 7f93b0212c4..d6cb03ff9d1 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.m @@ -6,6 +6,7 @@ self = [super init]; if (self) { // initialize property's default value, if any + self.complete = @0; } return self; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h index 0db2ead28dc..987a036f800 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h index 05844b7438e..51ddb08e71a 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h index 4db4b03f1b4..59f3d0cfc48 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h @@ -3,10 +3,10 @@ /** * Swagger Petstore -* This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 -* Contact: apiteam@wordnik.com +* Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git diff --git a/samples/client/petstore/objc/default/docs/SWGApiResponse.md b/samples/client/petstore/objc/default/docs/SWGApiResponse.md new file mode 100644 index 00000000000..88ff755faf7 --- /dev/null +++ b/samples/client/petstore/objc/default/docs/SWGApiResponse.md @@ -0,0 +1,12 @@ +# SWGApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **NSNumber*** | | [optional] +**type** | **NSString*** | | [optional] +**message** | **NSString*** | | [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/objc/default/docs/SWGOrder.md b/samples/client/petstore/objc/default/docs/SWGOrder.md index b2a9f25eae9..46afb0cd41c 100644 --- a/samples/client/petstore/objc/default/docs/SWGOrder.md +++ b/samples/client/petstore/objc/default/docs/SWGOrder.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **quantity** | **NSNumber*** | | [optional] **shipDate** | **NSDate*** | | [optional] **status** | **NSString*** | Order Status | [optional] -**complete** | **NSNumber*** | | [optional] +**complete** | **NSNumber*** | | [optional] [default to @0] [[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/objc/default/docs/SWGPetApi.md b/samples/client/petstore/objc/default/docs/SWGPetApi.md index 48048c3816e..776b50c5bde 100644 --- a/samples/client/petstore/objc/default/docs/SWGPetApi.md +++ b/samples/client/petstore/objc/default/docs/SWGPetApi.md @@ -32,7 +32,7 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +SWGPet* body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; @@ -49,7 +49,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**SWGPet***](SWGPet*.md)| Pet object that needs to be added to the store | [optional] + **body** | [**SWGPet***](SWGPet*.md)| Pet object that needs to be added to the store | ### Return type @@ -62,7 +62,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -118,7 +118,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -140,7 +140,7 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -NSArray* status = @[@"available"]; // Status values that need to be considered for filter (optional) (default to available) +NSArray* status = @[@"status_example"]; // Status values that need to be considered for filter SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; @@ -160,7 +160,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**NSArray<NSString*>***](NSString*.md)| Status values that need to be considered for filter | [optional] [default to available] + **status** | [**NSArray<NSString*>***](NSString*.md)| Status values that need to be considered for filter | ### Return type @@ -173,7 +173,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -195,7 +195,7 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -NSArray* tags = @[@"tags_example"]; // Tags to filter by (optional) +NSArray* tags = @[@"tags_example"]; // Tags to filter by SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; @@ -215,7 +215,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**NSArray<NSString*>***](NSString*.md)| Tags to filter by | [optional] + **tags** | [**NSArray<NSString*>***](NSString*.md)| Tags to filter by | ### Return type @@ -228,7 +228,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -240,22 +240,19 @@ Name | Type | Description | Notes Find pet by ID -Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions +Returns a single pet ### Example ```objc SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - // Configure API key authorization: (authentication scheme: api_key) [apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed //[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; -NSNumber* petId = @789; // ID of pet that needs to be fetched +NSNumber* petId = @789; // ID of pet to return SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; @@ -275,7 +272,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **NSNumber***| ID of pet that needs to be fetched | + **petId** | **NSNumber***| ID of pet to return | ### Return type @@ -283,12 +280,12 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key) +[api_key](../README.md#api_key) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -310,7 +307,7 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +SWGPet* body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; @@ -327,7 +324,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**SWGPet***](SWGPet*.md)| Pet object that needs to be added to the store | [optional] + **body** | [**SWGPet***](SWGPet*.md)| Pet object that needs to be added to the store | ### Return type @@ -340,13 +337,13 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **updatePetWithForm** ```objc --(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSNumber*) petId name: (NSString*) name status: (NSString*) status completionHandler: (void (^)(NSError* error)) handler; @@ -364,7 +361,7 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -NSString* petId = @"petId_example"; // ID of pet that needs to be updated +NSNumber* petId = @789; // ID of pet that needs to be updated NSString* name = @"name_example"; // Updated name of the pet (optional) NSString* status = @"status_example"; // Updated status of the pet (optional) @@ -385,7 +382,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **NSString***| ID of pet that needs to be updated | + **petId** | **NSNumber***| ID of pet that needs to be updated | **name** | **NSString***| Updated name of the pet | [optional] **status** | **NSString***| Updated status of the pet | [optional] @@ -400,7 +397,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -409,7 +406,7 @@ void (empty response body) -(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId additionalMetadata: (NSString*) additionalMetadata file: (NSURL*) file - completionHandler: (void (^)(NSError* error)) handler; + completionHandler: (void (^)(SWGApiResponse* output, NSError* error)) handler; ``` uploads an image @@ -434,7 +431,10 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; [apiInstance uploadFileWithPetId:petId additionalMetadata:additionalMetadata file:file - completionHandler: ^(NSError* error) { + completionHandler: ^(SWGApiResponse* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } if (error) { NSLog(@"Error calling SWGPetApi->uploadFile: %@", error); } @@ -451,7 +451,7 @@ Name | Type | Description | Notes ### Return type -void (empty response body) +[**SWGApiResponse***](SWGApiResponse.md) ### Authorization @@ -460,7 +460,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: multipart/form-data - - **Accept**: application/json, application/xml + - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/objc/default/docs/SWGStoreApi.md b/samples/client/petstore/objc/default/docs/SWGStoreApi.md index 3124b5c6458..9cdb439205e 100644 --- a/samples/client/petstore/objc/default/docs/SWGStoreApi.md +++ b/samples/client/petstore/objc/default/docs/SWGStoreApi.md @@ -53,7 +53,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -106,13 +106,13 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getOrderById** ```objc --(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSNumber*) orderId completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; ``` @@ -123,7 +123,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```objc -NSString* orderId = @"orderId_example"; // ID of pet that needs to be fetched +NSNumber* orderId = @789; // ID of pet that needs to be fetched SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; @@ -143,7 +143,7 @@ SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **NSString***| ID of pet that needs to be fetched | + **orderId** | **NSNumber***| ID of pet that needs to be fetched | ### Return type @@ -156,7 +156,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -173,7 +173,7 @@ Place an order for a pet ### Example ```objc -SWGOrder* body = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional) +SWGOrder* body = [[SWGOrder alloc] init]; // order placed for purchasing the pet SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; @@ -193,7 +193,7 @@ SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**SWGOrder***](SWGOrder*.md)| order placed for purchasing the pet | [optional] + **body** | [**SWGOrder***](SWGOrder*.md)| order placed for purchasing the pet | ### Return type @@ -206,7 +206,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/objc/default/docs/SWGUserApi.md b/samples/client/petstore/objc/default/docs/SWGUserApi.md index bffba171129..93ea65fe5be 100644 --- a/samples/client/petstore/objc/default/docs/SWGUserApi.md +++ b/samples/client/petstore/objc/default/docs/SWGUserApi.md @@ -27,7 +27,7 @@ This can only be done by the logged in user. ### Example ```objc -SWGUser* body = [[SWGUser alloc] init]; // Created user object (optional) +SWGUser* body = [[SWGUser alloc] init]; // Created user object SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; @@ -44,7 +44,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**SWGUser***](SWGUser*.md)| Created user object | [optional] + **body** | [**SWGUser***](SWGUser*.md)| Created user object | ### Return type @@ -57,7 +57,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -74,7 +74,7 @@ Creates list of users with given input array ### Example ```objc -NSArray* body = @[[[SWGUser alloc] init]]; // List of user object (optional) +NSArray* body = @[[[SWGUser alloc] init]]; // List of user object SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; @@ -91,7 +91,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] + **body** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | ### Return type @@ -104,7 +104,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -121,7 +121,7 @@ Creates list of users with given input array ### Example ```objc -NSArray* body = @[[[SWGUser alloc] init]]; // List of user object (optional) +NSArray* body = @[[[SWGUser alloc] init]]; // List of user object SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; @@ -138,7 +138,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] + **body** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | ### Return type @@ -151,7 +151,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -198,7 +198,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -248,7 +248,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -266,8 +266,8 @@ Logs user into the system ### Example ```objc -NSString* username = @"username_example"; // The user name for login (optional) -NSString* password = @"password_example"; // The password for login in clear text (optional) +NSString* username = @"username_example"; // The user name for login +NSString* password = @"password_example"; // The password for login in clear text SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; @@ -288,8 +288,8 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **NSString***| The user name for login | [optional] - **password** | **NSString***| The password for login in clear text | [optional] + **username** | **NSString***| The user name for login | + **password** | **NSString***| The password for login in clear text | ### Return type @@ -302,7 +302,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -345,7 +345,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -364,7 +364,7 @@ This can only be done by the logged in user. ```objc NSString* username = @"username_example"; // name that need to be deleted -SWGUser* body = [[SWGUser alloc] init]; // Updated user object (optional) +SWGUser* body = [[SWGUser alloc] init]; // Updated user object SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; @@ -383,7 +383,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **NSString***| name that need to be deleted | - **body** | [**SWGUser***](SWGUser*.md)| Updated user object | [optional] + **body** | [**SWGUser***](SWGUser*.md)| Updated user object | ### Return type @@ -396,7 +396,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/xml + - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 461ec7e1f0e..48a618b837d 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -257,7 +257,11 @@ use WWW::SwaggerClient::Object::ModelReturn; use WWW::SwaggerClient::Object::Name; use WWW::SwaggerClient::Object::NumberOnly; use WWW::SwaggerClient::Object::Order; +use WWW::SwaggerClient::Object::OuterBoolean; +use WWW::SwaggerClient::Object::OuterComposite; use WWW::SwaggerClient::Object::OuterEnum; +use WWW::SwaggerClient::Object::OuterNumber; +use WWW::SwaggerClient::Object::OuterString; use WWW::SwaggerClient::Object::Pet; use WWW::SwaggerClient::Object::ReadOnlyFirst; use WWW::SwaggerClient::Object::SpecialModelName; @@ -307,7 +311,11 @@ use WWW::SwaggerClient::Object::ModelReturn; use WWW::SwaggerClient::Object::Name; use WWW::SwaggerClient::Object::NumberOnly; use WWW::SwaggerClient::Object::Order; +use WWW::SwaggerClient::Object::OuterBoolean; +use WWW::SwaggerClient::Object::OuterComposite; use WWW::SwaggerClient::Object::OuterEnum; +use WWW::SwaggerClient::Object::OuterNumber; +use WWW::SwaggerClient::Object::OuterString; use WWW::SwaggerClient::Object::Pet; use WWW::SwaggerClient::Object::ReadOnlyFirst; use WWW::SwaggerClient::Object::SpecialModelName; @@ -321,14 +329,14 @@ use WWW::SwaggerClient::; my $api_instance = WWW::SwaggerClient::->new( ); -my $body = WWW::SwaggerClient::Object::Client->new(); # Client | client model +my $body = WWW::SwaggerClient::Object::OuterBoolean->new(); # OuterBoolean | Input boolean as post body eval { - my $result = $api_instance->test_client_model(body => $body); + my $result = $api_instance->fake_outer_boolean_serialize(body => $body); print Dumper($result); }; if ($@) { - warn "Exception when calling FakeApi->test_client_model: $@\n"; + warn "Exception when calling FakeApi->fake_outer_boolean_serialize: $@\n"; } ``` @@ -339,6 +347,10 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | *FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters @@ -392,7 +404,11 @@ Class | Method | HTTP request | Description - [WWW::SwaggerClient::Object::Name](docs/Name.md) - [WWW::SwaggerClient::Object::NumberOnly](docs/NumberOnly.md) - [WWW::SwaggerClient::Object::Order](docs/Order.md) + - [WWW::SwaggerClient::Object::OuterBoolean](docs/OuterBoolean.md) + - [WWW::SwaggerClient::Object::OuterComposite](docs/OuterComposite.md) - [WWW::SwaggerClient::Object::OuterEnum](docs/OuterEnum.md) + - [WWW::SwaggerClient::Object::OuterNumber](docs/OuterNumber.md) + - [WWW::SwaggerClient::Object::OuterString](docs/OuterString.md) - [WWW::SwaggerClient::Object::Pet](docs/Pet.md) - [WWW::SwaggerClient::Object::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [WWW::SwaggerClient::Object::SpecialModelName](docs/SpecialModelName.md) diff --git a/samples/client/petstore/perl/docs/FakeApi.md b/samples/client/petstore/perl/docs/FakeApi.md index f928042b269..3449f1e7aca 100644 --- a/samples/client/petstore/perl/docs/FakeApi.md +++ b/samples/client/petstore/perl/docs/FakeApi.md @@ -9,11 +9,199 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model [**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +# **fake_outer_boolean_serialize** +> OuterBoolean fake_outer_boolean_serialize(body => $body) + + + +Test serialization of outer boolean types + +### Example +```perl +use Data::Dumper; +use WWW::SwaggerClient::FakeApi; +my $api_instance = WWW::SwaggerClient::FakeApi->new( +); + +my $body = WWW::SwaggerClient::Object::OuterBoolean->new(); # OuterBoolean | Input boolean as post body + +eval { + my $result = $api_instance->fake_outer_boolean_serialize(body => $body); + print Dumper($result); +}; +if ($@) { + warn "Exception when calling FakeApi->fake_outer_boolean_serialize: $@\n"; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + +### Return type + +[**OuterBoolean**](OuterBoolean.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_outer_composite_serialize** +> OuterComposite fake_outer_composite_serialize(body => $body) + + + +Test serialization of object with outer number type + +### Example +```perl +use Data::Dumper; +use WWW::SwaggerClient::FakeApi; +my $api_instance = WWW::SwaggerClient::FakeApi->new( +); + +my $body = WWW::SwaggerClient::Object::OuterComposite->new(); # OuterComposite | Input composite as post body + +eval { + my $result = $api_instance->fake_outer_composite_serialize(body => $body); + print Dumper($result); +}; +if ($@) { + warn "Exception when calling FakeApi->fake_outer_composite_serialize: $@\n"; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_outer_number_serialize** +> OuterNumber fake_outer_number_serialize(body => $body) + + + +Test serialization of outer number types + +### Example +```perl +use Data::Dumper; +use WWW::SwaggerClient::FakeApi; +my $api_instance = WWW::SwaggerClient::FakeApi->new( +); + +my $body = WWW::SwaggerClient::Object::OuterNumber->new(); # OuterNumber | Input number as post body + +eval { + my $result = $api_instance->fake_outer_number_serialize(body => $body); + print Dumper($result); +}; +if ($@) { + warn "Exception when calling FakeApi->fake_outer_number_serialize: $@\n"; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + +### Return type + +[**OuterNumber**](OuterNumber.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_outer_string_serialize** +> OuterString fake_outer_string_serialize(body => $body) + + + +Test serialization of outer string types + +### Example +```perl +use Data::Dumper; +use WWW::SwaggerClient::FakeApi; +my $api_instance = WWW::SwaggerClient::FakeApi->new( +); + +my $body = WWW::SwaggerClient::Object::OuterString->new(); # OuterString | Input string as post body + +eval { + my $result = $api_instance->fake_outer_string_serialize(body => $body); + print Dumper($result); +}; +if ($@) { + warn "Exception when calling FakeApi->fake_outer_string_serialize: $@\n"; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + +### Return type + +[**OuterString**](OuterString.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **test_client_model** > Client test_client_model(body => $body) diff --git a/samples/client/petstore/perl/docs/OuterBoolean.md b/samples/client/petstore/perl/docs/OuterBoolean.md new file mode 100644 index 00000000000..083d258299d --- /dev/null +++ b/samples/client/petstore/perl/docs/OuterBoolean.md @@ -0,0 +1,14 @@ +# WWW::SwaggerClient::Object::OuterBoolean + +## Load the model package +```perl +use WWW::SwaggerClient::Object::OuterBoolean; +``` + +## 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/perl/docs/OuterComposite.md b/samples/client/petstore/perl/docs/OuterComposite.md new file mode 100644 index 00000000000..091bc68411b --- /dev/null +++ b/samples/client/petstore/perl/docs/OuterComposite.md @@ -0,0 +1,17 @@ +# WWW::SwaggerClient::Object::OuterComposite + +## Load the model package +```perl +use WWW::SwaggerClient::Object::OuterComposite; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**my_number** | [**OuterNumber**](OuterNumber.md) | | [optional] +**my_string** | [**OuterString**](OuterString.md) | | [optional] +**my_boolean** | [**OuterBoolean**](OuterBoolean.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/perl/docs/OuterNumber.md b/samples/client/petstore/perl/docs/OuterNumber.md new file mode 100644 index 00000000000..fc755cc362c --- /dev/null +++ b/samples/client/petstore/perl/docs/OuterNumber.md @@ -0,0 +1,14 @@ +# WWW::SwaggerClient::Object::OuterNumber + +## Load the model package +```perl +use WWW::SwaggerClient::Object::OuterNumber; +``` + +## 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/perl/docs/OuterString.md b/samples/client/petstore/perl/docs/OuterString.md new file mode 100644 index 00000000000..2eeee7f43f1 --- /dev/null +++ b/samples/client/petstore/perl/docs/OuterString.md @@ -0,0 +1,14 @@ +# WWW::SwaggerClient::Object::OuterString + +## Load the model package +```perl +use WWW::SwaggerClient::Object::OuterString; +``` + +## 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/perl/lib/WWW/SwaggerClient/FakeApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm index 0e8e732acae..d0cd56a018b 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/FakeApi.pm @@ -48,6 +48,246 @@ sub new { } +# +# fake_outer_boolean_serialize +# +# +# +# @param OuterBoolean $body Input boolean as post body (optional) +{ + my $params = { + 'body' => { + data_type => 'OuterBoolean', + description => 'Input boolean as post body', + required => '0', + }, + }; + __PACKAGE__->method_documentation->{ 'fake_outer_boolean_serialize' } = { + summary => '', + params => $params, + returns => 'OuterBoolean', + }; +} +# @return OuterBoolean +# +sub fake_outer_boolean_serialize { + my ($self, %args) = @_; + + # parse inputs + my $_resource_path = '/fake/outer/boolean'; + + my $_method = 'POST'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept(); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + + my $_body_data; + # body params + if ( exists $args{'body'}) { + $_body_data = $args{'body'}; + } + + # authentication setting, if any + my $auth_settings = [qw()]; + + # make the API Call + my $response = $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + if (!$response) { + return; + } + my $_response_object = $self->{api_client}->deserialize('OuterBoolean', $response); + return $_response_object; +} + +# +# fake_outer_composite_serialize +# +# +# +# @param OuterComposite $body Input composite as post body (optional) +{ + my $params = { + 'body' => { + data_type => 'OuterComposite', + description => 'Input composite as post body', + required => '0', + }, + }; + __PACKAGE__->method_documentation->{ 'fake_outer_composite_serialize' } = { + summary => '', + params => $params, + returns => 'OuterComposite', + }; +} +# @return OuterComposite +# +sub fake_outer_composite_serialize { + my ($self, %args) = @_; + + # parse inputs + my $_resource_path = '/fake/outer/composite'; + + my $_method = 'POST'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept(); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + + my $_body_data; + # body params + if ( exists $args{'body'}) { + $_body_data = $args{'body'}; + } + + # authentication setting, if any + my $auth_settings = [qw()]; + + # make the API Call + my $response = $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + if (!$response) { + return; + } + my $_response_object = $self->{api_client}->deserialize('OuterComposite', $response); + return $_response_object; +} + +# +# fake_outer_number_serialize +# +# +# +# @param OuterNumber $body Input number as post body (optional) +{ + my $params = { + 'body' => { + data_type => 'OuterNumber', + description => 'Input number as post body', + required => '0', + }, + }; + __PACKAGE__->method_documentation->{ 'fake_outer_number_serialize' } = { + summary => '', + params => $params, + returns => 'OuterNumber', + }; +} +# @return OuterNumber +# +sub fake_outer_number_serialize { + my ($self, %args) = @_; + + # parse inputs + my $_resource_path = '/fake/outer/number'; + + my $_method = 'POST'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept(); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + + my $_body_data; + # body params + if ( exists $args{'body'}) { + $_body_data = $args{'body'}; + } + + # authentication setting, if any + my $auth_settings = [qw()]; + + # make the API Call + my $response = $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + if (!$response) { + return; + } + my $_response_object = $self->{api_client}->deserialize('OuterNumber', $response); + return $_response_object; +} + +# +# fake_outer_string_serialize +# +# +# +# @param OuterString $body Input string as post body (optional) +{ + my $params = { + 'body' => { + data_type => 'OuterString', + description => 'Input string as post body', + required => '0', + }, + }; + __PACKAGE__->method_documentation->{ 'fake_outer_string_serialize' } = { + summary => '', + params => $params, + returns => 'OuterString', + }; +} +# @return OuterString +# +sub fake_outer_string_serialize { + my ($self, %args) = @_; + + # parse inputs + my $_resource_path = '/fake/outer/string'; + + my $_method = 'POST'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept(); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + + my $_body_data; + # body params + if ( exists $args{'body'}) { + $_body_data = $args{'body'}; + } + + # authentication setting, if any + my $auth_settings = [qw()]; + + # make the API Call + my $response = $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + if (!$response) { + return; + } + my $_response_object = $self->{api_client}->deserialize('OuterString', $response); + return $_response_object; +} + # # test_client_model # diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterBoolean.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterBoolean.pm new file mode 100644 index 00000000000..476df404705 --- /dev/null +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterBoolean.pm @@ -0,0 +1,158 @@ +=begin comment + +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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the swagger code generator program. +# Do not edit the class manually. +# Ref: https://github.com/swagger-api/swagger-codegen +# +package WWW::SwaggerClient::Object::OuterBoolean; + +require 5.6.0; +use strict; +use warnings; +use utf8; +use JSON qw(decode_json); +use Data::Dumper; +use Module::Runtime qw(use_module); +use Log::Any qw($log); +use Date::Parse; +use DateTime; + +use base ("Class::Accessor", "Class::Data::Inheritable"); + + +# +# +# +# NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. +# REF: https://github.com/swagger-api/swagger-codegen +# + +=begin comment + +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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the swagger code generator program. +# Do not edit the class manually. +# Ref: https://github.com/swagger-api/swagger-codegen +# +__PACKAGE__->mk_classdata('attribute_map' => {}); +__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('method_documentation' => {}); +__PACKAGE__->mk_classdata('class_documentation' => {}); + +# new object +sub new { + my ($class, %args) = @_; + + my $self = bless {}, $class; + + foreach my $attribute (keys %{$class->attribute_map}) { + my $args_key = $class->attribute_map->{$attribute}; + $self->$attribute( $args{ $args_key } ); + } + + return $self; +} + +# return perl hash +sub to_hash { + return decode_json(JSON->new->convert_blessed->encode( shift )); +} + +# used by JSON for serialization +sub TO_JSON { + my $self = shift; + my $_data = {}; + foreach my $_key (keys %{$self->attribute_map}) { + if (defined $self->{$_key}) { + $_data->{$self->attribute_map->{$_key}} = $self->{$_key}; + } + } + return $_data; +} + +# from Perl hashref +sub from_hash { + my ($self, $hash) = @_; + + # loop through attributes and use swagger_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + my $_json_attribute = $self->attribute_map->{$_key}; + if ($_type =~ /^array\[/i) { # array + my $_subclass = substr($_type, 6, -1); + my @_array = (); + foreach my $_element (@{$hash->{$_json_attribute}}) { + push @_array, $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \@_array; + } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime + $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); + } else { + $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); + } + } + + return $self; +} + +# deserialize non-array data +sub _deserialize { + my ($self, $type, $data) = @_; + $log->debugf("deserializing %s with %s",Dumper($data), $type); + + if ($type eq 'DateTime') { + return DateTime->from_epoch(epoch => str2time($data)); + } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) { + return $data; + } else { # hash(model) + my $_instance = eval "WWW::SwaggerClient::Object::$type->new()"; + return $_instance->from_hash($data); + } +} + + + +__PACKAGE__->class_documentation({description => '', + class => 'OuterBoolean', + required => [], # TODO +} ); + +__PACKAGE__->method_documentation({ +}); + +__PACKAGE__->swagger_types( { + +} ); + +__PACKAGE__->attribute_map( { + +} ); + +__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); + + +1; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterComposite.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterComposite.pm new file mode 100644 index 00000000000..7697149a774 --- /dev/null +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterComposite.pm @@ -0,0 +1,183 @@ +=begin comment + +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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the swagger code generator program. +# Do not edit the class manually. +# Ref: https://github.com/swagger-api/swagger-codegen +# +package WWW::SwaggerClient::Object::OuterComposite; + +require 5.6.0; +use strict; +use warnings; +use utf8; +use JSON qw(decode_json); +use Data::Dumper; +use Module::Runtime qw(use_module); +use Log::Any qw($log); +use Date::Parse; +use DateTime; + +use base ("Class::Accessor", "Class::Data::Inheritable"); + + +# +# +# +# NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. +# REF: https://github.com/swagger-api/swagger-codegen +# + +=begin comment + +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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the swagger code generator program. +# Do not edit the class manually. +# Ref: https://github.com/swagger-api/swagger-codegen +# +__PACKAGE__->mk_classdata('attribute_map' => {}); +__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('method_documentation' => {}); +__PACKAGE__->mk_classdata('class_documentation' => {}); + +# new object +sub new { + my ($class, %args) = @_; + + my $self = bless {}, $class; + + foreach my $attribute (keys %{$class->attribute_map}) { + my $args_key = $class->attribute_map->{$attribute}; + $self->$attribute( $args{ $args_key } ); + } + + return $self; +} + +# return perl hash +sub to_hash { + return decode_json(JSON->new->convert_blessed->encode( shift )); +} + +# used by JSON for serialization +sub TO_JSON { + my $self = shift; + my $_data = {}; + foreach my $_key (keys %{$self->attribute_map}) { + if (defined $self->{$_key}) { + $_data->{$self->attribute_map->{$_key}} = $self->{$_key}; + } + } + return $_data; +} + +# from Perl hashref +sub from_hash { + my ($self, $hash) = @_; + + # loop through attributes and use swagger_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + my $_json_attribute = $self->attribute_map->{$_key}; + if ($_type =~ /^array\[/i) { # array + my $_subclass = substr($_type, 6, -1); + my @_array = (); + foreach my $_element (@{$hash->{$_json_attribute}}) { + push @_array, $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \@_array; + } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime + $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); + } else { + $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); + } + } + + return $self; +} + +# deserialize non-array data +sub _deserialize { + my ($self, $type, $data) = @_; + $log->debugf("deserializing %s with %s",Dumper($data), $type); + + if ($type eq 'DateTime') { + return DateTime->from_epoch(epoch => str2time($data)); + } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) { + return $data; + } else { # hash(model) + my $_instance = eval "WWW::SwaggerClient::Object::$type->new()"; + return $_instance->from_hash($data); + } +} + + + +__PACKAGE__->class_documentation({description => '', + class => 'OuterComposite', + required => [], # TODO +} ); + +__PACKAGE__->method_documentation({ + 'my_number' => { + datatype => 'OuterNumber', + base_name => 'my_number', + description => '', + format => '', + read_only => '', + }, + 'my_string' => { + datatype => 'OuterString', + base_name => 'my_string', + description => '', + format => '', + read_only => '', + }, + 'my_boolean' => { + datatype => 'OuterBoolean', + base_name => 'my_boolean', + description => '', + format => '', + read_only => '', + }, +}); + +__PACKAGE__->swagger_types( { + 'my_number' => 'OuterNumber', + 'my_string' => 'OuterString', + 'my_boolean' => 'OuterBoolean' +} ); + +__PACKAGE__->attribute_map( { + 'my_number' => 'my_number', + 'my_string' => 'my_string', + 'my_boolean' => 'my_boolean' +} ); + +__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); + + +1; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterNumber.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterNumber.pm new file mode 100644 index 00000000000..5bb037849c5 --- /dev/null +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterNumber.pm @@ -0,0 +1,158 @@ +=begin comment + +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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the swagger code generator program. +# Do not edit the class manually. +# Ref: https://github.com/swagger-api/swagger-codegen +# +package WWW::SwaggerClient::Object::OuterNumber; + +require 5.6.0; +use strict; +use warnings; +use utf8; +use JSON qw(decode_json); +use Data::Dumper; +use Module::Runtime qw(use_module); +use Log::Any qw($log); +use Date::Parse; +use DateTime; + +use base ("Class::Accessor", "Class::Data::Inheritable"); + + +# +# +# +# NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. +# REF: https://github.com/swagger-api/swagger-codegen +# + +=begin comment + +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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the swagger code generator program. +# Do not edit the class manually. +# Ref: https://github.com/swagger-api/swagger-codegen +# +__PACKAGE__->mk_classdata('attribute_map' => {}); +__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('method_documentation' => {}); +__PACKAGE__->mk_classdata('class_documentation' => {}); + +# new object +sub new { + my ($class, %args) = @_; + + my $self = bless {}, $class; + + foreach my $attribute (keys %{$class->attribute_map}) { + my $args_key = $class->attribute_map->{$attribute}; + $self->$attribute( $args{ $args_key } ); + } + + return $self; +} + +# return perl hash +sub to_hash { + return decode_json(JSON->new->convert_blessed->encode( shift )); +} + +# used by JSON for serialization +sub TO_JSON { + my $self = shift; + my $_data = {}; + foreach my $_key (keys %{$self->attribute_map}) { + if (defined $self->{$_key}) { + $_data->{$self->attribute_map->{$_key}} = $self->{$_key}; + } + } + return $_data; +} + +# from Perl hashref +sub from_hash { + my ($self, $hash) = @_; + + # loop through attributes and use swagger_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + my $_json_attribute = $self->attribute_map->{$_key}; + if ($_type =~ /^array\[/i) { # array + my $_subclass = substr($_type, 6, -1); + my @_array = (); + foreach my $_element (@{$hash->{$_json_attribute}}) { + push @_array, $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \@_array; + } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime + $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); + } else { + $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); + } + } + + return $self; +} + +# deserialize non-array data +sub _deserialize { + my ($self, $type, $data) = @_; + $log->debugf("deserializing %s with %s",Dumper($data), $type); + + if ($type eq 'DateTime') { + return DateTime->from_epoch(epoch => str2time($data)); + } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) { + return $data; + } else { # hash(model) + my $_instance = eval "WWW::SwaggerClient::Object::$type->new()"; + return $_instance->from_hash($data); + } +} + + + +__PACKAGE__->class_documentation({description => '', + class => 'OuterNumber', + required => [], # TODO +} ); + +__PACKAGE__->method_documentation({ +}); + +__PACKAGE__->swagger_types( { + +} ); + +__PACKAGE__->attribute_map( { + +} ); + +__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); + + +1; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterString.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterString.pm new file mode 100644 index 00000000000..ac7e0ba5295 --- /dev/null +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/OuterString.pm @@ -0,0 +1,158 @@ +=begin comment + +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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the swagger code generator program. +# Do not edit the class manually. +# Ref: https://github.com/swagger-api/swagger-codegen +# +package WWW::SwaggerClient::Object::OuterString; + +require 5.6.0; +use strict; +use warnings; +use utf8; +use JSON qw(decode_json); +use Data::Dumper; +use Module::Runtime qw(use_module); +use Log::Any qw($log); +use Date::Parse; +use DateTime; + +use base ("Class::Accessor", "Class::Data::Inheritable"); + + +# +# +# +# NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. +# REF: https://github.com/swagger-api/swagger-codegen +# + +=begin comment + +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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the swagger code generator program. +# Do not edit the class manually. +# Ref: https://github.com/swagger-api/swagger-codegen +# +__PACKAGE__->mk_classdata('attribute_map' => {}); +__PACKAGE__->mk_classdata('swagger_types' => {}); +__PACKAGE__->mk_classdata('method_documentation' => {}); +__PACKAGE__->mk_classdata('class_documentation' => {}); + +# new object +sub new { + my ($class, %args) = @_; + + my $self = bless {}, $class; + + foreach my $attribute (keys %{$class->attribute_map}) { + my $args_key = $class->attribute_map->{$attribute}; + $self->$attribute( $args{ $args_key } ); + } + + return $self; +} + +# return perl hash +sub to_hash { + return decode_json(JSON->new->convert_blessed->encode( shift )); +} + +# used by JSON for serialization +sub TO_JSON { + my $self = shift; + my $_data = {}; + foreach my $_key (keys %{$self->attribute_map}) { + if (defined $self->{$_key}) { + $_data->{$self->attribute_map->{$_key}} = $self->{$_key}; + } + } + return $_data; +} + +# from Perl hashref +sub from_hash { + my ($self, $hash) = @_; + + # loop through attributes and use swagger_types to deserialize the data + while ( my ($_key, $_type) = each %{$self->swagger_types} ) { + my $_json_attribute = $self->attribute_map->{$_key}; + if ($_type =~ /^array\[/i) { # array + my $_subclass = substr($_type, 6, -1); + my @_array = (); + foreach my $_element (@{$hash->{$_json_attribute}}) { + push @_array, $self->_deserialize($_subclass, $_element); + } + $self->{$_key} = \@_array; + } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime + $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); + } else { + $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); + } + } + + return $self; +} + +# deserialize non-array data +sub _deserialize { + my ($self, $type, $data) = @_; + $log->debugf("deserializing %s with %s",Dumper($data), $type); + + if ($type eq 'DateTime') { + return DateTime->from_epoch(epoch => str2time($data)); + } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) { + return $data; + } else { # hash(model) + my $_instance = eval "WWW::SwaggerClient::Object::$type->new()"; + return $_instance->from_hash($data); + } +} + + + +__PACKAGE__->class_documentation({description => '', + class => 'OuterString', + required => [], # TODO +} ); + +__PACKAGE__->method_documentation({ +}); + +__PACKAGE__->swagger_types( { + +} ); + +__PACKAGE__->attribute_map( { + +} ); + +__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); + + +1; diff --git a/samples/client/petstore/perl/t/OuterBooleanTest.t b/samples/client/petstore/perl/t/OuterBooleanTest.t new file mode 100644 index 00000000000..906b2e4e915 --- /dev/null +++ b/samples/client/petstore/perl/t/OuterBooleanTest.t @@ -0,0 +1,33 @@ +=begin comment + +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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the Swagger Codegen +# Please update the test cases below to test the model. +# Ref: https://github.com/swagger-api/swagger-codegen +# +use Test::More tests => 2; +use Test::Exception; + +use lib 'lib'; +use strict; +use warnings; + + +use_ok('WWW::SwaggerClient::Object::OuterBoolean'); + +my $instance = WWW::SwaggerClient::Object::OuterBoolean->new(); + +isa_ok($instance, 'WWW::SwaggerClient::Object::OuterBoolean'); + diff --git a/samples/client/petstore/perl/t/OuterCompositeTest.t b/samples/client/petstore/perl/t/OuterCompositeTest.t new file mode 100644 index 00000000000..d19b2a831e1 --- /dev/null +++ b/samples/client/petstore/perl/t/OuterCompositeTest.t @@ -0,0 +1,33 @@ +=begin comment + +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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the Swagger Codegen +# Please update the test cases below to test the model. +# Ref: https://github.com/swagger-api/swagger-codegen +# +use Test::More tests => 2; +use Test::Exception; + +use lib 'lib'; +use strict; +use warnings; + + +use_ok('WWW::SwaggerClient::Object::OuterComposite'); + +my $instance = WWW::SwaggerClient::Object::OuterComposite->new(); + +isa_ok($instance, 'WWW::SwaggerClient::Object::OuterComposite'); + diff --git a/samples/client/petstore/perl/t/OuterNumberTest.t b/samples/client/petstore/perl/t/OuterNumberTest.t new file mode 100644 index 00000000000..eb4fbdf9a38 --- /dev/null +++ b/samples/client/petstore/perl/t/OuterNumberTest.t @@ -0,0 +1,33 @@ +=begin comment + +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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the Swagger Codegen +# Please update the test cases below to test the model. +# Ref: https://github.com/swagger-api/swagger-codegen +# +use Test::More tests => 2; +use Test::Exception; + +use lib 'lib'; +use strict; +use warnings; + + +use_ok('WWW::SwaggerClient::Object::OuterNumber'); + +my $instance = WWW::SwaggerClient::Object::OuterNumber->new(); + +isa_ok($instance, 'WWW::SwaggerClient::Object::OuterNumber'); + diff --git a/samples/client/petstore/perl/t/OuterStringTest.t b/samples/client/petstore/perl/t/OuterStringTest.t new file mode 100644 index 00000000000..6fb11050540 --- /dev/null +++ b/samples/client/petstore/perl/t/OuterStringTest.t @@ -0,0 +1,33 @@ +=begin comment + +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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end comment + +=cut + +# +# NOTE: This class is auto generated by the Swagger Codegen +# Please update the test cases below to test the model. +# Ref: https://github.com/swagger-api/swagger-codegen +# +use Test::More tests => 2; +use Test::Exception; + +use lib 'lib'; +use strict; +use warnings; + + +use_ok('WWW::SwaggerClient::Object::OuterString'); + +my $instance = WWW::SwaggerClient::Object::OuterString->new(); + +isa_ok($instance, 'WWW::SwaggerClient::Object::OuterString'); + diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index d1af5fcb964..477ee16f380 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -57,13 +57,13 @@ Please follow the [installation procedure](#installation--usage) and then run th require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new Swagger\Client\Api\FakeApi(); -$body = new \Swagger\Client\Model\Client(); // \Swagger\Client\Model\Client | client model +$body = new \Swagger\Client\Model\OuterBoolean(); // \Swagger\Client\Model\OuterBoolean | Input boolean as post body try { - $result = $api_instance->testClientModel($body); + $result = $api_instance->fakeOuterBooleanSerialize($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling FakeApi->testClientModel: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FakeApi->fakeOuterBooleanSerialize: ', $e->getMessage(), PHP_EOL; } ?> @@ -75,6 +75,10 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/Api/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/Api/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/Api/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/Api/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | *FakeApi* | [**testClientModel**](docs/Api/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/Api/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/Api/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters @@ -129,7 +133,11 @@ Class | Method | HTTP request | Description - [Name](docs/Model/Name.md) - [NumberOnly](docs/Model/NumberOnly.md) - [Order](docs/Model/Order.md) + - [OuterBoolean](docs/Model/OuterBoolean.md) + - [OuterComposite](docs/Model/OuterComposite.md) - [OuterEnum](docs/Model/OuterEnum.md) + - [OuterNumber](docs/Model/OuterNumber.md) + - [OuterString](docs/Model/OuterString.md) - [Pet](docs/Model/Pet.md) - [ReadOnlyFirst](docs/Model/ReadOnlyFirst.md) - [SpecialModelName](docs/Model/SpecialModelName.md) diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md index 5692638488d..ac98a1031b7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md @@ -4,11 +4,195 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +# **fakeOuterBooleanSerialize** +> \Swagger\Client\Model\OuterBoolean fakeOuterBooleanSerialize($body) + + + +Test serialization of outer boolean types + +### Example +```php +fakeOuterBooleanSerialize($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->fakeOuterBooleanSerialize: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Swagger\Client\Model\OuterBoolean**](../Model/\Swagger\Client\Model\OuterBoolean.md)| Input boolean as post body | [optional] + +### Return type + +[**\Swagger\Client\Model\OuterBoolean**](../Model/OuterBoolean.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **fakeOuterCompositeSerialize** +> \Swagger\Client\Model\OuterComposite fakeOuterCompositeSerialize($body) + + + +Test serialization of object with outer number type + +### Example +```php +fakeOuterCompositeSerialize($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->fakeOuterCompositeSerialize: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Swagger\Client\Model\OuterComposite**](../Model/\Swagger\Client\Model\OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**\Swagger\Client\Model\OuterComposite**](../Model/OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **fakeOuterNumberSerialize** +> \Swagger\Client\Model\OuterNumber fakeOuterNumberSerialize($body) + + + +Test serialization of outer number types + +### Example +```php +fakeOuterNumberSerialize($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->fakeOuterNumberSerialize: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Swagger\Client\Model\OuterNumber**](../Model/\Swagger\Client\Model\OuterNumber.md)| Input number as post body | [optional] + +### Return type + +[**\Swagger\Client\Model\OuterNumber**](../Model/OuterNumber.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **fakeOuterStringSerialize** +> \Swagger\Client\Model\OuterString fakeOuterStringSerialize($body) + + + +Test serialization of outer string types + +### Example +```php +fakeOuterStringSerialize($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->fakeOuterStringSerialize: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Swagger\Client\Model\OuterString**](../Model/\Swagger\Client\Model\OuterString.md)| Input string as post body | [optional] + +### Return type + +[**\Swagger\Client\Model\OuterString**](../Model/OuterString.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **testClientModel** > \Swagger\Client\Model\Client testClientModel($body) diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Model/OuterBoolean.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/OuterBoolean.md new file mode 100644 index 00000000000..8b243399474 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/OuterBoolean.md @@ -0,0 +1,9 @@ +# OuterBoolean + +## 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/SwaggerClient-php/docs/Model/OuterComposite.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/OuterComposite.md new file mode 100644 index 00000000000..8f791968a37 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/OuterComposite.md @@ -0,0 +1,12 @@ +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**my_number** | [**\Swagger\Client\Model\OuterNumber**](OuterNumber.md) | | [optional] +**my_string** | [**\Swagger\Client\Model\OuterString**](OuterString.md) | | [optional] +**my_boolean** | [**\Swagger\Client\Model\OuterBoolean**](OuterBoolean.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/SwaggerClient-php/docs/Model/OuterNumber.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/OuterNumber.md new file mode 100644 index 00000000000..8aa37f329bd --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/OuterNumber.md @@ -0,0 +1,9 @@ +# OuterNumber + +## 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/SwaggerClient-php/docs/Model/OuterString.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/OuterString.md new file mode 100644 index 00000000000..9ccaadaf98d --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/OuterString.md @@ -0,0 +1,9 @@ +# OuterString + +## 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/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php index 2e938dc22fd..71e6a5a26c5 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -81,6 +81,306 @@ class FakeApi return $this->config; } + /** + * Operation fakeOuterBooleanSerialize + * + * + * + * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) + * @throws \Swagger\Client\ApiException on non-2xx response + * @return \Swagger\Client\Model\OuterBoolean + */ + public function fakeOuterBooleanSerialize($body = null) + { + list($response) = $this->fakeOuterBooleanSerializeWithHttpInfo($body); + return $response; + } + + /** + * Operation fakeOuterBooleanSerializeWithHttpInfo + * + * + * + * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) + * @throws \Swagger\Client\ApiException on non-2xx response + * @return array of \Swagger\Client\Model\OuterBoolean, HTTP status code, HTTP response headers (array of strings) + */ + public function fakeOuterBooleanSerializeWithHttpInfo($body = null) + { + // parse inputs + $resourcePath = "/fake/outer/boolean"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Swagger\Client\Model\OuterBoolean', + '/fake/outer/boolean' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\OuterBoolean', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\OuterBoolean', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation fakeOuterCompositeSerialize + * + * + * + * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) + * @throws \Swagger\Client\ApiException on non-2xx response + * @return \Swagger\Client\Model\OuterComposite + */ + public function fakeOuterCompositeSerialize($body = null) + { + list($response) = $this->fakeOuterCompositeSerializeWithHttpInfo($body); + return $response; + } + + /** + * Operation fakeOuterCompositeSerializeWithHttpInfo + * + * + * + * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) + * @throws \Swagger\Client\ApiException on non-2xx response + * @return array of \Swagger\Client\Model\OuterComposite, HTTP status code, HTTP response headers (array of strings) + */ + public function fakeOuterCompositeSerializeWithHttpInfo($body = null) + { + // parse inputs + $resourcePath = "/fake/outer/composite"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Swagger\Client\Model\OuterComposite', + '/fake/outer/composite' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\OuterComposite', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\OuterComposite', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation fakeOuterNumberSerialize + * + * + * + * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) + * @throws \Swagger\Client\ApiException on non-2xx response + * @return \Swagger\Client\Model\OuterNumber + */ + public function fakeOuterNumberSerialize($body = null) + { + list($response) = $this->fakeOuterNumberSerializeWithHttpInfo($body); + return $response; + } + + /** + * Operation fakeOuterNumberSerializeWithHttpInfo + * + * + * + * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) + * @throws \Swagger\Client\ApiException on non-2xx response + * @return array of \Swagger\Client\Model\OuterNumber, HTTP status code, HTTP response headers (array of strings) + */ + public function fakeOuterNumberSerializeWithHttpInfo($body = null) + { + // parse inputs + $resourcePath = "/fake/outer/number"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Swagger\Client\Model\OuterNumber', + '/fake/outer/number' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\OuterNumber', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\OuterNumber', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + + /** + * Operation fakeOuterStringSerialize + * + * + * + * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) + * @throws \Swagger\Client\ApiException on non-2xx response + * @return \Swagger\Client\Model\OuterString + */ + public function fakeOuterStringSerialize($body = null) + { + list($response) = $this->fakeOuterStringSerializeWithHttpInfo($body); + return $response; + } + + /** + * Operation fakeOuterStringSerializeWithHttpInfo + * + * + * + * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) + * @throws \Swagger\Client\ApiException on non-2xx response + * @return array of \Swagger\Client\Model\OuterString, HTTP status code, HTTP response headers (array of strings) + */ + public function fakeOuterStringSerializeWithHttpInfo($body = null) + { + // parse inputs + $resourcePath = "/fake/outer/string"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept([]); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Swagger\Client\Model\OuterString', + '/fake/outer/string' + ); + + return [$this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\OuterString', $httpHeader), $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\OuterString', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + /** * Operation testClientModel * diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterBoolean.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterBoolean.php new file mode 100644 index 00000000000..34a56535ad3 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterBoolean.php @@ -0,0 +1,207 @@ +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(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php new file mode 100644 index 00000000000..1979b28f847 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php @@ -0,0 +1,281 @@ + '\Swagger\Client\Model\OuterNumber', + 'my_string' => '\Swagger\Client\Model\OuterString', + 'my_boolean' => '\Swagger\Client\Model\OuterBoolean' + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'my_number' => 'my_number', + 'my_string' => 'my_string', + 'my_boolean' => 'my_boolean' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'my_number' => 'setMyNumber', + 'my_string' => 'setMyString', + 'my_boolean' => 'setMyBoolean' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'my_number' => 'getMyNumber', + 'my_string' => 'getMyString', + 'my_boolean' => 'getMyBoolean' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['my_number'] = isset($data['my_number']) ? $data['my_number'] : null; + $this->container['my_string'] = isset($data['my_string']) ? $data['my_string'] : null; + $this->container['my_boolean'] = isset($data['my_boolean']) ? $data['my_boolean'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets my_number + * @return \Swagger\Client\Model\OuterNumber + */ + public function getMyNumber() + { + return $this->container['my_number']; + } + + /** + * Sets my_number + * @param \Swagger\Client\Model\OuterNumber $my_number + * @return $this + */ + public function setMyNumber($my_number) + { + $this->container['my_number'] = $my_number; + + return $this; + } + + /** + * Gets my_string + * @return \Swagger\Client\Model\OuterString + */ + public function getMyString() + { + return $this->container['my_string']; + } + + /** + * Sets my_string + * @param \Swagger\Client\Model\OuterString $my_string + * @return $this + */ + public function setMyString($my_string) + { + $this->container['my_string'] = $my_string; + + return $this; + } + + /** + * Gets my_boolean + * @return \Swagger\Client\Model\OuterBoolean + */ + public function getMyBoolean() + { + return $this->container['my_boolean']; + } + + /** + * Sets my_boolean + * @param \Swagger\Client\Model\OuterBoolean $my_boolean + * @return $this + */ + public function setMyBoolean($my_boolean) + { + $this->container['my_boolean'] = $my_boolean; + + return $this; + } + /** + * 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(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterNumber.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterNumber.php new file mode 100644 index 00000000000..3bf5d2fe4a0 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterNumber.php @@ -0,0 +1,207 @@ +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(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterString.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterString.php new file mode 100644 index 00000000000..9e441c8d3fa --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterString.php @@ -0,0 +1,207 @@ +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(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/OuterBooleanTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/OuterBooleanTest.php new file mode 100644 index 00000000000..8252fad1e85 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/OuterBooleanTest.php @@ -0,0 +1,85 @@ +test_client_model: %s\n" % e) + print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) ``` @@ -69,6 +68,10 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | *FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters @@ -123,7 +126,11 @@ Class | Method | HTTP request | Description - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) + - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SpecialModelName](docs/SpecialModelName.md) diff --git a/samples/client/petstore/python/docs/FakeApi.md b/samples/client/petstore/python/docs/FakeApi.md index 1a71980625e..e9c5f515e9f 100644 --- a/samples/client/petstore/python/docs/FakeApi.md +++ b/samples/client/petstore/python/docs/FakeApi.md @@ -4,11 +4,203 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model [**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +# **fake_outer_boolean_serialize** +> OuterBoolean fake_outer_boolean_serialize(body=body) + + + +Test serialization of outer boolean types + +### Example +```python +from __future__ import print_statement +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.OuterBoolean() # OuterBoolean | Input boolean as post body (optional) + +try: + api_response = api_instance.fake_outer_boolean_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + +### Return type + +[**OuterBoolean**](OuterBoolean.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_outer_composite_serialize** +> OuterComposite fake_outer_composite_serialize(body=body) + + + +Test serialization of object with outer number type + +### Example +```python +from __future__ import print_statement +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) + +try: + api_response = api_instance.fake_outer_composite_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_outer_number_serialize** +> OuterNumber fake_outer_number_serialize(body=body) + + + +Test serialization of outer number types + +### Example +```python +from __future__ import print_statement +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.OuterNumber() # OuterNumber | Input number as post body (optional) + +try: + api_response = api_instance.fake_outer_number_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + +### Return type + +[**OuterNumber**](OuterNumber.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_outer_string_serialize** +> OuterString fake_outer_string_serialize(body=body) + + + +Test serialization of outer string types + +### Example +```python +from __future__ import print_statement +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = petstore_api.FakeApi() +body = petstore_api.OuterString() # OuterString | Input string as post body (optional) + +try: + api_response = api_instance.fake_outer_string_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + +### Return type + +[**OuterString**](OuterString.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **test_client_model** > Client test_client_model(body) diff --git a/samples/client/petstore/python/docs/OuterBoolean.md b/samples/client/petstore/python/docs/OuterBoolean.md new file mode 100644 index 00000000000..8b243399474 --- /dev/null +++ b/samples/client/petstore/python/docs/OuterBoolean.md @@ -0,0 +1,9 @@ +# OuterBoolean + +## 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/python/docs/OuterComposite.md b/samples/client/petstore/python/docs/OuterComposite.md new file mode 100644 index 00000000000..159e67b48ee --- /dev/null +++ b/samples/client/petstore/python/docs/OuterComposite.md @@ -0,0 +1,12 @@ +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**my_number** | [**OuterNumber**](OuterNumber.md) | | [optional] +**my_string** | [**OuterString**](OuterString.md) | | [optional] +**my_boolean** | [**OuterBoolean**](OuterBoolean.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/python/docs/OuterNumber.md b/samples/client/petstore/python/docs/OuterNumber.md new file mode 100644 index 00000000000..8aa37f329bd --- /dev/null +++ b/samples/client/petstore/python/docs/OuterNumber.md @@ -0,0 +1,9 @@ +# OuterNumber + +## 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/python/docs/OuterString.md b/samples/client/petstore/python/docs/OuterString.md new file mode 100644 index 00000000000..9ccaadaf98d --- /dev/null +++ b/samples/client/petstore/python/docs/OuterString.md @@ -0,0 +1,9 @@ +# OuterString + +## 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/python/petstore_api/__init__.py b/samples/client/petstore/python/petstore_api/__init__.py index 9076ec76337..1aa7992ff2d 100644 --- a/samples/client/petstore/python/petstore_api/__init__.py +++ b/samples/client/petstore/python/petstore_api/__init__.py @@ -40,7 +40,11 @@ from .models.model_return import ModelReturn from .models.name import Name from .models.number_only import NumberOnly from .models.order import Order +from .models.outer_boolean import OuterBoolean +from .models.outer_composite import OuterComposite from .models.outer_enum import OuterEnum +from .models.outer_number import OuterNumber +from .models.outer_string import OuterString from .models.pet import Pet from .models.read_only_first import ReadOnlyFirst from .models.special_model_name import SpecialModelName diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 8a19da3ccbd..40b24273191 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -602,16 +602,17 @@ class ApiClient(object): :param klass: class literal. :return: model object. """ - instance = klass() - - if not instance.swagger_types: + if not klass.swagger_types: return data - for attr, attr_type in iteritems(instance.swagger_types): + kwargs = {} + for attr, attr_type in iteritems(klass.swagger_types): if data is not None \ - and instance.attribute_map[attr] in data \ + and klass.attribute_map[attr] in data \ and isinstance(data, (list, dict)): - value = data[instance.attribute_map[attr]] - setattr(instance, attr, self.__deserialize(value, attr_type)) + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) return instance diff --git a/samples/client/petstore/python/petstore_api/apis/fake_api.py b/samples/client/petstore/python/petstore_api/apis/fake_api.py index f79b8f59320..d2524dfae38 100644 --- a/samples/client/petstore/python/petstore_api/apis/fake_api.py +++ b/samples/client/petstore/python/petstore_api/apis/fake_api.py @@ -35,6 +35,378 @@ class FakeApi(object): api_client = ApiClient() self.api_client = api_client + def fake_outer_boolean_serialize(self, **kwargs): + """ + Test serialization of outer boolean types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.fake_outer_boolean_serialize(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param OuterBoolean body: Input boolean as post body + :return: OuterBoolean + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('callback'): + return self.fake_outer_boolean_serialize_with_http_info(**kwargs) + else: + (data) = self.fake_outer_boolean_serialize_with_http_info(**kwargs) + return data + + def fake_outer_boolean_serialize_with_http_info(self, **kwargs): + """ + Test serialization of outer boolean types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.fake_outer_boolean_serialize_with_http_info(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param OuterBoolean body: Input boolean as post body + :return: OuterBoolean + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('callback') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_boolean_serialize" % key + ) + params[key] = val + del params['kwargs'] + + + collection_formats = {} + + path_params = {} + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake/outer/boolean', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterBoolean', + auth_settings=auth_settings, + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def fake_outer_composite_serialize(self, **kwargs): + """ + Test serialization of object with outer number type + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.fake_outer_composite_serialize(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param OuterComposite body: Input composite as post body + :return: OuterComposite + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('callback'): + return self.fake_outer_composite_serialize_with_http_info(**kwargs) + else: + (data) = self.fake_outer_composite_serialize_with_http_info(**kwargs) + return data + + def fake_outer_composite_serialize_with_http_info(self, **kwargs): + """ + Test serialization of object with outer number type + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.fake_outer_composite_serialize_with_http_info(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param OuterComposite body: Input composite as post body + :return: OuterComposite + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('callback') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_composite_serialize" % key + ) + params[key] = val + del params['kwargs'] + + + collection_formats = {} + + path_params = {} + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake/outer/composite', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterComposite', + auth_settings=auth_settings, + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def fake_outer_number_serialize(self, **kwargs): + """ + Test serialization of outer number types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.fake_outer_number_serialize(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param OuterNumber body: Input number as post body + :return: OuterNumber + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('callback'): + return self.fake_outer_number_serialize_with_http_info(**kwargs) + else: + (data) = self.fake_outer_number_serialize_with_http_info(**kwargs) + return data + + def fake_outer_number_serialize_with_http_info(self, **kwargs): + """ + Test serialization of outer number types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.fake_outer_number_serialize_with_http_info(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param OuterNumber body: Input number as post body + :return: OuterNumber + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('callback') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_number_serialize" % key + ) + params[key] = val + del params['kwargs'] + + + collection_formats = {} + + path_params = {} + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake/outer/number', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterNumber', + auth_settings=auth_settings, + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def fake_outer_string_serialize(self, **kwargs): + """ + Test serialization of outer string types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.fake_outer_string_serialize(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param OuterString body: Input string as post body + :return: OuterString + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('callback'): + return self.fake_outer_string_serialize_with_http_info(**kwargs) + else: + (data) = self.fake_outer_string_serialize_with_http_info(**kwargs) + return data + + def fake_outer_string_serialize_with_http_info(self, **kwargs): + """ + Test serialization of outer string types + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.fake_outer_string_serialize_with_http_info(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param OuterString body: Input string as post body + :return: OuterString + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('callback') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_string_serialize" % key + ) + params[key] = val + del params['kwargs'] + + + collection_formats = {} + + path_params = {} + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # Authentication setting + auth_settings = [] + + return self.api_client.call_api('/fake/outer/string', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterString', + auth_settings=auth_settings, + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + def test_client_model(self, body, **kwargs): """ To test \"client\" model diff --git a/samples/client/petstore/python/petstore_api/models/__init__.py b/samples/client/petstore/python/petstore_api/models/__init__.py index f2a15c2d194..ea4684d5482 100644 --- a/samples/client/petstore/python/petstore_api/models/__init__.py +++ b/samples/client/petstore/python/petstore_api/models/__init__.py @@ -40,7 +40,11 @@ from .model_return import ModelReturn from .name import Name from .number_only import NumberOnly from .order import Order +from .outer_boolean import OuterBoolean +from .outer_composite import OuterComposite from .outer_enum import OuterEnum +from .outer_number import OuterNumber +from .outer_string import OuterString from .pet import Pet from .read_only_first import ReadOnlyFirst from .special_model_name import SpecialModelName diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python/petstore_api/models/additional_properties_class.py index 4d8206aa013..2e8bb951d46 100644 --- a/samples/client/petstore/python/petstore_api/models/additional_properties_class.py +++ b/samples/client/petstore/python/petstore_api/models/additional_properties_class.py @@ -21,31 +21,33 @@ class AdditionalPropertiesClass(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'map_property': 'dict(str, str)', + 'map_of_map_property': 'dict(str, dict(str, str))' + } + + attribute_map = { + 'map_property': 'map_property', + 'map_of_map_property': 'map_of_map_property' + } + def __init__(self, map_property=None, map_of_map_property=None): """ AdditionalPropertiesClass - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'map_property': 'dict(str, str)', - 'map_of_map_property': 'dict(str, dict(str, str))' - } - - self.attribute_map = { - 'map_property': 'map_property', - 'map_of_map_property': 'map_of_map_property' - } self._map_property = None self._map_of_map_property = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if map_property is not None: self.map_property = map_property if map_of_map_property is not None: diff --git a/samples/client/petstore/python/petstore_api/models/animal.py b/samples/client/petstore/python/petstore_api/models/animal.py index db1febb58ec..d96d06f9331 100644 --- a/samples/client/petstore/python/petstore_api/models/animal.py +++ b/samples/client/petstore/python/petstore_api/models/animal.py @@ -21,33 +21,34 @@ class Animal(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'class_name': 'str', + 'color': 'str' + } + + attribute_map = { + 'class_name': 'className', + 'color': 'color' + } + def __init__(self, class_name=None, color='red'): """ Animal - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'class_name': 'str', - 'color': 'str' - } - - self.attribute_map = { - 'class_name': 'className', - 'color': 'color' - } self._class_name = None self._color = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well - if class_name is not None: - self.class_name = class_name + self.class_name = class_name if color is not None: self.color = color diff --git a/samples/client/petstore/python/petstore_api/models/animal_farm.py b/samples/client/petstore/python/petstore_api/models/animal_farm.py index 3766a4f39a4..eab98db2799 100644 --- a/samples/client/petstore/python/petstore_api/models/animal_farm.py +++ b/samples/client/petstore/python/petstore_api/models/animal_farm.py @@ -21,27 +21,29 @@ class AnimalFarm(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + + } + + attribute_map = { + + } + def __init__(self): """ AnimalFarm - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - - } - - self.attribute_map = { - - } - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well def to_dict(self): """ diff --git a/samples/client/petstore/python/petstore_api/models/api_response.py b/samples/client/petstore/python/petstore_api/models/api_response.py index bc072ca025a..f62b2bc1eed 100644 --- a/samples/client/petstore/python/petstore_api/models/api_response.py +++ b/samples/client/petstore/python/petstore_api/models/api_response.py @@ -21,34 +21,36 @@ class ApiResponse(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'code': 'int', + 'type': 'str', + 'message': 'str' + } + + attribute_map = { + 'code': 'code', + 'type': 'type', + 'message': 'message' + } + def __init__(self, code=None, type=None, message=None): """ ApiResponse - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'code': 'int', - 'type': 'str', - 'message': 'str' - } - - self.attribute_map = { - 'code': 'code', - 'type': 'type', - 'message': 'message' - } self._code = None self._type = None self._message = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if code is not None: self.code = code if type is not None: diff --git a/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py index a06f0528433..9cd0262ede7 100644 --- a/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py @@ -21,28 +21,30 @@ class ArrayOfArrayOfNumberOnly(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'array_array_number': 'list[list[float]]' + } + + attribute_map = { + 'array_array_number': 'ArrayArrayNumber' + } + def __init__(self, array_array_number=None): """ ArrayOfArrayOfNumberOnly - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'array_array_number': 'list[list[float]]' - } - - self.attribute_map = { - 'array_array_number': 'ArrayArrayNumber' - } self._array_array_number = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if array_array_number is not None: self.array_array_number = array_array_number diff --git a/samples/client/petstore/python/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python/petstore_api/models/array_of_number_only.py index c166ebc4901..cf2bdcb9982 100644 --- a/samples/client/petstore/python/petstore_api/models/array_of_number_only.py +++ b/samples/client/petstore/python/petstore_api/models/array_of_number_only.py @@ -21,28 +21,30 @@ class ArrayOfNumberOnly(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'array_number': 'list[float]' + } + + attribute_map = { + 'array_number': 'ArrayNumber' + } + def __init__(self, array_number=None): """ ArrayOfNumberOnly - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'array_number': 'list[float]' - } - - self.attribute_map = { - 'array_number': 'ArrayNumber' - } self._array_number = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if array_number is not None: self.array_number = array_number diff --git a/samples/client/petstore/python/petstore_api/models/array_test.py b/samples/client/petstore/python/petstore_api/models/array_test.py index 8959dd96a8e..1b3fa642d5f 100644 --- a/samples/client/petstore/python/petstore_api/models/array_test.py +++ b/samples/client/petstore/python/petstore_api/models/array_test.py @@ -21,34 +21,36 @@ class ArrayTest(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'array_of_string': 'list[str]', + 'array_array_of_integer': 'list[list[int]]', + 'array_array_of_model': 'list[list[ReadOnlyFirst]]' + } + + attribute_map = { + 'array_of_string': 'array_of_string', + 'array_array_of_integer': 'array_array_of_integer', + 'array_array_of_model': 'array_array_of_model' + } + def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None): """ ArrayTest - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'array_of_string': 'list[str]', - 'array_array_of_integer': 'list[list[int]]', - 'array_array_of_model': 'list[list[ReadOnlyFirst]]' - } - - self.attribute_map = { - 'array_of_string': 'array_of_string', - 'array_array_of_integer': 'array_array_of_integer', - 'array_array_of_model': 'array_array_of_model' - } self._array_of_string = None self._array_array_of_integer = None self._array_array_of_model = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if array_of_string is not None: self.array_of_string = array_of_string if array_array_of_integer is not None: diff --git a/samples/client/petstore/python/petstore_api/models/capitalization.py b/samples/client/petstore/python/petstore_api/models/capitalization.py index 9b329d456c5..185f27fe1a9 100644 --- a/samples/client/petstore/python/petstore_api/models/capitalization.py +++ b/samples/client/petstore/python/petstore_api/models/capitalization.py @@ -21,32 +21,37 @@ class Capitalization(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'small_camel': 'str', + 'capital_camel': 'str', + 'small_snake': 'str', + 'capital_snake': 'str', + 'sca_eth_flow_points': 'str', + 'att_name': 'str' + } + + attribute_map = { + 'small_camel': 'smallCamel', + 'capital_camel': 'CapitalCamel', + 'small_snake': 'small_Snake', + 'capital_snake': 'Capital_Snake', + 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', + 'att_name': 'ATT_NAME' + } + def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None): """ Capitalization - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'small_camel': 'str', - 'capital_camel': 'str', - 'small_snake': 'str', - 'capital_snake': 'str', - 'sca_eth_flow_points': 'str', - 'att_name': 'str' - } - - self.attribute_map = { - 'small_camel': 'smallCamel', - 'capital_camel': 'CapitalCamel', - 'small_snake': 'small_Snake', - 'capital_snake': 'Capital_Snake', - 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', - 'att_name': 'ATT_NAME' - } self._small_camel = None self._capital_camel = None @@ -55,9 +60,6 @@ class Capitalization(object): self._sca_eth_flow_points = None self._att_name = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if small_camel is not None: self.small_camel = small_camel if capital_camel is not None: diff --git a/samples/client/petstore/python/petstore_api/models/cat.py b/samples/client/petstore/python/petstore_api/models/cat.py index c0f522f3a5e..bb85ecd2c31 100644 --- a/samples/client/petstore/python/petstore_api/models/cat.py +++ b/samples/client/petstore/python/petstore_api/models/cat.py @@ -21,36 +21,37 @@ class Cat(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'class_name': 'str', + 'color': 'str', + 'declawed': 'bool' + } + + attribute_map = { + 'class_name': 'className', + 'color': 'color', + 'declawed': 'declawed' + } + def __init__(self, class_name=None, color='red', declawed=None): """ Cat - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'class_name': 'str', - 'color': 'str', - 'declawed': 'bool' - } - - self.attribute_map = { - 'class_name': 'className', - 'color': 'color', - 'declawed': 'declawed' - } self._class_name = None self._color = None self._declawed = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well - if class_name is not None: - self.class_name = class_name + self.class_name = class_name if color is not None: self.color = color if declawed is not None: diff --git a/samples/client/petstore/python/petstore_api/models/category.py b/samples/client/petstore/python/petstore_api/models/category.py index 956d3416c34..8e7c828917f 100644 --- a/samples/client/petstore/python/petstore_api/models/category.py +++ b/samples/client/petstore/python/petstore_api/models/category.py @@ -21,31 +21,33 @@ class Category(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + def __init__(self, id=None, name=None): """ Category - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'id': 'int', - 'name': 'str' - } - - self.attribute_map = { - 'id': 'id', - 'name': 'name' - } self._id = None self._name = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if id is not None: self.id = id if name is not None: diff --git a/samples/client/petstore/python/petstore_api/models/class_model.py b/samples/client/petstore/python/petstore_api/models/class_model.py index 65dd5433771..89a0b67a7d2 100644 --- a/samples/client/petstore/python/petstore_api/models/class_model.py +++ b/samples/client/petstore/python/petstore_api/models/class_model.py @@ -21,28 +21,30 @@ class ClassModel(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_class': 'str' + } + + attribute_map = { + '_class': '_class' + } + def __init__(self, _class=None): """ ClassModel - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - '_class': 'str' - } - - self.attribute_map = { - '_class': '_class' - } self.__class = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if _class is not None: self._class = _class diff --git a/samples/client/petstore/python/petstore_api/models/client.py b/samples/client/petstore/python/petstore_api/models/client.py index 5b0ed44c49c..a44f2a92ef5 100644 --- a/samples/client/petstore/python/petstore_api/models/client.py +++ b/samples/client/petstore/python/petstore_api/models/client.py @@ -21,28 +21,30 @@ class Client(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'client': 'str' + } + + attribute_map = { + 'client': 'client' + } + def __init__(self, client=None): """ Client - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'client': 'str' - } - - self.attribute_map = { - 'client': 'client' - } self._client = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if client is not None: self.client = client diff --git a/samples/client/petstore/python/petstore_api/models/dog.py b/samples/client/petstore/python/petstore_api/models/dog.py index f8dfde1c3c4..be2fab3e8c0 100644 --- a/samples/client/petstore/python/petstore_api/models/dog.py +++ b/samples/client/petstore/python/petstore_api/models/dog.py @@ -21,36 +21,37 @@ class Dog(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'class_name': 'str', + 'color': 'str', + 'breed': 'str' + } + + attribute_map = { + 'class_name': 'className', + 'color': 'color', + 'breed': 'breed' + } + def __init__(self, class_name=None, color='red', breed=None): """ Dog - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'class_name': 'str', - 'color': 'str', - 'breed': 'str' - } - - self.attribute_map = { - 'class_name': 'className', - 'color': 'color', - 'breed': 'breed' - } self._class_name = None self._color = None self._breed = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well - if class_name is not None: - self.class_name = class_name + self.class_name = class_name if color is not None: self.color = color if breed is not None: diff --git a/samples/client/petstore/python/petstore_api/models/enum_arrays.py b/samples/client/petstore/python/petstore_api/models/enum_arrays.py index 1e8f6d4b8f0..2a6ef69d544 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_arrays.py +++ b/samples/client/petstore/python/petstore_api/models/enum_arrays.py @@ -21,31 +21,33 @@ class EnumArrays(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'just_symbol': 'str', + 'array_enum': 'list[str]' + } + + attribute_map = { + 'just_symbol': 'just_symbol', + 'array_enum': 'array_enum' + } + def __init__(self, just_symbol=None, array_enum=None): """ EnumArrays - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'just_symbol': 'str', - 'array_enum': 'list[str]' - } - - self.attribute_map = { - 'just_symbol': 'just_symbol', - 'array_enum': 'array_enum' - } self._just_symbol = None self._array_enum = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if just_symbol is not None: self.just_symbol = just_symbol if array_enum is not None: diff --git a/samples/client/petstore/python/petstore_api/models/enum_class.py b/samples/client/petstore/python/petstore_api/models/enum_class.py index 4544ad58528..6c801aa3ad9 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_class.py +++ b/samples/client/petstore/python/petstore_api/models/enum_class.py @@ -22,31 +22,34 @@ class EnumClass(object): Do not edit the class manually. """ + """ + allowed enum values + """ _ABC = "_abc" _EFG = "-efg" _XYZ_ = "(xyz)" + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + + } + + attribute_map = { + + } + def __init__(self): """ EnumClass - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - - } - - self.attribute_map = { - - } - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well def to_dict(self): """ diff --git a/samples/client/petstore/python/petstore_api/models/enum_test.py b/samples/client/petstore/python/petstore_api/models/enum_test.py index de3c8d5a4fe..e7cff9b9282 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python/petstore_api/models/enum_test.py @@ -21,37 +21,39 @@ class EnumTest(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'enum_string': 'str', + 'enum_integer': 'int', + 'enum_number': 'float', + 'outer_enum': 'OuterEnum' + } + + attribute_map = { + 'enum_string': 'enum_string', + 'enum_integer': 'enum_integer', + 'enum_number': 'enum_number', + 'outer_enum': 'outerEnum' + } + def __init__(self, enum_string=None, enum_integer=None, enum_number=None, outer_enum=None): """ EnumTest - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'enum_string': 'str', - 'enum_integer': 'int', - 'enum_number': 'float', - 'outer_enum': 'OuterEnum' - } - - self.attribute_map = { - 'enum_string': 'enum_string', - 'enum_integer': 'enum_integer', - 'enum_number': 'enum_number', - 'outer_enum': 'outerEnum' - } self._enum_string = None self._enum_integer = None self._enum_number = None self._outer_enum = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if enum_string is not None: self.enum_string = enum_string if enum_integer is not None: diff --git a/samples/client/petstore/python/petstore_api/models/format_test.py b/samples/client/petstore/python/petstore_api/models/format_test.py index cc5af78fd0c..b5afc2e4815 100644 --- a/samples/client/petstore/python/petstore_api/models/format_test.py +++ b/samples/client/petstore/python/petstore_api/models/format_test.py @@ -21,46 +21,51 @@ class FormatTest(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'integer': 'int', + 'int32': 'int', + 'int64': 'int', + 'number': 'float', + 'float': 'float', + 'double': 'float', + 'string': 'str', + 'byte': 'str', + 'binary': 'str', + 'date': 'date', + 'date_time': 'datetime', + 'uuid': 'str', + 'password': 'str' + } + + attribute_map = { + 'integer': 'integer', + 'int32': 'int32', + 'int64': 'int64', + 'number': 'number', + 'float': 'float', + 'double': 'double', + 'string': 'string', + 'byte': 'byte', + 'binary': 'binary', + 'date': 'date', + 'date_time': 'dateTime', + 'uuid': 'uuid', + 'password': 'password' + } + def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None): """ FormatTest - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'integer': 'int', - 'int32': 'int', - 'int64': 'int', - 'number': 'float', - 'float': 'float', - 'double': 'float', - 'string': 'str', - 'byte': 'str', - 'binary': 'str', - 'date': 'date', - 'date_time': 'datetime', - 'uuid': 'str', - 'password': 'str' - } - - self.attribute_map = { - 'integer': 'integer', - 'int32': 'int32', - 'int64': 'int64', - 'number': 'number', - 'float': 'float', - 'double': 'double', - 'string': 'string', - 'byte': 'byte', - 'binary': 'binary', - 'date': 'date', - 'date_time': 'dateTime', - 'uuid': 'uuid', - 'password': 'password' - } self._integer = None self._int32 = None @@ -76,35 +81,28 @@ class FormatTest(object): self._uuid = None self._password = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if integer is not None: self.integer = integer if int32 is not None: self.int32 = int32 if int64 is not None: self.int64 = int64 - if number is not None: - self.number = number + self.number = number if float is not None: self.float = float if double is not None: self.double = double if string is not None: self.string = string - if byte is not None: - self.byte = byte + self.byte = byte if binary is not None: self.binary = binary - if date is not None: - self.date = date + self.date = date if date_time is not None: self.date_time = date_time if uuid is not None: self.uuid = uuid - if password is not None: - self.password = password + self.password = password @property def integer(self): diff --git a/samples/client/petstore/python/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python/petstore_api/models/has_only_read_only.py index f528c3e3e88..bd13435949c 100644 --- a/samples/client/petstore/python/petstore_api/models/has_only_read_only.py +++ b/samples/client/petstore/python/petstore_api/models/has_only_read_only.py @@ -21,31 +21,33 @@ class HasOnlyReadOnly(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'bar': 'str', + 'foo': 'str' + } + + attribute_map = { + 'bar': 'bar', + 'foo': 'foo' + } + def __init__(self, bar=None, foo=None): """ HasOnlyReadOnly - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'bar': 'str', - 'foo': 'str' - } - - self.attribute_map = { - 'bar': 'bar', - 'foo': 'foo' - } self._bar = None self._foo = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if bar is not None: self.bar = bar if foo is not None: diff --git a/samples/client/petstore/python/petstore_api/models/list.py b/samples/client/petstore/python/petstore_api/models/list.py index f18bd004dbe..39b59e96fd1 100644 --- a/samples/client/petstore/python/petstore_api/models/list.py +++ b/samples/client/petstore/python/petstore_api/models/list.py @@ -21,28 +21,30 @@ class List(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_123_list': 'str' + } + + attribute_map = { + '_123_list': '123-list' + } + def __init__(self, _123_list=None): """ List - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - '_123_list': 'str' - } - - self.attribute_map = { - '_123_list': '123-list' - } self.__123_list = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if _123_list is not None: self._123_list = _123_list diff --git a/samples/client/petstore/python/petstore_api/models/map_test.py b/samples/client/petstore/python/petstore_api/models/map_test.py index 180c4208d89..5ce5354fc54 100644 --- a/samples/client/petstore/python/petstore_api/models/map_test.py +++ b/samples/client/petstore/python/petstore_api/models/map_test.py @@ -21,31 +21,33 @@ class MapTest(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'map_map_of_string': 'dict(str, dict(str, str))', + 'map_of_enum_string': 'dict(str, str)' + } + + attribute_map = { + 'map_map_of_string': 'map_map_of_string', + 'map_of_enum_string': 'map_of_enum_string' + } + def __init__(self, map_map_of_string=None, map_of_enum_string=None): """ MapTest - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'map_map_of_string': 'dict(str, dict(str, str))', - 'map_of_enum_string': 'dict(str, str)' - } - - self.attribute_map = { - 'map_map_of_string': 'map_map_of_string', - 'map_of_enum_string': 'map_of_enum_string' - } self._map_map_of_string = None self._map_of_enum_string = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if map_map_of_string is not None: self.map_map_of_string = map_map_of_string if map_of_enum_string is not None: diff --git a/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py index 8d0cde871fe..901a3a09e1b 100644 --- a/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -21,34 +21,36 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'uuid': 'str', + 'date_time': 'datetime', + 'map': 'dict(str, Animal)' + } + + attribute_map = { + 'uuid': 'uuid', + 'date_time': 'dateTime', + 'map': 'map' + } + def __init__(self, uuid=None, date_time=None, map=None): """ MixedPropertiesAndAdditionalPropertiesClass - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'uuid': 'str', - 'date_time': 'datetime', - 'map': 'dict(str, Animal)' - } - - self.attribute_map = { - 'uuid': 'uuid', - 'date_time': 'dateTime', - 'map': 'map' - } self._uuid = None self._date_time = None self._map = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if uuid is not None: self.uuid = uuid if date_time is not None: diff --git a/samples/client/petstore/python/petstore_api/models/model_200_response.py b/samples/client/petstore/python/petstore_api/models/model_200_response.py index bbdbfe00aeb..f0d98568473 100644 --- a/samples/client/petstore/python/petstore_api/models/model_200_response.py +++ b/samples/client/petstore/python/petstore_api/models/model_200_response.py @@ -21,31 +21,33 @@ class Model200Response(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'int', + '_class': 'str' + } + + attribute_map = { + 'name': 'name', + '_class': 'class' + } + def __init__(self, name=None, _class=None): """ Model200Response - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'name': 'int', - '_class': 'str' - } - - self.attribute_map = { - 'name': 'name', - '_class': 'class' - } self._name = None self.__class = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if name is not None: self.name = name if _class is not None: diff --git a/samples/client/petstore/python/petstore_api/models/model_return.py b/samples/client/petstore/python/petstore_api/models/model_return.py index 0321a42ff08..16ecd7e40b8 100644 --- a/samples/client/petstore/python/petstore_api/models/model_return.py +++ b/samples/client/petstore/python/petstore_api/models/model_return.py @@ -21,28 +21,30 @@ class ModelReturn(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_return': 'int' + } + + attribute_map = { + '_return': 'return' + } + def __init__(self, _return=None): """ ModelReturn - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - '_return': 'int' - } - - self.attribute_map = { - '_return': 'return' - } self.__return = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if _return is not None: self._return = _return diff --git a/samples/client/petstore/python/petstore_api/models/name.py b/samples/client/petstore/python/petstore_api/models/name.py index b7dc266bc18..2c351e266a6 100644 --- a/samples/client/petstore/python/petstore_api/models/name.py +++ b/samples/client/petstore/python/petstore_api/models/name.py @@ -21,39 +21,40 @@ class Name(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'int', + 'snake_case': 'int', + '_property': 'str', + '_123_number': 'int' + } + + attribute_map = { + 'name': 'name', + 'snake_case': 'snake_case', + '_property': 'property', + '_123_number': '123Number' + } + def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): """ Name - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'name': 'int', - 'snake_case': 'int', - '_property': 'str', - '_123_number': 'int' - } - - self.attribute_map = { - 'name': 'name', - 'snake_case': 'snake_case', - '_property': 'property', - '_123_number': '123Number' - } self._name = None self._snake_case = None self.__property = None self.__123_number = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well - if name is not None: - self.name = name + self.name = name if snake_case is not None: self.snake_case = snake_case if _property is not None: diff --git a/samples/client/petstore/python/petstore_api/models/number_only.py b/samples/client/petstore/python/petstore_api/models/number_only.py index 9d927edc0b1..7d2cda69227 100644 --- a/samples/client/petstore/python/petstore_api/models/number_only.py +++ b/samples/client/petstore/python/petstore_api/models/number_only.py @@ -21,28 +21,30 @@ class NumberOnly(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'just_number': 'float' + } + + attribute_map = { + 'just_number': 'JustNumber' + } + def __init__(self, just_number=None): """ NumberOnly - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'just_number': 'float' - } - - self.attribute_map = { - 'just_number': 'JustNumber' - } self._just_number = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if just_number is not None: self.just_number = just_number diff --git a/samples/client/petstore/python/petstore_api/models/order.py b/samples/client/petstore/python/petstore_api/models/order.py index 0445e56b4e9..77841dc50ca 100644 --- a/samples/client/petstore/python/petstore_api/models/order.py +++ b/samples/client/petstore/python/petstore_api/models/order.py @@ -21,32 +21,37 @@ class Order(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'pet_id': 'int', + 'quantity': 'int', + 'ship_date': 'datetime', + 'status': 'str', + 'complete': 'bool' + } + + attribute_map = { + 'id': 'id', + 'pet_id': 'petId', + 'quantity': 'quantity', + 'ship_date': 'shipDate', + 'status': 'status', + 'complete': 'complete' + } + def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): """ Order - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'id': 'int', - 'pet_id': 'int', - 'quantity': 'int', - 'ship_date': 'datetime', - 'status': 'str', - 'complete': 'bool' - } - - self.attribute_map = { - 'id': 'id', - 'pet_id': 'petId', - 'quantity': 'quantity', - 'ship_date': 'shipDate', - 'status': 'status', - 'complete': 'complete' - } self._id = None self._pet_id = None @@ -55,9 +60,6 @@ class Order(object): self._status = None self._complete = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if id is not None: self.id = id if pet_id is not None: diff --git a/samples/client/petstore/python/petstore_api/models/outer_boolean.py b/samples/client/petstore/python/petstore_api/models/outer_boolean.py new file mode 100644 index 00000000000..c3d04c856be --- /dev/null +++ b/samples/client/petstore/python/petstore_api/models/outer_boolean.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + 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 + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class OuterBoolean(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + def __init__(self): + """ + OuterBoolean - a model defined in Swagger + + :param dict swaggerTypes: The key is attribute name + and the value is attribute type. + :param dict attributeMap: The key is attribute name + and the value is json key in definition. + """ + self.swagger_types = { + + } + + self.attribute_map = { + + } + + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, OuterBoolean): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/outer_composite.py b/samples/client/petstore/python/petstore_api/models/outer_composite.py new file mode 100644 index 00000000000..8861eb354d5 --- /dev/null +++ b/samples/client/petstore/python/petstore_api/models/outer_composite.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + 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 + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class OuterComposite(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + def __init__(self, my_number=None, my_string=None, my_boolean=None): + """ + OuterComposite - a model defined in Swagger + + :param dict swaggerTypes: The key is attribute name + and the value is attribute type. + :param dict attributeMap: The key is attribute name + and the value is json key in definition. + """ + self.swagger_types = { + 'my_number': 'OuterNumber', + 'my_string': 'OuterString', + 'my_boolean': 'OuterBoolean' + } + + self.attribute_map = { + 'my_number': 'my_number', + 'my_string': 'my_string', + 'my_boolean': 'my_boolean' + } + + self._my_number = my_number + self._my_string = my_string + self._my_boolean = my_boolean + + @property + def my_number(self): + """ + Gets the my_number of this OuterComposite. + + :return: The my_number of this OuterComposite. + :rtype: OuterNumber + """ + return self._my_number + + @my_number.setter + def my_number(self, my_number): + """ + Sets the my_number of this OuterComposite. + + :param my_number: The my_number of this OuterComposite. + :type: OuterNumber + """ + + self._my_number = my_number + + @property + def my_string(self): + """ + Gets the my_string of this OuterComposite. + + :return: The my_string of this OuterComposite. + :rtype: OuterString + """ + return self._my_string + + @my_string.setter + def my_string(self, my_string): + """ + Sets the my_string of this OuterComposite. + + :param my_string: The my_string of this OuterComposite. + :type: OuterString + """ + + self._my_string = my_string + + @property + def my_boolean(self): + """ + Gets the my_boolean of this OuterComposite. + + :return: The my_boolean of this OuterComposite. + :rtype: OuterBoolean + """ + return self._my_boolean + + @my_boolean.setter + def my_boolean(self, my_boolean): + """ + Sets the my_boolean of this OuterComposite. + + :param my_boolean: The my_boolean of this OuterComposite. + :type: OuterBoolean + """ + + self._my_boolean = my_boolean + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, OuterComposite): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/outer_enum.py b/samples/client/petstore/python/petstore_api/models/outer_enum.py index 3e8cb6f2387..98a43f5df54 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_enum.py +++ b/samples/client/petstore/python/petstore_api/models/outer_enum.py @@ -22,31 +22,34 @@ class OuterEnum(object): Do not edit the class manually. """ + """ + allowed enum values + """ PLACED = "placed" APPROVED = "approved" DELIVERED = "delivered" + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + + } + + attribute_map = { + + } + def __init__(self): """ OuterEnum - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - - } - - self.attribute_map = { - - } - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well def to_dict(self): """ diff --git a/samples/client/petstore/python/petstore_api/models/outer_number.py b/samples/client/petstore/python/petstore_api/models/outer_number.py new file mode 100644 index 00000000000..93087bff27c --- /dev/null +++ b/samples/client/petstore/python/petstore_api/models/outer_number.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + 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 + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class OuterNumber(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + def __init__(self): + """ + OuterNumber - a model defined in Swagger + + :param dict swaggerTypes: The key is attribute name + and the value is attribute type. + :param dict attributeMap: The key is attribute name + and the value is json key in definition. + """ + self.swagger_types = { + + } + + self.attribute_map = { + + } + + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, OuterNumber): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/outer_string.py b/samples/client/petstore/python/petstore_api/models/outer_string.py new file mode 100644 index 00000000000..dab30f6aca7 --- /dev/null +++ b/samples/client/petstore/python/petstore_api/models/outer_string.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + 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 + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from pprint import pformat +from six import iteritems +import re + + +class OuterString(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + def __init__(self): + """ + OuterString - a model defined in Swagger + + :param dict swaggerTypes: The key is attribute name + and the value is attribute type. + :param dict attributeMap: The key is attribute name + and the value is json key in definition. + """ + self.swagger_types = { + + } + + self.attribute_map = { + + } + + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, OuterString): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/pet.py b/samples/client/petstore/python/petstore_api/models/pet.py index e32e779fbd4..e33c0144ead 100644 --- a/samples/client/petstore/python/petstore_api/models/pet.py +++ b/samples/client/petstore/python/petstore_api/models/pet.py @@ -21,32 +21,37 @@ class Pet(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'category': 'Category', + 'name': 'str', + 'photo_urls': 'list[str]', + 'tags': 'list[Tag]', + 'status': 'str' + } + + attribute_map = { + 'id': 'id', + 'category': 'category', + 'name': 'name', + 'photo_urls': 'photoUrls', + 'tags': 'tags', + 'status': 'status' + } + def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): """ Pet - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'id': 'int', - 'category': 'Category', - 'name': 'str', - 'photo_urls': 'list[str]', - 'tags': 'list[Tag]', - 'status': 'str' - } - - self.attribute_map = { - 'id': 'id', - 'category': 'category', - 'name': 'name', - 'photo_urls': 'photoUrls', - 'tags': 'tags', - 'status': 'status' - } self._id = None self._category = None @@ -55,17 +60,12 @@ class Pet(object): self._tags = None self._status = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if id is not None: self.id = id if category is not None: self.category = category - if name is not None: - self.name = name - if photo_urls is not None: - self.photo_urls = photo_urls + self.name = name + self.photo_urls = photo_urls if tags is not None: self.tags = tags if status is not None: diff --git a/samples/client/petstore/python/petstore_api/models/read_only_first.py b/samples/client/petstore/python/petstore_api/models/read_only_first.py index a3446564d32..d4e9053ffe4 100644 --- a/samples/client/petstore/python/petstore_api/models/read_only_first.py +++ b/samples/client/petstore/python/petstore_api/models/read_only_first.py @@ -21,31 +21,33 @@ class ReadOnlyFirst(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'bar': 'str', + 'baz': 'str' + } + + attribute_map = { + 'bar': 'bar', + 'baz': 'baz' + } + def __init__(self, bar=None, baz=None): """ ReadOnlyFirst - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'bar': 'str', - 'baz': 'str' - } - - self.attribute_map = { - 'bar': 'bar', - 'baz': 'baz' - } self._bar = None self._baz = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if bar is not None: self.bar = bar if baz is not None: diff --git a/samples/client/petstore/python/petstore_api/models/special_model_name.py b/samples/client/petstore/python/petstore_api/models/special_model_name.py index e4893b92d45..5970dbbbd0d 100644 --- a/samples/client/petstore/python/petstore_api/models/special_model_name.py +++ b/samples/client/petstore/python/petstore_api/models/special_model_name.py @@ -21,28 +21,30 @@ class SpecialModelName(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'special_property_name': 'int' + } + + attribute_map = { + 'special_property_name': '$special[property.name]' + } + def __init__(self, special_property_name=None): """ SpecialModelName - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'special_property_name': 'int' - } - - self.attribute_map = { - 'special_property_name': '$special[property.name]' - } self._special_property_name = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if special_property_name is not None: self.special_property_name = special_property_name diff --git a/samples/client/petstore/python/petstore_api/models/tag.py b/samples/client/petstore/python/petstore_api/models/tag.py index 986769a3df3..2406ca40f4d 100644 --- a/samples/client/petstore/python/petstore_api/models/tag.py +++ b/samples/client/petstore/python/petstore_api/models/tag.py @@ -21,31 +21,33 @@ class Tag(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + def __init__(self, id=None, name=None): """ Tag - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'id': 'int', - 'name': 'str' - } - - self.attribute_map = { - 'id': 'id', - 'name': 'name' - } self._id = None self._name = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if id is not None: self.id = id if name is not None: diff --git a/samples/client/petstore/python/petstore_api/models/user.py b/samples/client/petstore/python/petstore_api/models/user.py index dd360263756..54280c00cfe 100644 --- a/samples/client/petstore/python/petstore_api/models/user.py +++ b/samples/client/petstore/python/petstore_api/models/user.py @@ -21,36 +21,41 @@ class User(object): NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'username': 'str', + 'first_name': 'str', + 'last_name': 'str', + 'email': 'str', + 'password': 'str', + 'phone': 'str', + 'user_status': 'int' + } + + attribute_map = { + 'id': 'id', + 'username': 'username', + 'first_name': 'firstName', + 'last_name': 'lastName', + 'email': 'email', + 'password': 'password', + 'phone': 'phone', + 'user_status': 'userStatus' + } + def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): """ User - a model defined in Swagger - - :param dict swaggerTypes: The key is attribute name - and the value is attribute type. - :param dict attributeMap: The key is attribute name - and the value is json key in definition. """ - self.swagger_types = { - 'id': 'int', - 'username': 'str', - 'first_name': 'str', - 'last_name': 'str', - 'email': 'str', - 'password': 'str', - 'phone': 'str', - 'user_status': 'int' - } - - self.attribute_map = { - 'id': 'id', - 'username': 'username', - 'first_name': 'firstName', - 'last_name': 'lastName', - 'email': 'email', - 'password': 'password', - 'phone': 'phone', - 'user_status': 'userStatus' - } self._id = None self._username = None @@ -61,9 +66,6 @@ class User(object): self._phone = None self._user_status = None - # TODO: let required properties as mandatory parameter in the constructor. - # - to check if required property is not None (e.g. by calling setter) - # - ApiClient.__deserialize_model has to be adapted as well if id is not None: self.id = id if username is not None: diff --git a/samples/client/petstore/python/test/test_additional_properties_class.py b/samples/client/petstore/python/test/test_additional_properties_class.py index de3d2bcd8b6..36fa7fb3a18 100644 --- a/samples/client/petstore/python/test/test_additional_properties_class.py +++ b/samples/client/petstore/python/test/test_additional_properties_class.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestAdditionalPropertiesClass(unittest.TestCase): """ Test AdditionalPropertiesClass """ - model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() + # FIXME: construct object with required attributes + #model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_animal.py b/samples/client/petstore/python/test/test_animal.py index 7db98a10170..67eba1eaffb 100644 --- a/samples/client/petstore/python/test/test_animal.py +++ b/samples/client/petstore/python/test/test_animal.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestAnimal(unittest.TestCase): """ Test Animal """ - model = petstore_api.models.animal.Animal() + # FIXME: construct object with required attributes + #model = petstore_api.models.animal.Animal() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_animal_farm.py b/samples/client/petstore/python/test/test_animal_farm.py index e4ecbf50478..d8610735ec6 100644 --- a/samples/client/petstore/python/test/test_animal_farm.py +++ b/samples/client/petstore/python/test/test_animal_farm.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestAnimalFarm(unittest.TestCase): """ Test AnimalFarm """ - model = petstore_api.models.animal_farm.AnimalFarm() + # FIXME: construct object with required attributes + #model = petstore_api.models.animal_farm.AnimalFarm() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_api_response.py b/samples/client/petstore/python/test/test_api_response.py index 9c62f641cd7..766c0a93f85 100644 --- a/samples/client/petstore/python/test/test_api_response.py +++ b/samples/client/petstore/python/test/test_api_response.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestApiResponse(unittest.TestCase): """ Test ApiResponse """ - model = petstore_api.models.api_response.ApiResponse() + # FIXME: construct object with required attributes + #model = petstore_api.models.api_response.ApiResponse() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python/test/test_array_of_array_of_number_only.py index 2c39b558201..d095b23abf2 100644 --- a/samples/client/petstore/python/test/test_array_of_array_of_number_only.py +++ b/samples/client/petstore/python/test/test_array_of_array_of_number_only.py @@ -8,20 +8,9 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestArrayOfArrayOfNumberOnly(unittest.TestCase): """ Test ArrayOfArrayOfNumberOnly """ - model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() + # FIXME: construct object with required attributes + #model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_array_of_number_only.py b/samples/client/petstore/python/test/test_array_of_number_only.py index 8b8a01ce1e6..24c5adb8299 100644 --- a/samples/client/petstore/python/test/test_array_of_number_only.py +++ b/samples/client/petstore/python/test/test_array_of_number_only.py @@ -8,20 +8,9 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestArrayOfNumberOnly(unittest.TestCase): """ Test ArrayOfNumberOnly """ - model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() + # FIXME: construct object with required attributes + #model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_array_test.py b/samples/client/petstore/python/test/test_array_test.py index a5509779cc5..99c0f4d2b67 100644 --- a/samples/client/petstore/python/test/test_array_test.py +++ b/samples/client/petstore/python/test/test_array_test.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestArrayTest(unittest.TestCase): """ Test ArrayTest """ - model = petstore_api.models.array_test.ArrayTest() + # FIXME: construct object with required attributes + #model = petstore_api.models.array_test.ArrayTest() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_capitalization.py b/samples/client/petstore/python/test/test_capitalization.py index 1415107dcdc..f903de14261 100644 --- a/samples/client/petstore/python/test/test_capitalization.py +++ b/samples/client/petstore/python/test/test_capitalization.py @@ -35,7 +35,9 @@ class TestCapitalization(unittest.TestCase): """ Test Capitalization """ - model = petstore_api.models.capitalization.Capitalization() + # FIXME: construct object with required attributes + #model = petstore_api.models.capitalization.Capitalization() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_cat.py b/samples/client/petstore/python/test/test_cat.py index 3a9f7f1b75d..39a2d63b147 100644 --- a/samples/client/petstore/python/test/test_cat.py +++ b/samples/client/petstore/python/test/test_cat.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestCat(unittest.TestCase): """ Test Cat """ - model = petstore_api.models.cat.Cat() + # FIXME: construct object with required attributes + #model = petstore_api.models.cat.Cat() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_category.py b/samples/client/petstore/python/test/test_category.py index f4f43796675..87868e6bb8f 100644 --- a/samples/client/petstore/python/test/test_category.py +++ b/samples/client/petstore/python/test/test_category.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestCategory(unittest.TestCase): """ Test Category """ - model = petstore_api.models.category.Category() + # FIXME: construct object with required attributes + #model = petstore_api.models.category.Category() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_class_model.py b/samples/client/petstore/python/test/test_class_model.py index e502152ee8b..b9afda56e48 100644 --- a/samples/client/petstore/python/test/test_class_model.py +++ b/samples/client/petstore/python/test/test_class_model.py @@ -35,7 +35,9 @@ class TestClassModel(unittest.TestCase): """ Test ClassModel """ - model = petstore_api.models.class_model.ClassModel() + # FIXME: construct object with required attributes + #model = petstore_api.models.class_model.ClassModel() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_client.py b/samples/client/petstore/python/test/test_client.py index fe52aafed9b..07af5e40c3a 100644 --- a/samples/client/petstore/python/test/test_client.py +++ b/samples/client/petstore/python/test/test_client.py @@ -8,20 +8,9 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestClient(unittest.TestCase): """ Test Client """ - model = petstore_api.models.client.Client() + # FIXME: construct object with required attributes + #model = petstore_api.models.client.Client() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_dog.py b/samples/client/petstore/python/test/test_dog.py index 6bac6d65c30..3f1654ffc88 100644 --- a/samples/client/petstore/python/test/test_dog.py +++ b/samples/client/petstore/python/test/test_dog.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestDog(unittest.TestCase): """ Test Dog """ - model = petstore_api.models.dog.Dog() + # FIXME: construct object with required attributes + #model = petstore_api.models.dog.Dog() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_enum_arrays.py b/samples/client/petstore/python/test/test_enum_arrays.py index ba9c899530b..844c7f92294 100644 --- a/samples/client/petstore/python/test/test_enum_arrays.py +++ b/samples/client/petstore/python/test/test_enum_arrays.py @@ -8,20 +8,9 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestEnumArrays(unittest.TestCase): """ Test EnumArrays """ - model = petstore_api.models.enum_arrays.EnumArrays() + # FIXME: construct object with required attributes + #model = petstore_api.models.enum_arrays.EnumArrays() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_enum_class.py b/samples/client/petstore/python/test/test_enum_class.py index 6d9c50255df..71c9461b299 100644 --- a/samples/client/petstore/python/test/test_enum_class.py +++ b/samples/client/petstore/python/test/test_enum_class.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestEnumClass(unittest.TestCase): """ Test EnumClass """ - model = petstore_api.models.enum_class.EnumClass() + # FIXME: construct object with required attributes + #model = petstore_api.models.enum_class.EnumClass() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_enum_test.py b/samples/client/petstore/python/test/test_enum_test.py index aa8d86a6d78..3f3f5f51159 100644 --- a/samples/client/petstore/python/test/test_enum_test.py +++ b/samples/client/petstore/python/test/test_enum_test.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestEnumTest(unittest.TestCase): """ Test EnumTest """ - model = petstore_api.models.enum_test.EnumTest() + # FIXME: construct object with required attributes + #model = petstore_api.models.enum_test.EnumTest() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_fake_api.py b/samples/client/petstore/python/test/test_fake_api.py index cddf28289ba..575978dff3f 100644 --- a/samples/client/petstore/python/test/test_fake_api.py +++ b/samples/client/petstore/python/test/test_fake_api.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -42,6 +31,14 @@ class TestFakeApi(unittest.TestCase): def tearDown(self): pass + def test_test_client_model(self): + """ + Test case for test_client_model + + To test \"client\" model + """ + pass + def test_test_endpoint_parameters(self): """ Test case for test_endpoint_parameters @@ -50,6 +47,14 @@ class TestFakeApi(unittest.TestCase): """ pass + def test_test_enum_parameters(self): + """ + Test case for test_enum_parameters + + To test enum parameters + """ + pass + if __name__ == '__main__': unittest.main() diff --git a/samples/client/petstore/python/test/test_format_test.py b/samples/client/petstore/python/test/test_format_test.py index 2c3d0039dce..a9e92f0d276 100644 --- a/samples/client/petstore/python/test/test_format_test.py +++ b/samples/client/petstore/python/test/test_format_test.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestFormatTest(unittest.TestCase): """ Test FormatTest """ - model = petstore_api.models.format_test.FormatTest() + # FIXME: construct object with required attributes + #model = petstore_api.models.format_test.FormatTest() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_has_only_read_only.py b/samples/client/petstore/python/test/test_has_only_read_only.py index 5170daeec25..454a17429c5 100644 --- a/samples/client/petstore/python/test/test_has_only_read_only.py +++ b/samples/client/petstore/python/test/test_has_only_read_only.py @@ -8,20 +8,9 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestHasOnlyReadOnly(unittest.TestCase): """ Test HasOnlyReadOnly """ - model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() + # FIXME: construct object with required attributes + #model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_list.py b/samples/client/petstore/python/test/test_list.py index 5558d752cd0..1c55f1ae425 100644 --- a/samples/client/petstore/python/test/test_list.py +++ b/samples/client/petstore/python/test/test_list.py @@ -8,20 +8,9 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestList(unittest.TestCase): """ Test List """ - model = petstore_api.models.list.List() + # FIXME: construct object with required attributes + #model = petstore_api.models.list.List() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_map_test.py b/samples/client/petstore/python/test/test_map_test.py index e346d7685b6..5eadb021be1 100644 --- a/samples/client/petstore/python/test/test_map_test.py +++ b/samples/client/petstore/python/test/test_map_test.py @@ -8,20 +8,9 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestMapTest(unittest.TestCase): """ Test MapTest """ - model = petstore_api.models.map_test.MapTest() + # FIXME: construct object with required attributes + #model = petstore_api.models.map_test.MapTest() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py index 90f13e029e2..8b2ee454655 100644 --- a/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): """ Test MixedPropertiesAndAdditionalPropertiesClass """ - model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() + # FIXME: construct object with required attributes + #model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_model_200_response.py b/samples/client/petstore/python/test/test_model_200_response.py index 0b30fa81c89..c3d0367d39a 100644 --- a/samples/client/petstore/python/test/test_model_200_response.py +++ b/samples/client/petstore/python/test/test_model_200_response.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestModel200Response(unittest.TestCase): """ Test Model200Response """ - model = petstore_api.models.model_200_response.Model200Response() + # FIXME: construct object with required attributes + #model = petstore_api.models.model_200_response.Model200Response() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_model_return.py b/samples/client/petstore/python/test/test_model_return.py index 149d658c7cf..13c683ee46a 100644 --- a/samples/client/petstore/python/test/test_model_return.py +++ b/samples/client/petstore/python/test/test_model_return.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestModelReturn(unittest.TestCase): """ Test ModelReturn """ - model = petstore_api.models.model_return.ModelReturn() + # FIXME: construct object with required attributes + #model = petstore_api.models.model_return.ModelReturn() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_name.py b/samples/client/petstore/python/test/test_name.py index ae3b6106d62..2b972303fb1 100644 --- a/samples/client/petstore/python/test/test_name.py +++ b/samples/client/petstore/python/test/test_name.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestName(unittest.TestCase): """ Test Name """ - model = petstore_api.models.name.Name() + # FIXME: construct object with required attributes + #model = petstore_api.models.name.Name() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_number_only.py b/samples/client/petstore/python/test/test_number_only.py index a1056c92c7d..a05bfd5ffe2 100644 --- a/samples/client/petstore/python/test/test_number_only.py +++ b/samples/client/petstore/python/test/test_number_only.py @@ -8,20 +8,9 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestNumberOnly(unittest.TestCase): """ Test NumberOnly """ - model = petstore_api.models.number_only.NumberOnly() + # FIXME: construct object with required attributes + #model = petstore_api.models.number_only.NumberOnly() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_order.py b/samples/client/petstore/python/test/test_order.py index e2a1290ffc7..cc181aad7da 100644 --- a/samples/client/petstore/python/test/test_order.py +++ b/samples/client/petstore/python/test/test_order.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestOrder(unittest.TestCase): """ Test Order """ - model = petstore_api.models.order.Order() + # FIXME: construct object with required attributes + #model = petstore_api.models.order.Order() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python/test/test_outer_boolean.py similarity index 61% rename from samples/client/petstore/python/test/test_fake_classname_tags_123_api.py rename to samples/client/petstore/python/test/test_outer_boolean.py index 7a11a2378bf..082b05cf928 100644 --- a/samples/client/petstore/python/test/test_fake_classname_tags_123_api.py +++ b/samples/client/petstore/python/test/test_outer_boolean.py @@ -19,25 +19,23 @@ import unittest import petstore_api from petstore_api.rest import ApiException -from petstore_api.apis.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.models.outer_boolean import OuterBoolean -class TestFakeClassnameTags123Api(unittest.TestCase): - """ FakeClassnameTags123Api unit test stubs """ +class TestOuterBoolean(unittest.TestCase): + """ OuterBoolean unit test stubs """ def setUp(self): - self.api = petstore_api.apis.fake_classname_tags_123_api.FakeClassnameTags123Api() + pass def tearDown(self): pass - def test_test_classname(self): + def testOuterBoolean(self): """ - Test case for test_classname - - To test class name in snake case + Test OuterBoolean """ - pass + model = petstore_api.models.outer_boolean.OuterBoolean() if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_outer_composite.py b/samples/client/petstore/python/test/test_outer_composite.py new file mode 100644 index 00000000000..fa084c04bf2 --- /dev/null +++ b/samples/client/petstore/python/test/test_outer_composite.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + 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 + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.outer_composite import OuterComposite + + +class TestOuterComposite(unittest.TestCase): + """ OuterComposite unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterComposite(self): + """ + Test OuterComposite + """ + model = petstore_api.models.outer_composite.OuterComposite() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_outer_enum.py b/samples/client/petstore/python/test/test_outer_enum.py index 75d8cf32a1e..203212883e5 100644 --- a/samples/client/petstore/python/test/test_outer_enum.py +++ b/samples/client/petstore/python/test/test_outer_enum.py @@ -35,7 +35,9 @@ class TestOuterEnum(unittest.TestCase): """ Test OuterEnum """ - model = petstore_api.models.outer_enum.OuterEnum() + # FIXME: construct object with required attributes + #model = petstore_api.models.outer_enum.OuterEnum() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_outer_number.py b/samples/client/petstore/python/test/test_outer_number.py new file mode 100644 index 00000000000..4019b356bc4 --- /dev/null +++ b/samples/client/petstore/python/test/test_outer_number.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + 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 + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.outer_number import OuterNumber + + +class TestOuterNumber(unittest.TestCase): + """ OuterNumber unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterNumber(self): + """ + Test OuterNumber + """ + model = petstore_api.models.outer_number.OuterNumber() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_outer_string.py b/samples/client/petstore/python/test/test_outer_string.py new file mode 100644 index 00000000000..a23c7815efe --- /dev/null +++ b/samples/client/petstore/python/test/test_outer_string.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + 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 + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException +from petstore_api.models.outer_string import OuterString + + +class TestOuterString(unittest.TestCase): + """ OuterString unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterString(self): + """ + Test OuterString + """ + model = petstore_api.models.outer_string.OuterString() + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_pet.py b/samples/client/petstore/python/test/test_pet.py index 9148c0ac119..7da7d887e42 100644 --- a/samples/client/petstore/python/test/test_pet.py +++ b/samples/client/petstore/python/test/test_pet.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestPet(unittest.TestCase): """ Test Pet """ - model = petstore_api.models.pet.Pet() + # FIXME: construct object with required attributes + #model = petstore_api.models.pet.Pet() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_pet_api.py b/samples/client/petstore/python/test/test_pet_api.py index c9ef2d87c45..1eafc35b28c 100644 --- a/samples/client/petstore/python/test/test_pet_api.py +++ b/samples/client/petstore/python/test/test_pet_api.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os diff --git a/samples/client/petstore/python/test/test_read_only_first.py b/samples/client/petstore/python/test/test_read_only_first.py index 3579ebefb48..42a402f7658 100644 --- a/samples/client/petstore/python/test/test_read_only_first.py +++ b/samples/client/petstore/python/test/test_read_only_first.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestReadOnlyFirst(unittest.TestCase): """ Test ReadOnlyFirst """ - model = petstore_api.models.read_only_first.ReadOnlyFirst() + # FIXME: construct object with required attributes + #model = petstore_api.models.read_only_first.ReadOnlyFirst() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_special_model_name.py b/samples/client/petstore/python/test/test_special_model_name.py index 1991883e3c1..f6e59a4b3ce 100644 --- a/samples/client/petstore/python/test/test_special_model_name.py +++ b/samples/client/petstore/python/test/test_special_model_name.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestSpecialModelName(unittest.TestCase): """ Test SpecialModelName """ - model = petstore_api.models.special_model_name.SpecialModelName() + # FIXME: construct object with required attributes + #model = petstore_api.models.special_model_name.SpecialModelName() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_store_api.py b/samples/client/petstore/python/test/test_store_api.py index 0278685372b..f131b6068b2 100644 --- a/samples/client/petstore/python/test/test_store_api.py +++ b/samples/client/petstore/python/test/test_store_api.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os diff --git a/samples/client/petstore/python/test/test_tag.py b/samples/client/petstore/python/test/test_tag.py index c86dcbb1d5f..0975bcf9b67 100644 --- a/samples/client/petstore/python/test/test_tag.py +++ b/samples/client/petstore/python/test/test_tag.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestTag(unittest.TestCase): """ Test Tag """ - model = petstore_api.models.tag.Tag() + # FIXME: construct object with required attributes + #model = petstore_api.models.tag.Tag() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_user.py b/samples/client/petstore/python/test/test_user.py index 328c07baa88..a2c2d941d44 100644 --- a/samples/client/petstore/python/test/test_user.py +++ b/samples/client/petstore/python/test/test_user.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os @@ -46,7 +35,9 @@ class TestUser(unittest.TestCase): """ Test User """ - model = petstore_api.models.user.User() + # FIXME: construct object with required attributes + #model = petstore_api.models.user.User() + pass if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_user_api.py b/samples/client/petstore/python/test/test_user_api.py index 032d00af315..3e0be964a2d 100644 --- a/samples/client/petstore/python/test/test_user_api.py +++ b/samples/client/petstore/python/test/test_user_api.py @@ -3,25 +3,14 @@ """ 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: \" \\ + 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 Generated by: https://github.com/swagger-api/swagger-codegen.git - - 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. """ + from __future__ import absolute_import import os diff --git a/samples/client/petstore/python/tests/test_api_client.py b/samples/client/petstore/python/tests/test_api_client.py index aa42eeae4ba..0564a69686b 100644 --- a/samples/client/petstore/python/tests/test_api_client.py +++ b/samples/client/petstore/python/tests/test_api_client.py @@ -144,9 +144,8 @@ class ApiClientTests(unittest.TestCase): "status": "available", "photoUrls": ["http://foo.bar.com/3", "http://foo.bar.com/4"]} - pet = petstore_api.Pet() + pet = petstore_api.Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"]) pet.id = pet_dict["id"] - pet.name = pet_dict["name"] cate = petstore_api.Category() cate.id = pet_dict["category"]["id"] cate.name = pet_dict["category"]["name"] @@ -159,7 +158,6 @@ class ApiClientTests(unittest.TestCase): tag2.name = pet_dict["tags"][1]["name"] pet.tags = [tag1, tag2] pet.status = pet_dict["status"] - pet.photo_urls = pet_dict["photoUrls"] data = pet result = self.api_client.sanitize_for_serialization(data) diff --git a/samples/client/petstore/python/tests/test_api_exception.py b/samples/client/petstore/python/tests/test_api_exception.py index d1f9dbaa6f2..82c825875d0 100644 --- a/samples/client/petstore/python/tests/test_api_exception.py +++ b/samples/client/petstore/python/tests/test_api_exception.py @@ -30,10 +30,8 @@ class ApiExceptionTests(unittest.TestCase): self.tag = petstore_api.Tag() self.tag.id = id_gen() self.tag.name = "blank" - self.pet = petstore_api.Pet() + self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) self.pet.id = id_gen() - self.pet.name = "hello kity" - self.pet.photo_urls = ["http://foo.bar.com/1", "http://foo.bar.com/2"] self.pet.status = "sold" self.pet.category = self.category self.pet.tags = [self.tag] diff --git a/samples/client/petstore/python/tests/test_deserialization.py b/samples/client/petstore/python/tests/test_deserialization.py index 143f22b64bd..737ed9ea2cf 100644 --- a/samples/client/petstore/python/tests/test_deserialization.py +++ b/samples/client/petstore/python/tests/test_deserialization.py @@ -20,6 +20,26 @@ class DeserializationTests(unittest.TestCase): self.api_client = petstore_api.ApiClient() self.deserialize = self.api_client._ApiClient__deserialize + def test_enum_test(self): + """ deserialize dict(str, Enum_Test) """ + data = { + 'enum_test': { + "enum_string": "UPPER", + "enum_integer": 1, + "enum_number": 1.1, + "outerEnum": "placed" + } + } + + deserialized = self.deserialize(data, 'dict(str, EnumTest)') + self.assertTrue(isinstance(deserialized, dict)) + self.assertTrue(isinstance(deserialized['enum_test'], petstore_api.EnumTest)) + self.assertEqual(deserialized['enum_test'], + petstore_api.EnumTest(enum_string="UPPER", + enum_integer=1, + enum_number=1.1, + outer_enum=petstore_api.OuterEnum.PLACED)) + def test_deserialize_dict_str_pet(self): """ deserialize dict(str, Pet) """ data = { diff --git a/samples/client/petstore/python/tests/test_pet_api.py b/samples/client/petstore/python/tests/test_pet_api.py index 6d87486b986..6dd6dce1d5a 100644 --- a/samples/client/petstore/python/tests/test_pet_api.py +++ b/samples/client/petstore/python/tests/test_pet_api.py @@ -65,10 +65,8 @@ class PetApiTests(unittest.TestCase): self.tag = petstore_api.Tag() self.tag.id = id_gen() self.tag.name = "swagger-codegen-python-pet-tag" - self.pet = petstore_api.Pet() + self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) self.pet.id = id_gen() - self.pet.name = "hello kity" - self.pet.photo_urls = ["http://foo.bar.com/1", "http://foo.bar.com/2"] self.pet.status = "sold" self.pet.category = self.category self.pet.tags = [self.tag] diff --git a/samples/client/petstore/python/tests/test_pet_model.py b/samples/client/petstore/python/tests/test_pet_model.py index 52cb55061da..3ecb5ec85ba 100644 --- a/samples/client/petstore/python/tests/test_pet_model.py +++ b/samples/client/petstore/python/tests/test_pet_model.py @@ -17,10 +17,8 @@ import petstore_api class PetModelTests(unittest.TestCase): def setUp(self): - self.pet = petstore_api.Pet() - self.pet.name = "test name" + self.pet = petstore_api.Pet(name="test name", photo_urls=["string"]) self.pet.id = 1 - self.pet.photo_urls = ["string"] self.pet.status = "available" cate = petstore_api.Category() cate.id = 1 @@ -40,10 +38,8 @@ class PetModelTests(unittest.TestCase): self.assertEqual(data, self.pet.to_str()) def test_equal(self): - self.pet1 = petstore_api.Pet() - self.pet1.name = "test name" + self.pet1 = petstore_api.Pet(name="test name", photo_urls=["string"]) self.pet1.id = 1 - self.pet1.photo_urls = ["string"] self.pet1.status = "available" cate1 = petstore_api.Category() cate1.id = 1 @@ -53,10 +49,8 @@ class PetModelTests(unittest.TestCase): tag1.id = 1 self.pet1.tags = [tag1] - self.pet2 = petstore_api.Pet() - self.pet2.name = "test name" + self.pet2 = petstore_api.Pet(name="test name", photo_urls=["string"]) self.pet2.id = 1 - self.pet2.photo_urls = ["string"] self.pet2.status = "available" cate2 = petstore_api.Category() cate2.id = 1 diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 658d3ecda5a..969f4049974 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -56,15 +56,15 @@ require 'petstore' api_instance = Petstore::FakeApi.new -body = Petstore::Client.new # Client | client model - +opts = { + body: Petstore::OuterBoolean.new # OuterBoolean | Input boolean as post body +} begin - #To test \"client\" model - result = api_instance.test_client_model(body) + result = api_instance.fake_outer_boolean_serialize(opts) p result rescue Petstore::ApiError => e - puts "Exception when calling FakeApi->test_client_model: #{e}" + puts "Exception when calling FakeApi->fake_outer_boolean_serialize: #{e}" end ``` @@ -75,6 +75,10 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +*Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +*Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +*Petstore::FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | *Petstore::FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model *Petstore::FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *Petstore::FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters @@ -129,7 +133,11 @@ Class | Method | HTTP request | Description - [Petstore::Name](docs/Name.md) - [Petstore::NumberOnly](docs/NumberOnly.md) - [Petstore::Order](docs/Order.md) + - [Petstore::OuterBoolean](docs/OuterBoolean.md) + - [Petstore::OuterComposite](docs/OuterComposite.md) - [Petstore::OuterEnum](docs/OuterEnum.md) + - [Petstore::OuterNumber](docs/OuterNumber.md) + - [Petstore::OuterString](docs/OuterString.md) - [Petstore::Pet](docs/Pet.md) - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Petstore::SpecialModelName](docs/SpecialModelName.md) diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index 9d973dec95c..70cf50ad999 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -4,11 +4,203 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model [**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +# **fake_outer_boolean_serialize** +> OuterBoolean fake_outer_boolean_serialize(opts) + + + +Test serialization of outer boolean types + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new + +opts = { + body: Petstore::OuterBoolean.new # OuterBoolean | Input boolean as post body +} + +begin + result = api_instance.fake_outer_boolean_serialize(opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_outer_boolean_serialize: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + +### Return type + +[**OuterBoolean**](OuterBoolean.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + + +# **fake_outer_composite_serialize** +> OuterComposite fake_outer_composite_serialize(opts) + + + +Test serialization of object with outer number type + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new + +opts = { + body: Petstore::OuterComposite.new # OuterComposite | Input composite as post body +} + +begin + result = api_instance.fake_outer_composite_serialize(opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_outer_composite_serialize: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + + +# **fake_outer_number_serialize** +> OuterNumber fake_outer_number_serialize(opts) + + + +Test serialization of outer number types + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new + +opts = { + body: Petstore::OuterNumber.new # OuterNumber | Input number as post body +} + +begin + result = api_instance.fake_outer_number_serialize(opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_outer_number_serialize: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + +### Return type + +[**OuterNumber**](OuterNumber.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + + +# **fake_outer_string_serialize** +> OuterString fake_outer_string_serialize(opts) + + + +Test serialization of outer string types + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new + +opts = { + body: Petstore::OuterString.new # OuterString | Input string as post body +} + +begin + result = api_instance.fake_outer_string_serialize(opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_outer_string_serialize: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + +### Return type + +[**OuterString**](OuterString.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + + # **test_client_model** > Client test_client_model(body) diff --git a/samples/client/petstore/ruby/docs/OuterBoolean.md b/samples/client/petstore/ruby/docs/OuterBoolean.md new file mode 100644 index 00000000000..99ef646b200 --- /dev/null +++ b/samples/client/petstore/ruby/docs/OuterBoolean.md @@ -0,0 +1,7 @@ +# Petstore::OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/ruby/docs/OuterComposite.md b/samples/client/petstore/ruby/docs/OuterComposite.md new file mode 100644 index 00000000000..61b46c8c931 --- /dev/null +++ b/samples/client/petstore/ruby/docs/OuterComposite.md @@ -0,0 +1,10 @@ +# Petstore::OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**my_number** | [**OuterNumber**](OuterNumber.md) | | [optional] +**my_string** | [**OuterString**](OuterString.md) | | [optional] +**my_boolean** | [**OuterBoolean**](OuterBoolean.md) | | [optional] + + diff --git a/samples/client/petstore/ruby/docs/OuterNumber.md b/samples/client/petstore/ruby/docs/OuterNumber.md new file mode 100644 index 00000000000..a9da0d32d80 --- /dev/null +++ b/samples/client/petstore/ruby/docs/OuterNumber.md @@ -0,0 +1,7 @@ +# Petstore::OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/ruby/docs/OuterString.md b/samples/client/petstore/ruby/docs/OuterString.md new file mode 100644 index 00000000000..33942e53b1f --- /dev/null +++ b/samples/client/petstore/ruby/docs/OuterString.md @@ -0,0 +1,7 @@ +# Petstore::OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 53946d1a133..e1125879c47 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -43,7 +43,11 @@ require 'petstore/models/model_return' require 'petstore/models/name' require 'petstore/models/number_only' require 'petstore/models/order' +require 'petstore/models/outer_boolean' +require 'petstore/models/outer_composite' require 'petstore/models/outer_enum' +require 'petstore/models/outer_number' +require 'petstore/models/outer_string' require 'petstore/models/pet' require 'petstore/models/read_only_first' require 'petstore/models/special_model_name' 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 ca371301da9..adf79a57448 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -20,6 +20,194 @@ module Petstore @api_client = api_client end + # + # Test serialization of outer boolean types + # @param [Hash] opts the optional parameters + # @option opts [OuterBoolean] :body Input boolean as post body + # @return [OuterBoolean] + def fake_outer_boolean_serialize(opts = {}) + data, _status_code, _headers = fake_outer_boolean_serialize_with_http_info(opts) + return data + end + + # + # Test serialization of outer boolean types + # @param [Hash] opts the optional parameters + # @option opts [OuterBoolean] :body Input boolean as post body + # @return [Array<(OuterBoolean, Fixnum, Hash)>] OuterBoolean data, response status code and response headers + def fake_outer_boolean_serialize_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: FakeApi.fake_outer_boolean_serialize ..." + end + # resource path + local_var_path = "/fake/outer/boolean" + + # query parameters + query_params = {} + + # header parameters + header_params = {} + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(opts[:'body']) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'OuterBoolean') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_outer_boolean_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # + # Test serialization of object with outer number type + # @param [Hash] opts the optional parameters + # @option opts [OuterComposite] :body Input composite as post body + # @return [OuterComposite] + def fake_outer_composite_serialize(opts = {}) + data, _status_code, _headers = fake_outer_composite_serialize_with_http_info(opts) + return data + end + + # + # Test serialization of object with outer number type + # @param [Hash] opts the optional parameters + # @option opts [OuterComposite] :body Input composite as post body + # @return [Array<(OuterComposite, Fixnum, Hash)>] OuterComposite data, response status code and response headers + def fake_outer_composite_serialize_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: FakeApi.fake_outer_composite_serialize ..." + end + # resource path + local_var_path = "/fake/outer/composite" + + # query parameters + query_params = {} + + # header parameters + header_params = {} + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(opts[:'body']) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'OuterComposite') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_outer_composite_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # + # Test serialization of outer number types + # @param [Hash] opts the optional parameters + # @option opts [OuterNumber] :body Input number as post body + # @return [OuterNumber] + def fake_outer_number_serialize(opts = {}) + data, _status_code, _headers = fake_outer_number_serialize_with_http_info(opts) + return data + end + + # + # Test serialization of outer number types + # @param [Hash] opts the optional parameters + # @option opts [OuterNumber] :body Input number as post body + # @return [Array<(OuterNumber, Fixnum, Hash)>] OuterNumber data, response status code and response headers + def fake_outer_number_serialize_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: FakeApi.fake_outer_number_serialize ..." + end + # resource path + local_var_path = "/fake/outer/number" + + # query parameters + query_params = {} + + # header parameters + header_params = {} + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(opts[:'body']) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'OuterNumber') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_outer_number_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # + # Test serialization of outer string types + # @param [Hash] opts the optional parameters + # @option opts [OuterString] :body Input string as post body + # @return [OuterString] + def fake_outer_string_serialize(opts = {}) + data, _status_code, _headers = fake_outer_string_serialize_with_http_info(opts) + return data + end + + # + # Test serialization of outer string types + # @param [Hash] opts the optional parameters + # @option opts [OuterString] :body Input string as post body + # @return [Array<(OuterString, Fixnum, Hash)>] OuterString data, response status code and response headers + def fake_outer_string_serialize_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: FakeApi.fake_outer_string_serialize ..." + end + # resource path + local_var_path = "/fake/outer/string" + + # query parameters + query_params = {} + + # header parameters + header_params = {} + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(opts[:'body']) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'OuterString') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_outer_string_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # To test \"client\" model # To test \"client\" model # @param body client model diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_boolean.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_boolean.rb new file mode 100644 index 00000000000..a5c47be992e --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_boolean.rb @@ -0,0 +1,178 @@ +=begin +#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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module Petstore + + class OuterBoolean + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + } + end + + # Attribute type mapping. + def self.swagger_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 properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return 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? + return 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.swagger_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/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb new file mode 100644 index 00000000000..0d642a575c5 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -0,0 +1,205 @@ +=begin +#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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module Petstore + + class OuterComposite + attr_accessor :my_number + + attr_accessor :my_string + + attr_accessor :my_boolean + + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'my_number' => :'my_number', + :'my_string' => :'my_string', + :'my_boolean' => :'my_boolean' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'my_number' => :'OuterNumber', + :'my_string' => :'OuterString', + :'my_boolean' => :'OuterBoolean' + } + 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} + + if attributes.has_key?(:'my_number') + self.my_number = attributes[:'my_number'] + end + + if attributes.has_key?(:'my_string') + self.my_string = attributes[:'my_string'] + end + + if attributes.has_key?(:'my_boolean') + self.my_boolean = attributes[:'my_boolean'] + end + + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return 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? + return 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 && + my_number == o.my_number && + my_string == o.my_string && + my_boolean == o.my_boolean + 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 + [my_number, my_string, my_boolean].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.swagger_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/lib/petstore/models/outer_number.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_number.rb new file mode 100644 index 00000000000..07b7abe64ba --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_number.rb @@ -0,0 +1,178 @@ +=begin +#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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module Petstore + + class OuterNumber + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + } + end + + # Attribute type mapping. + def self.swagger_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 properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return 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? + return 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.swagger_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/lib/petstore/models/outer_string.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_string.rb new file mode 100644 index 00000000000..26ba9e52298 --- /dev/null +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_string.rb @@ -0,0 +1,178 @@ +=begin +#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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'date' + +module Petstore + + class OuterString + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + } + end + + # Attribute type mapping. + def self.swagger_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 properies with the reasons + def list_invalid_properties + invalid_properties = Array.new + return 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? + return 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.swagger_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/outer_boolean_spec.rb b/samples/client/petstore/ruby/spec/models/outer_boolean_spec.rb new file mode 100644 index 00000000000..f4fd2b3bb41 --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/outer_boolean_spec.rb @@ -0,0 +1,35 @@ +=begin +#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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::OuterBoolean +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'OuterBoolean' do + before do + # run before each test + @instance = Petstore::OuterBoolean.new + end + + after do + # run after each test + end + + describe 'test an instance of OuterBoolean' do + it 'should create an instact of OuterBoolean' do + expect(@instance).to be_instance_of(Petstore::OuterBoolean) + end + end +end + diff --git a/samples/client/petstore/ruby/spec/models/outer_composite_spec.rb b/samples/client/petstore/ruby/spec/models/outer_composite_spec.rb new file mode 100644 index 00000000000..34b27e40cc7 --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/outer_composite_spec.rb @@ -0,0 +1,53 @@ +=begin +#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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::OuterComposite +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'OuterComposite' do + before do + # run before each test + @instance = Petstore::OuterComposite.new + end + + after do + # run after each test + end + + describe 'test an instance of OuterComposite' do + it 'should create an instact of OuterComposite' do + expect(@instance).to be_instance_of(Petstore::OuterComposite) + end + end + describe 'test attribute "my_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "my_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "my_boolean"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end + diff --git a/samples/client/petstore/ruby/spec/models/outer_number_spec.rb b/samples/client/petstore/ruby/spec/models/outer_number_spec.rb new file mode 100644 index 00000000000..144abfaa14c --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/outer_number_spec.rb @@ -0,0 +1,35 @@ +=begin +#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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::OuterNumber +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'OuterNumber' do + before do + # run before each test + @instance = Petstore::OuterNumber.new + end + + after do + # run after each test + end + + describe 'test an instance of OuterNumber' do + it 'should create an instact of OuterNumber' do + expect(@instance).to be_instance_of(Petstore::OuterNumber) + end + end +end + diff --git a/samples/client/petstore/ruby/spec/models/outer_string_spec.rb b/samples/client/petstore/ruby/spec/models/outer_string_spec.rb new file mode 100644 index 00000000000..e8a51b69c63 --- /dev/null +++ b/samples/client/petstore/ruby/spec/models/outer_string_spec.rb @@ -0,0 +1,35 @@ +=begin +#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 +Generated by: https://github.com/swagger-api/swagger-codegen.git + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::OuterString +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'OuterString' do + before do + # run before each test + @instance = Petstore::OuterString.new + end + + after do + # run after each test + end + + describe 'test an instance of OuterString' do + it 'should create an instact of OuterString' do + expect(@instance).to be_instance_of(Petstore::OuterString) + end + end +end + diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java index 45f86ff8cbf..eb771932d19 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java @@ -35,7 +35,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json", method = RequestMethod.POST) - ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader("Accept") String accept); + ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept); @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { @@ -50,7 +50,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json", method = RequestMethod.DELETE) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey, @RequestHeader("Accept") String accept); + ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey, @RequestHeader(value = "Accept", required = false) String accept); @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { @@ -66,7 +66,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - ResponseEntity> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @RequestParam(value = "status", required = true) List status, @RequestHeader("Accept") String accept) throws IOException; + ResponseEntity> findPetsByStatus( @NotNull@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @RequestParam(value = "status", required = true) List status, @RequestHeader(value = "Accept", required = false) String accept) throws IOException; @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @@ -82,7 +82,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - ResponseEntity> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags, @RequestHeader("Accept") String accept) throws IOException; + ResponseEntity> findPetsByTags( @NotNull@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags, @RequestHeader(value = "Accept", required = false) String accept) throws IOException; @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { @@ -96,7 +96,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader("Accept") String accept) throws IOException; + ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId, @RequestHeader(value = "Accept", required = false) String accept) throws IOException; @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { @@ -113,7 +113,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json", method = RequestMethod.PUT) - ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader("Accept") String accept); + ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body, @RequestHeader(value = "Accept", required = false) String accept); @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { @@ -128,7 +128,7 @@ public interface PetApi { produces = "application/json", consumes = "application/x-www-form-urlencoded", method = RequestMethod.POST) - ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status, @RequestHeader("Accept") String accept); + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status, @RequestHeader(value = "Accept", required = false) String accept); @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @@ -143,6 +143,6 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data", method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file, @RequestHeader("Accept") String accept) throws IOException; + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file, @RequestHeader(value = "Accept", required = false) String accept) throws IOException; } diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java index 5f8f31dffe2..e4587f6f29d 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java @@ -30,7 +30,7 @@ public interface StoreApi { produces = "application/json", consumes = "application/json", method = RequestMethod.DELETE) - ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId, @RequestHeader("Accept") String accept); + ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId, @RequestHeader(value = "Accept", required = false) String accept); @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @@ -42,7 +42,7 @@ public interface StoreApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - ResponseEntity> getInventory( @RequestHeader("Accept") String accept) throws IOException; + ResponseEntity> getInventory( @RequestHeader(value = "Accept", required = false) String accept) throws IOException; @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) @@ -54,7 +54,7 @@ public interface StoreApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId, @RequestHeader("Accept") String accept) throws IOException; + ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId, @RequestHeader(value = "Accept", required = false) String accept) throws IOException; @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @@ -65,6 +65,6 @@ public interface StoreApi { produces = "application/json", consumes = "application/json", method = RequestMethod.POST) - ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body, @RequestHeader("Accept") String accept) throws IOException; + ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body, @RequestHeader(value = "Accept", required = false) String accept) throws IOException; } diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java index 5a4cef2892d..b8fd1fb02b3 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java @@ -29,7 +29,7 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.POST) - ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader("Accept") String accept); + ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept); @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @@ -39,7 +39,7 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.POST) - ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader("Accept") String accept); + ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept); @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @@ -49,7 +49,7 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.POST) - ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader("Accept") String accept); + ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body, @RequestHeader(value = "Accept", required = false) String accept); @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @@ -60,7 +60,7 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.DELETE) - ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username, @RequestHeader("Accept") String accept); + ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept); @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) @@ -72,7 +72,7 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username, @RequestHeader("Accept") String accept) throws IOException; + ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username, @RequestHeader(value = "Accept", required = false) String accept) throws IOException; @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) @@ -83,7 +83,7 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - ResponseEntity loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password, @RequestHeader("Accept") String accept) throws IOException; + ResponseEntity loginUser( @NotNull@ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, @NotNull@ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password, @RequestHeader(value = "Accept", required = false) String accept) throws IOException; @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @@ -93,7 +93,7 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.GET) - ResponseEntity logoutUser( @RequestHeader("Accept") String accept); + ResponseEntity logoutUser( @RequestHeader(value = "Accept", required = false) String accept); @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @@ -104,6 +104,6 @@ public interface UserApi { produces = "application/json", consumes = "application/json", method = RequestMethod.PUT) - ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader("Accept") String accept); + ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body, @RequestHeader(value = "Accept", required = false) String accept); } diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index b01adc6849e..ea46c3cc39d 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -248,12 +248,12 @@ public class PetAPI: APIBase { Find pet by ID - GET /pet/{petId} - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - - OAuth: - - type: oauth2 - - name: petstore_auth - API Key: - type: apiKey api_key - name: api_key + - OAuth: + - type: oauth2 + - name: petstore_auth - examples: [{contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index dd512ab857b..ecb702e002e 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -335,12 +335,12 @@ public class PetAPI: APIBase { Find pet by ID - GET /pet/{petId} - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - - OAuth: - - type: oauth2 - - name: petstore_auth - API Key: - type: apiKey api_key - name: api_key + - OAuth: + - type: oauth2 + - name: petstore_auth - examples: [{contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift index 4f0048bb1e8..f89c42058e9 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/Swaggers/APIs/PetAPI.swift @@ -345,12 +345,12 @@ public class PetAPI: APIBase { Find pet by ID - GET /pet/{petId} - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - - OAuth: - - type: oauth2 - - name: petstore_auth - API Key: - type: apiKey api_key - name: api_key + - OAuth: + - type: oauth2 + - name: petstore_auth - examples: [{contentType=application/json, example={ "photoUrls" : [ "aeiou" ], "name" : "doggie", diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift index 2fabe3edd84..942dd545dd6 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -11,6 +11,146 @@ import Alamofire open class FakeAPI: APIBase { + /** + + - 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: OuterBoolean? = nil, completion: @escaping ((_ data: OuterBoolean?, _ error: ErrorResponse?) -> Void)) { + fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + - POST /fake/outer/boolean + - Test serialization of outer boolean types + - examples: [{contentType=application/json, example={ }}] + + - parameter body: (body) Input boolean as post body (optional) + + - returns: RequestBuilder + */ + open class func fakeOuterBooleanSerializeWithRequestBuilder(body: OuterBoolean? = nil) -> RequestBuilder { + let path = "/fake/outer/boolean" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body?.encodeToJSON() as? [String:AnyObject] + + let url = NSURLComponents(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 composite as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + - POST /fake/outer/composite + - Test serialization of object with outer number type + - examples: [{contentType=application/json, example={ + "my_string" : { }, + "my_number" : { }, + "my_boolean" : { } +}}] + + - parameter body: (body) Input composite as post body (optional) + + - returns: RequestBuilder + */ + open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { + let path = "/fake/outer/composite" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body?.encodeToJSON() as? [String:AnyObject] + + let url = NSURLComponents(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: OuterNumber? = nil, completion: @escaping ((_ data: OuterNumber?, _ error: ErrorResponse?) -> Void)) { + fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + - POST /fake/outer/number + - Test serialization of outer number types + - examples: [{contentType=application/json, example={ }}] + + - parameter body: (body) Input number as post body (optional) + + - returns: RequestBuilder + */ + open class func fakeOuterNumberSerializeWithRequestBuilder(body: OuterNumber? = nil) -> RequestBuilder { + let path = "/fake/outer/number" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body?.encodeToJSON() as? [String:AnyObject] + + let url = NSURLComponents(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: OuterString? = nil, completion: @escaping ((_ data: OuterString?, _ error: ErrorResponse?) -> Void)) { + fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + - POST /fake/outer/string + - Test serialization of outer string types + - examples: [{contentType=application/json, example={ }}] + + - parameter body: (body) Input string as post body (optional) + + - returns: RequestBuilder + */ + open class func fakeOuterStringSerializeWithRequestBuilder(body: OuterString? = nil) -> RequestBuilder { + let path = "/fake/outer/string" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body?.encodeToJSON() as? [String:AnyObject] + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** To test \"client\" model diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models.swift index 930bf97ff07..533fea56356 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models.swift @@ -1004,6 +1004,51 @@ class Decoders { } + // Decoder for [OuterBoolean] + return Decoders.decode(clazz: [OuterBoolean].self, source: source, instance: instance) + } + // Decoder for OuterBoolean + Decoders.addDecoder(clazz: OuterBoolean.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let source = source as? Bool { + return .success(source) + } else { + return .failure(.typeMismatch(expected: "Typealias OuterBoolean", actual: "\(source)")) + } + } + + + // Decoder for [OuterComposite] + return Decoders.decode(clazz: [OuterComposite].self, source: source, instance: instance) + } + // Decoder for OuterComposite + Decoders.addDecoder(clazz: OuterComposite.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let result = instance == nil ? OuterComposite() : instance as! OuterComposite + switch Decoders.decodeOptional(clazz: OuterNumber.self, source: sourceDictionary["my_number"] as AnyObject?) { + + case let .success(value): result.myNumber = value + case let .failure(error): return .failure(error) + + } + switch Decoders.decodeOptional(clazz: OuterString.self, source: sourceDictionary["my_string"] as AnyObject?) { + + case let .success(value): result.myString = value + case let .failure(error): return .failure(error) + + } + switch Decoders.decodeOptional(clazz: OuterBoolean.self, source: sourceDictionary["my_boolean"] as AnyObject?) { + + case let .success(value): result.myBoolean = value + case let .failure(error): return .failure(error) + + } + return .success(result) + } else { + return .failure(.typeMismatch(expected: "OuterComposite", actual: "\(source)")) + } + } + + // Decoder for [OuterEnum] return Decoders.decode(clazz: [OuterEnum].self, source: source, instance: instance) } @@ -1014,6 +1059,32 @@ class Decoders { } + // Decoder for [OuterNumber] + return Decoders.decode(clazz: [OuterNumber].self, source: source, instance: instance) + } + // Decoder for OuterNumber + Decoders.addDecoder(clazz: OuterNumber.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let source = source as? Double { + return .success(source) + } else { + return .failure(.typeMismatch(expected: "Typealias OuterNumber", actual: "\(source)")) + } + } + + + // Decoder for [OuterString] + return Decoders.decode(clazz: [OuterString].self, source: source, instance: instance) + } + // Decoder for OuterString + Decoders.addDecoder(clazz: OuterString.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let source = source as? String { + return .success(source) + } else { + return .failure(.typeMismatch(expected: "Typealias OuterString", actual: "\(source)")) + } + } + + // Decoder for [Pet] return Decoders.decode(clazz: [Pet].self, source: source, instance: instance) } diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift new file mode 100644 index 00000000000..3c49ad29400 --- /dev/null +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift @@ -0,0 +1,11 @@ +// +// OuterBoolean.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +public typealias OuterBoolean = Bool diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift new file mode 100644 index 00000000000..7fc6d69391c --- /dev/null +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift @@ -0,0 +1,29 @@ +// +// OuterComposite.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +open class OuterComposite: JSONEncodable { + + public var myNumber: OuterNumber? + public var myString: OuterString? + public var myBoolean: OuterBoolean? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["my_number"] = self.myNumber?.encodeToJSON() + nillableDictionary["my_string"] = self.myString?.encodeToJSON() + nillableDictionary["my_boolean"] = self.myBoolean?.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift new file mode 100644 index 00000000000..f285f4e5e29 --- /dev/null +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift @@ -0,0 +1,11 @@ +// +// OuterNumber.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +public typealias OuterNumber = Double diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterString.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterString.swift new file mode 100644 index 00000000000..9da794627d6 --- /dev/null +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/Swaggers/Models/OuterString.swift @@ -0,0 +1,11 @@ +// +// OuterString.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +public typealias OuterString = String diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift index 3d6ea3e10a1..92a570b5361 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -12,6 +12,210 @@ import PromiseKit open class FakeAPI: APIBase { + /** + + - 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: OuterBoolean? = nil, completion: @escaping ((_ data: OuterBoolean?, _ error: ErrorResponse?) -> 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: OuterBoolean? = 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 + - examples: [{contentType=application/json, example={ }}] + + - parameter body: (body) Input boolean as post body (optional) + + - returns: RequestBuilder + */ + open class func fakeOuterBooleanSerializeWithRequestBuilder(body: OuterBoolean? = nil) -> RequestBuilder { + let path = "/fake/outer/boolean" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body?.encodeToJSON() as? [String:AnyObject] + + let url = NSURLComponents(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 composite as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + + - parameter body: (body) Input composite as post body (optional) + - returns: Promise + */ + open class func fakeOuterCompositeSerialize( body: OuterComposite? = nil) -> Promise { + let deferred = Promise.pending() + fakeOuterCompositeSerialize(body: body) { 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 + - examples: [{contentType=application/json, example={ + "my_string" : { }, + "my_number" : { }, + "my_boolean" : { } +}}] + + - parameter body: (body) Input composite as post body (optional) + + - returns: RequestBuilder + */ + open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { + let path = "/fake/outer/composite" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body?.encodeToJSON() as? [String:AnyObject] + + let url = NSURLComponents(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: OuterNumber? = nil, completion: @escaping ((_ data: OuterNumber?, _ error: ErrorResponse?) -> 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: OuterNumber? = 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 + - examples: [{contentType=application/json, example={ }}] + + - parameter body: (body) Input number as post body (optional) + + - returns: RequestBuilder + */ + open class func fakeOuterNumberSerializeWithRequestBuilder(body: OuterNumber? = nil) -> RequestBuilder { + let path = "/fake/outer/number" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body?.encodeToJSON() as? [String:AnyObject] + + let url = NSURLComponents(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: OuterString? = nil, completion: @escaping ((_ data: OuterString?, _ error: ErrorResponse?) -> 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: OuterString? = 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 + - examples: [{contentType=application/json, example={ }}] + + - parameter body: (body) Input string as post body (optional) + + - returns: RequestBuilder + */ + open class func fakeOuterStringSerializeWithRequestBuilder(body: OuterString? = nil) -> RequestBuilder { + let path = "/fake/outer/string" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body?.encodeToJSON() as? [String:AnyObject] + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** To test \"client\" model diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models.swift index 930bf97ff07..533fea56356 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models.swift @@ -1004,6 +1004,51 @@ class Decoders { } + // Decoder for [OuterBoolean] + return Decoders.decode(clazz: [OuterBoolean].self, source: source, instance: instance) + } + // Decoder for OuterBoolean + Decoders.addDecoder(clazz: OuterBoolean.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let source = source as? Bool { + return .success(source) + } else { + return .failure(.typeMismatch(expected: "Typealias OuterBoolean", actual: "\(source)")) + } + } + + + // Decoder for [OuterComposite] + return Decoders.decode(clazz: [OuterComposite].self, source: source, instance: instance) + } + // Decoder for OuterComposite + Decoders.addDecoder(clazz: OuterComposite.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let result = instance == nil ? OuterComposite() : instance as! OuterComposite + switch Decoders.decodeOptional(clazz: OuterNumber.self, source: sourceDictionary["my_number"] as AnyObject?) { + + case let .success(value): result.myNumber = value + case let .failure(error): return .failure(error) + + } + switch Decoders.decodeOptional(clazz: OuterString.self, source: sourceDictionary["my_string"] as AnyObject?) { + + case let .success(value): result.myString = value + case let .failure(error): return .failure(error) + + } + switch Decoders.decodeOptional(clazz: OuterBoolean.self, source: sourceDictionary["my_boolean"] as AnyObject?) { + + case let .success(value): result.myBoolean = value + case let .failure(error): return .failure(error) + + } + return .success(result) + } else { + return .failure(.typeMismatch(expected: "OuterComposite", actual: "\(source)")) + } + } + + // Decoder for [OuterEnum] return Decoders.decode(clazz: [OuterEnum].self, source: source, instance: instance) } @@ -1014,6 +1059,32 @@ class Decoders { } + // Decoder for [OuterNumber] + return Decoders.decode(clazz: [OuterNumber].self, source: source, instance: instance) + } + // Decoder for OuterNumber + Decoders.addDecoder(clazz: OuterNumber.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let source = source as? Double { + return .success(source) + } else { + return .failure(.typeMismatch(expected: "Typealias OuterNumber", actual: "\(source)")) + } + } + + + // Decoder for [OuterString] + return Decoders.decode(clazz: [OuterString].self, source: source, instance: instance) + } + // Decoder for OuterString + Decoders.addDecoder(clazz: OuterString.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let source = source as? String { + return .success(source) + } else { + return .failure(.typeMismatch(expected: "Typealias OuterString", actual: "\(source)")) + } + } + + // Decoder for [Pet] return Decoders.decode(clazz: [Pet].self, source: source, instance: instance) } diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift new file mode 100644 index 00000000000..3c49ad29400 --- /dev/null +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift @@ -0,0 +1,11 @@ +// +// OuterBoolean.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +public typealias OuterBoolean = Bool diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift new file mode 100644 index 00000000000..7fc6d69391c --- /dev/null +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift @@ -0,0 +1,29 @@ +// +// OuterComposite.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +open class OuterComposite: JSONEncodable { + + public var myNumber: OuterNumber? + public var myString: OuterString? + public var myBoolean: OuterBoolean? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["my_number"] = self.myNumber?.encodeToJSON() + nillableDictionary["my_string"] = self.myString?.encodeToJSON() + nillableDictionary["my_boolean"] = self.myBoolean?.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift new file mode 100644 index 00000000000..f285f4e5e29 --- /dev/null +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift @@ -0,0 +1,11 @@ +// +// OuterNumber.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +public typealias OuterNumber = Double diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterString.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterString.swift new file mode 100644 index 00000000000..9da794627d6 --- /dev/null +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/Swaggers/Models/OuterString.swift @@ -0,0 +1,11 @@ +// +// OuterString.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +public typealias OuterString = String diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift index bd7d3abdd96..58543c13160 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/APIs/FakeAPI.swift @@ -12,6 +12,218 @@ import RxSwift open class FakeAPI: APIBase { + /** + + - 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: OuterBoolean? = nil, completion: @escaping ((_ data: OuterBoolean?, _ error: ErrorResponse?) -> 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: OuterBoolean? = nil) -> Observable { + return Observable.create { observer -> Disposable in + fakeOuterBooleanSerialize(body: body) { data, error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return NopDisposable.instance + } + } + + /** + - POST /fake/outer/boolean + - Test serialization of outer boolean types + - examples: [{contentType=application/json, example={ }}] + + - parameter body: (body) Input boolean as post body (optional) + + - returns: RequestBuilder + */ + open class func fakeOuterBooleanSerializeWithRequestBuilder(body: OuterBoolean? = nil) -> RequestBuilder { + let path = "/fake/outer/boolean" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body?.encodeToJSON() as? [String:AnyObject] + + let url = NSURLComponents(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 composite as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + + - parameter body: (body) Input composite as post body (optional) + - returns: Observable + */ + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil) -> Observable { + return Observable.create { observer -> Disposable in + fakeOuterCompositeSerialize(body: body) { data, error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return NopDisposable.instance + } + } + + /** + - POST /fake/outer/composite + - Test serialization of object with outer number type + - examples: [{contentType=application/json, example={ + "my_string" : { }, + "my_number" : { }, + "my_boolean" : { } +}}] + + - parameter body: (body) Input composite as post body (optional) + + - returns: RequestBuilder + */ + open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { + let path = "/fake/outer/composite" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body?.encodeToJSON() as? [String:AnyObject] + + let url = NSURLComponents(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: OuterNumber? = nil, completion: @escaping ((_ data: OuterNumber?, _ error: ErrorResponse?) -> 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: OuterNumber? = nil) -> Observable { + return Observable.create { observer -> Disposable in + fakeOuterNumberSerialize(body: body) { data, error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return NopDisposable.instance + } + } + + /** + - POST /fake/outer/number + - Test serialization of outer number types + - examples: [{contentType=application/json, example={ }}] + + - parameter body: (body) Input number as post body (optional) + + - returns: RequestBuilder + */ + open class func fakeOuterNumberSerializeWithRequestBuilder(body: OuterNumber? = nil) -> RequestBuilder { + let path = "/fake/outer/number" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body?.encodeToJSON() as? [String:AnyObject] + + let url = NSURLComponents(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: OuterString? = nil, completion: @escaping ((_ data: OuterString?, _ error: ErrorResponse?) -> 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: OuterString? = nil) -> Observable { + return Observable.create { observer -> Disposable in + fakeOuterStringSerialize(body: body) { data, error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return NopDisposable.instance + } + } + + /** + - POST /fake/outer/string + - Test serialization of outer string types + - examples: [{contentType=application/json, example={ }}] + + - parameter body: (body) Input string as post body (optional) + + - returns: RequestBuilder + */ + open class func fakeOuterStringSerializeWithRequestBuilder(body: OuterString? = nil) -> RequestBuilder { + let path = "/fake/outer/string" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body?.encodeToJSON() as? [String:AnyObject] + + let url = NSURLComponents(string: URLString) + + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** To test \"client\" model diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models.swift index 930bf97ff07..533fea56356 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models.swift @@ -1004,6 +1004,51 @@ class Decoders { } + // Decoder for [OuterBoolean] + return Decoders.decode(clazz: [OuterBoolean].self, source: source, instance: instance) + } + // Decoder for OuterBoolean + Decoders.addDecoder(clazz: OuterBoolean.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let source = source as? Bool { + return .success(source) + } else { + return .failure(.typeMismatch(expected: "Typealias OuterBoolean", actual: "\(source)")) + } + } + + + // Decoder for [OuterComposite] + return Decoders.decode(clazz: [OuterComposite].self, source: source, instance: instance) + } + // Decoder for OuterComposite + Decoders.addDecoder(clazz: OuterComposite.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let result = instance == nil ? OuterComposite() : instance as! OuterComposite + switch Decoders.decodeOptional(clazz: OuterNumber.self, source: sourceDictionary["my_number"] as AnyObject?) { + + case let .success(value): result.myNumber = value + case let .failure(error): return .failure(error) + + } + switch Decoders.decodeOptional(clazz: OuterString.self, source: sourceDictionary["my_string"] as AnyObject?) { + + case let .success(value): result.myString = value + case let .failure(error): return .failure(error) + + } + switch Decoders.decodeOptional(clazz: OuterBoolean.self, source: sourceDictionary["my_boolean"] as AnyObject?) { + + case let .success(value): result.myBoolean = value + case let .failure(error): return .failure(error) + + } + return .success(result) + } else { + return .failure(.typeMismatch(expected: "OuterComposite", actual: "\(source)")) + } + } + + // Decoder for [OuterEnum] return Decoders.decode(clazz: [OuterEnum].self, source: source, instance: instance) } @@ -1014,6 +1059,32 @@ class Decoders { } + // Decoder for [OuterNumber] + return Decoders.decode(clazz: [OuterNumber].self, source: source, instance: instance) + } + // Decoder for OuterNumber + Decoders.addDecoder(clazz: OuterNumber.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let source = source as? Double { + return .success(source) + } else { + return .failure(.typeMismatch(expected: "Typealias OuterNumber", actual: "\(source)")) + } + } + + + // Decoder for [OuterString] + return Decoders.decode(clazz: [OuterString].self, source: source, instance: instance) + } + // Decoder for OuterString + Decoders.addDecoder(clazz: OuterString.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let source = source as? String { + return .success(source) + } else { + return .failure(.typeMismatch(expected: "Typealias OuterString", actual: "\(source)")) + } + } + + // Decoder for [Pet] return Decoders.decode(clazz: [Pet].self, source: source, instance: instance) } diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift new file mode 100644 index 00000000000..3c49ad29400 --- /dev/null +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterBoolean.swift @@ -0,0 +1,11 @@ +// +// OuterBoolean.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +public typealias OuterBoolean = Bool diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift new file mode 100644 index 00000000000..7fc6d69391c --- /dev/null +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterComposite.swift @@ -0,0 +1,29 @@ +// +// OuterComposite.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +open class OuterComposite: JSONEncodable { + + public var myNumber: OuterNumber? + public var myString: OuterString? + public var myBoolean: OuterBoolean? + + public init() {} + + // MARK: JSONEncodable + open func encodeToJSON() -> Any { + var nillableDictionary = [String:Any?]() + nillableDictionary["my_number"] = self.myNumber?.encodeToJSON() + nillableDictionary["my_string"] = self.myString?.encodeToJSON() + nillableDictionary["my_boolean"] = self.myBoolean?.encodeToJSON() + + let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] + return dictionary + } +} diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift new file mode 100644 index 00000000000..f285f4e5e29 --- /dev/null +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterNumber.swift @@ -0,0 +1,11 @@ +// +// OuterNumber.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +public typealias OuterNumber = Double diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterString.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterString.swift new file mode 100644 index 00000000000..9da794627d6 --- /dev/null +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/Swaggers/Models/OuterString.swift @@ -0,0 +1,11 @@ +// +// OuterString.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +public typealias OuterString = String diff --git a/samples/client/petstore/typescript-angular2/npm/README.md b/samples/client/petstore/typescript-angular2/npm/README.md index fbf37be47b0..c1a9728f505 100644 --- a/samples/client/petstore/typescript-angular2/npm/README.md +++ b/samples/client/petstore/typescript-angular2/npm/README.md @@ -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/samples/client/petstore/typescript-node/default/api.ts b/samples/client/petstore/typescript-node/default/api.ts index f8752640d86..a88f75abff6 100644 --- a/samples/client/petstore/typescript-node/default/api.ts +++ b/samples/client/petstore/typescript-node/default/api.ts @@ -714,10 +714,10 @@ export class PetApi { json: true, }; - this.authentications.petstore_auth.applyToRequest(requestOptions); - this.authentications.api_key.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(requestOptions); if (Object.keys(formParams).length) { diff --git a/samples/client/petstore/typescript-node/npm/api.ts b/samples/client/petstore/typescript-node/npm/api.ts index f8752640d86..a88f75abff6 100644 --- a/samples/client/petstore/typescript-node/npm/api.ts +++ b/samples/client/petstore/typescript-node/npm/api.ts @@ -714,10 +714,10 @@ export class PetApi { json: true, }; - this.authentications.petstore_auth.applyToRequest(requestOptions); - this.authentications.api_key.applyToRequest(requestOptions); + this.authentications.petstore_auth.applyToRequest(requestOptions); + this.authentications.default.applyToRequest(requestOptions); if (Object.keys(formParams).length) { diff --git a/samples/html2/index.html b/samples/html2/index.html index f4ce1aa2f63..61c99f981e1 100644 --- a/samples/html2/index.html +++ b/samples/html2/index.html @@ -1006,20 +1006,19 @@ margin-bottom: 20px;

  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X post "http://petstore.swagger.io/v2/pet"
    -  
    +
    curl -X post "http://petstore.swagger.io/v2/pet"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .PetApi;
    +import io.swagger.client.api.PetApi;
     
     import java.io.File;
     import java.util.*;
    @@ -1042,14 +1041,11 @@ public class PetApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .PetApi;
    +                            
    import io.swagger.client.api.PetApi;
     
     public class PetApiExample {
     
    @@ -1063,22 +1059,18 @@ public class PetApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  Configuration *apiConfig = [Configuration sharedConfig];
    +                              
    Configuration *apiConfig = [Configuration sharedConfig];
     
     // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
     [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
     
    -
     Pet *body = ; // Pet object that needs to be added to the store
     
     PetApi *apiInstance = [[PetApi alloc] init];
    @@ -1090,20 +1082,18 @@ PetApi *apiInstance = [[PetApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    -var defaultClient = .ApiClient.instance;
    +                              
    var SwaggerPetstore = require('swagger_petstore');
    +var defaultClient = SwaggerPetstore.ApiClient.instance;
     
     // Configure OAuth2 access token for authorization: petstore_auth
     var petstore_auth = defaultClient.authentications['petstore_auth'];
     petstore_auth.accessToken = "YOUR ACCESS TOKEN"
     
    -var api = new .PetApi()
    +var api = new SwaggerPetstore.PetApi()
     
     var body = ; // {Pet} Pet object that needs to be added to the store
     
    @@ -1116,20 +1106,18 @@ var callback = function(error, data, response) {
       }
     };
     api.addPet(body, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -1155,20 +1143,17 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     // Configure OAuth2 access token for authorization: petstore_auth
    -io.swagger.client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
    +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
     
    -$api_instance = new io.swagger.client\Api\PetApi();
    +$api_instance = new Swagger\Client\Api\PetApi();
     $body = ; // Pet | Pet object that needs to be added to the store
     
     try {
    @@ -1176,8 +1161,47 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::PetApi;
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
    +
    +my $api_instance = WWW::SwaggerClient::PetApi->new();
    +my $body = WWW::SwaggerClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store
    +
    +eval { 
    +    $api_instance->addPet(body => $body);
    +};
    +if ($@) {
    +    warn "Exception when calling PetApi->addPet: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
    +
    +# create an instance of the API class
    +api_instance = swagger_client.PetApi()
    +body =  # Pet | Pet object that needs to be added to the store
    +
    +try: 
    +    # Add a new pet to the store
    +    api_instance.addPet(body)
    +except ApiException as e:
    +    print("Exception when calling PetApi->addPet: %s\n" % e)
    @@ -1196,8 +1220,8 @@ try { -
    + var view = new JSONSchemaView(schema,2,{isBodyParam: true}); + var result = $('#d2e199_addPet_body'); + result.empty(); + result.append(view.render()); +}); + +
    @@ -1242,6 +1257,12 @@ try {

    Responses

    Status: 405 - Invalid input

    + + +
    +
    +
    @@ -1271,20 +1292,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X delete "http://petstore.swagger.io/v2/pet/{petId}"
    -  
    +
    curl -X delete "http://petstore.swagger.io/v2/pet/{petId}"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .PetApi;
    +import io.swagger.client.api.PetApi;
     
     import java.io.File;
     import java.util.*;
    @@ -1308,14 +1328,11 @@ public class PetApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .PetApi;
    +                            
    import io.swagger.client.api.PetApi;
     
     public class PetApiExample {
     
    @@ -1330,22 +1347,18 @@ public class PetApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  Configuration *apiConfig = [Configuration sharedConfig];
    +                              
    Configuration *apiConfig = [Configuration sharedConfig];
     
     // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
     [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
     
    -
     Long *petId = 789; // Pet id to delete
     String *apiKey = apiKey_example; //  (optional)
     
    @@ -1359,20 +1372,18 @@ PetApi *apiInstance = [[PetApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    -var defaultClient = .ApiClient.instance;
    +                              
    var SwaggerPetstore = require('swagger_petstore');
    +var defaultClient = SwaggerPetstore.ApiClient.instance;
     
     // Configure OAuth2 access token for authorization: petstore_auth
     var petstore_auth = defaultClient.authentications['petstore_auth'];
     petstore_auth.accessToken = "YOUR ACCESS TOKEN"
     
    -var api = new .PetApi()
    +var api = new SwaggerPetstore.PetApi()
     
     var petId = 789; // {Long} Pet id to delete
     
    @@ -1388,20 +1399,18 @@ var callback = function(error, data, response) {
       }
     };
     api.deletePet(petId, opts, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -1428,20 +1437,17 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     // Configure OAuth2 access token for authorization: petstore_auth
    -io.swagger.client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
    +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
     
    -$api_instance = new io.swagger.client\Api\PetApi();
    +$api_instance = new Swagger\Client\Api\PetApi();
     $petId = 789; // Long | Pet id to delete
     $apiKey = apiKey_example; // String | 
     
    @@ -1450,8 +1456,49 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling PetApi->deletePet: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::PetApi;
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
    +
    +my $api_instance = WWW::SwaggerClient::PetApi->new();
    +my $petId = 789; # Long | Pet id to delete
    +my $apiKey = apiKey_example; # String | 
    +
    +eval { 
    +    $api_instance->deletePet(petId => $petId, apiKey => $apiKey);
    +};
    +if ($@) {
    +    warn "Exception when calling PetApi->deletePet: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
    +
    +# create an instance of the API class
    +api_instance = swagger_client.PetApi()
    +petId = 789 # Long | Pet id to delete
    +apiKey = apiKey_example # String |  (optional)
    +
    +try: 
    +    # Deletes a pet
    +    api_instance.deletePet(petId, apiKey=apiKey)
    +except ApiException as e:
    +    print("Exception when calling PetApi->deletePet: %s\n" % e)
    @@ -1482,7 +1529,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_deletePet_petId'); result.empty(); result.append(view.render()); @@ -1505,7 +1552,7 @@ try { Name Description - apiKey + api_key @@ -1522,7 +1569,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_deletePet_apiKey'); result.empty(); result.append(view.render()); @@ -1545,6 +1592,12 @@ try {

    Responses

    Status: 400 - Invalid pet value

    + + +
    +
    +
    @@ -1574,20 +1627,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X get "http://petstore.swagger.io/v2/pet/findByStatus?status="
    -  
    +
    curl -X get "http://petstore.swagger.io/v2/pet/findByStatus?status="
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .PetApi;
    +import io.swagger.client.api.PetApi;
     
     import java.io.File;
     import java.util.*;
    @@ -1611,14 +1663,11 @@ public class PetApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .PetApi;
    +                            
    import io.swagger.client.api.PetApi;
     
     public class PetApiExample {
     
    @@ -1633,22 +1682,18 @@ public class PetApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  Configuration *apiConfig = [Configuration sharedConfig];
    +                              
    Configuration *apiConfig = [Configuration sharedConfig];
     
     // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
     [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
     
    -
     array[String] *status = ; // Status values that need to be considered for filter
     
     PetApi *apiInstance = [[PetApi alloc] init];
    @@ -1663,20 +1708,18 @@ PetApi *apiInstance = [[PetApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    -var defaultClient = .ApiClient.instance;
    +                              
    var SwaggerPetstore = require('swagger_petstore');
    +var defaultClient = SwaggerPetstore.ApiClient.instance;
     
     // Configure OAuth2 access token for authorization: petstore_auth
     var petstore_auth = defaultClient.authentications['petstore_auth'];
     petstore_auth.accessToken = "YOUR ACCESS TOKEN"
     
    -var api = new .PetApi()
    +var api = new SwaggerPetstore.PetApi()
     
     var status = ; // {array[String]} Status values that need to be considered for filter
     
    @@ -1689,20 +1732,18 @@ var callback = function(error, data, response) {
       }
     };
     api.findPetsByStatus(status, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -1729,20 +1770,17 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     // Configure OAuth2 access token for authorization: petstore_auth
    -io.swagger.client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
    +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
     
    -$api_instance = new io.swagger.client\Api\PetApi();
    +$api_instance = new Swagger\Client\Api\PetApi();
     $status = ; // array[String] | Status values that need to be considered for filter
     
     try {
    @@ -1751,8 +1789,49 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling PetApi->findPetsByStatus: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::PetApi;
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
    +
    +my $api_instance = WWW::SwaggerClient::PetApi->new();
    +my $status = []; # array[String] | Status values that need to be considered for filter
    +
    +eval { 
    +    my $result = $api_instance->findPetsByStatus(status => $status);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling PetApi->findPetsByStatus: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
    +
    +# create an instance of the API class
    +api_instance = swagger_client.PetApi()
    +status =  # array[String] | Status values that need to be considered for filter
    +
    +try: 
    +    # Finds Pets by status
    +    api_response = api_instance.findPetsByStatus(status)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling PetApi->findPetsByStatus: %s\n" % e)
    @@ -1782,8 +1861,8 @@ try { "type" : "array", "items" : { "type" : "string", - "enum" : [ "available", "pending", "sold" ], - "default" : "available" + "default" : "available", + "enum" : [ "available", "pending", "sold" ] }, "collectionFormat" : "csv" }; @@ -1792,7 +1871,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_findPetsByStatus_status'); result.empty(); result.append(view.render()); @@ -1812,18 +1891,17 @@ try {

    Responses

    Status: 200 - successful operation

    - -
    -
    -
    - -
    - +
    -
    + +

    Status: 400 - Invalid status value

    + + +
    +
    +
    @@ -1886,20 +1972,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X get "http://petstore.swagger.io/v2/pet/findByTags?tags="
    -  
    +
    curl -X get "http://petstore.swagger.io/v2/pet/findByTags?tags="
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .PetApi;
    +import io.swagger.client.api.PetApi;
     
     import java.io.File;
     import java.util.*;
    @@ -1923,14 +2008,11 @@ public class PetApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .PetApi;
    +                            
    import io.swagger.client.api.PetApi;
     
     public class PetApiExample {
     
    @@ -1945,22 +2027,18 @@ public class PetApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  Configuration *apiConfig = [Configuration sharedConfig];
    +                              
    Configuration *apiConfig = [Configuration sharedConfig];
     
     // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
     [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
     
    -
     array[String] *tags = ; // Tags to filter by
     
     PetApi *apiInstance = [[PetApi alloc] init];
    @@ -1975,20 +2053,18 @@ PetApi *apiInstance = [[PetApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    -var defaultClient = .ApiClient.instance;
    +                              
    var SwaggerPetstore = require('swagger_petstore');
    +var defaultClient = SwaggerPetstore.ApiClient.instance;
     
     // Configure OAuth2 access token for authorization: petstore_auth
     var petstore_auth = defaultClient.authentications['petstore_auth'];
     petstore_auth.accessToken = "YOUR ACCESS TOKEN"
     
    -var api = new .PetApi()
    +var api = new SwaggerPetstore.PetApi()
     
     var tags = ; // {array[String]} Tags to filter by
     
    @@ -2001,20 +2077,18 @@ var callback = function(error, data, response) {
       }
     };
     api.findPetsByTags(tags, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -2041,20 +2115,17 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     // Configure OAuth2 access token for authorization: petstore_auth
    -io.swagger.client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
    +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
     
    -$api_instance = new io.swagger.client\Api\PetApi();
    +$api_instance = new Swagger\Client\Api\PetApi();
     $tags = ; // array[String] | Tags to filter by
     
     try {
    @@ -2063,8 +2134,49 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling PetApi->findPetsByTags: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::PetApi;
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
    +
    +my $api_instance = WWW::SwaggerClient::PetApi->new();
    +my $tags = []; # array[String] | Tags to filter by
    +
    +eval { 
    +    my $result = $api_instance->findPetsByTags(tags => $tags);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling PetApi->findPetsByTags: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
    +
    +# create an instance of the API class
    +api_instance = swagger_client.PetApi()
    +tags =  # array[String] | Tags to filter by
    +
    +try: 
    +    # Finds Pets by tags
    +    api_response = api_instance.findPetsByTags(tags)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling PetApi->findPetsByTags: %s\n" % e)
    @@ -2102,7 +2214,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_findPetsByTags_tags'); result.empty(); result.append(view.render()); @@ -2122,18 +2234,17 @@ try {

    Responses

    Status: 200 - successful operation

    - -
    -
    -
    - -
    - +
    -
    + +

    Status: 400 - Invalid tag value

    + + +
    +
    +
    @@ -2196,20 +2315,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X get -H "api_key: [[apiKey]]"  "http://petstore.swagger.io/v2/pet/{petId}"
    -  
    +
    curl -X get -H "api_key: [[apiKey]]" "http://petstore.swagger.io/v2/pet/{petId}"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .PetApi;
    +import io.swagger.client.api.PetApi;
     
     import java.io.File;
     import java.util.*;
    @@ -2235,14 +2353,11 @@ public class PetApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .PetApi;
    +                            
    import io.swagger.client.api.PetApi;
     
     public class PetApiExample {
     
    @@ -2257,24 +2372,20 @@ public class PetApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  Configuration *apiConfig = [Configuration sharedConfig];
    +                              
    Configuration *apiConfig = [Configuration sharedConfig];
     
     // Configure API key authorization: (authentication scheme: api_key)
     [apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"];
     // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
     //[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"];
     
    -
     Long *petId = 789; // ID of pet to return
     
     PetApi *apiInstance = [[PetApi alloc] init];
    @@ -2289,14 +2400,12 @@ PetApi *apiInstance = [[PetApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    -var defaultClient = .ApiClient.instance;
    +                              
    var SwaggerPetstore = require('swagger_petstore');
    +var defaultClient = SwaggerPetstore.ApiClient.instance;
     
     // Configure API key authorization: api_key
     var api_key = defaultClient.authentications['api_key'];
    @@ -2304,7 +2413,7 @@ api_key.apiKey = "YOUR API KEY"
     // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
     //api_key.apiKeyPrefix['api_key'] = "Token"
     
    -var api = new .PetApi()
    +var api = new SwaggerPetstore.PetApi()
     
     var petId = 789; // {Long} ID of pet to return
     
    @@ -2317,20 +2426,18 @@ var callback = function(error, data, response) {
       }
     };
     api.getPetById(petId, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -2359,22 +2466,19 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     // Configure API key authorization: api_key
    -io.swagger.client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
    +Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
     // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    -// io.swagger.client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
    +// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
     
    -$api_instance = new io.swagger.client\Api\PetApi();
    +$api_instance = new Swagger\Client\Api\PetApi();
     $petId = 789; // Long | ID of pet to return
     
     try {
    @@ -2383,8 +2487,53 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling PetApi->getPetById: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::PetApi;
    +
    +# Configure API key authorization: api_key
    +$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
    +# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "Bearer";
    +
    +my $api_instance = WWW::SwaggerClient::PetApi->new();
    +my $petId = 789; # Long | ID of pet to return
    +
    +eval { 
    +    my $result = $api_instance->getPetById(petId => $petId);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling PetApi->getPetById: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure API key authorization: api_key
    +swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
    +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +# swagger_client.configuration.api_key_prefix['api_key'] = 'Bearer'
    +
    +# create an instance of the API class
    +api_instance = swagger_client.PetApi()
    +petId = 789 # Long | ID of pet to return
    +
    +try: 
    +    # Find pet by ID
    +    api_response = api_instance.getPetById(petId)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling PetApi->getPetById: %s\n" % e)
    @@ -2415,7 +2564,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_getPetById_petId'); result.empty(); result.append(view.render()); @@ -2439,18 +2588,17 @@ try {

    Responses

    Status: 200 - successful operation

    - -
    -
    -
    - -
    - +
    -
    + +

    Status: 400 - Invalid ID supplied

    + + +
    +
    +

    Status: 404 - Pet not found

    + + +
    +
    +
    @@ -2512,20 +2674,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X put "http://petstore.swagger.io/v2/pet"
    -  
    +
    curl -X put "http://petstore.swagger.io/v2/pet"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .PetApi;
    +import io.swagger.client.api.PetApi;
     
     import java.io.File;
     import java.util.*;
    @@ -2548,14 +2709,11 @@ public class PetApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .PetApi;
    +                            
    import io.swagger.client.api.PetApi;
     
     public class PetApiExample {
     
    @@ -2569,22 +2727,18 @@ public class PetApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  Configuration *apiConfig = [Configuration sharedConfig];
    +                              
    Configuration *apiConfig = [Configuration sharedConfig];
     
     // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
     [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
     
    -
     Pet *body = ; // Pet object that needs to be added to the store
     
     PetApi *apiInstance = [[PetApi alloc] init];
    @@ -2596,20 +2750,18 @@ PetApi *apiInstance = [[PetApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    -var defaultClient = .ApiClient.instance;
    +                              
    var SwaggerPetstore = require('swagger_petstore');
    +var defaultClient = SwaggerPetstore.ApiClient.instance;
     
     // Configure OAuth2 access token for authorization: petstore_auth
     var petstore_auth = defaultClient.authentications['petstore_auth'];
     petstore_auth.accessToken = "YOUR ACCESS TOKEN"
     
    -var api = new .PetApi()
    +var api = new SwaggerPetstore.PetApi()
     
     var body = ; // {Pet} Pet object that needs to be added to the store
     
    @@ -2622,20 +2774,18 @@ var callback = function(error, data, response) {
       }
     };
     api.updatePet(body, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -2661,20 +2811,17 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     // Configure OAuth2 access token for authorization: petstore_auth
    -io.swagger.client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
    +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
     
    -$api_instance = new io.swagger.client\Api\PetApi();
    +$api_instance = new Swagger\Client\Api\PetApi();
     $body = ; // Pet | Pet object that needs to be added to the store
     
     try {
    @@ -2682,8 +2829,47 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::PetApi;
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
    +
    +my $api_instance = WWW::SwaggerClient::PetApi->new();
    +my $body = WWW::SwaggerClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store
    +
    +eval { 
    +    $api_instance->updatePet(body => $body);
    +};
    +if ($@) {
    +    warn "Exception when calling PetApi->updatePet: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
    +
    +# create an instance of the API class
    +api_instance = swagger_client.PetApi()
    +body =  # Pet | Pet object that needs to be added to the store
    +
    +try: 
    +    # Update an existing pet
    +    api_instance.updatePet(body)
    +except ApiException as e:
    +    print("Exception when calling PetApi->updatePet: %s\n" % e)
    @@ -2702,8 +2888,8 @@ try { -
    + var view = new JSONSchemaView(schema,2,{isBodyParam: true}); + var result = $('#d2e199_updatePet_body'); + result.empty(); + result.append(view.render()); +}); + +
    @@ -2748,10 +2925,28 @@ try {

    Responses

    Status: 400 - Invalid ID supplied

    + + +
    +
    +

    Status: 404 - Pet not found

    + + +
    +
    +

    Status: 405 - Validation exception

    + + +
    +
    +
    @@ -2781,20 +2976,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X post "http://petstore.swagger.io/v2/pet/{petId}"
    -  
    +
    curl -X post "http://petstore.swagger.io/v2/pet/{petId}"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .PetApi;
    +import io.swagger.client.api.PetApi;
     
     import java.io.File;
     import java.util.*;
    @@ -2819,14 +3013,11 @@ public class PetApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .PetApi;
    +                            
    import io.swagger.client.api.PetApi;
     
     public class PetApiExample {
     
    @@ -2842,22 +3033,18 @@ public class PetApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  Configuration *apiConfig = [Configuration sharedConfig];
    +                              
    Configuration *apiConfig = [Configuration sharedConfig];
     
     // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
     [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
     
    -
     Long *petId = 789; // ID of pet that needs to be updated
     String *name = name_example; // Updated name of the pet (optional)
     String *status = status_example; // Updated status of the pet (optional)
    @@ -2873,20 +3060,18 @@ PetApi *apiInstance = [[PetApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    -var defaultClient = .ApiClient.instance;
    +                              
    var SwaggerPetstore = require('swagger_petstore');
    +var defaultClient = SwaggerPetstore.ApiClient.instance;
     
     // Configure OAuth2 access token for authorization: petstore_auth
     var petstore_auth = defaultClient.authentications['petstore_auth'];
     petstore_auth.accessToken = "YOUR ACCESS TOKEN"
     
    -var api = new .PetApi()
    +var api = new SwaggerPetstore.PetApi()
     
     var petId = 789; // {Long} ID of pet that needs to be updated
     
    @@ -2903,20 +3088,18 @@ var callback = function(error, data, response) {
       }
     };
     api.updatePetWithForm(petId, opts, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -2944,20 +3127,17 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     // Configure OAuth2 access token for authorization: petstore_auth
    -io.swagger.client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
    +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
     
    -$api_instance = new io.swagger.client\Api\PetApi();
    +$api_instance = new Swagger\Client\Api\PetApi();
     $petId = 789; // Long | ID of pet that needs to be updated
     $name = name_example; // String | Updated name of the pet
     $status = status_example; // String | Updated status of the pet
    @@ -2967,8 +3147,51 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::PetApi;
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
    +
    +my $api_instance = WWW::SwaggerClient::PetApi->new();
    +my $petId = 789; # Long | ID of pet that needs to be updated
    +my $name = name_example; # String | Updated name of the pet
    +my $status = status_example; # String | Updated status of the pet
    +
    +eval { 
    +    $api_instance->updatePetWithForm(petId => $petId, name => $name, status => $status);
    +};
    +if ($@) {
    +    warn "Exception when calling PetApi->updatePetWithForm: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
    +
    +# create an instance of the API class
    +api_instance = swagger_client.PetApi()
    +petId = 789 # Long | ID of pet that needs to be updated
    +name = name_example # String | Updated name of the pet (optional)
    +status = status_example # String | Updated status of the pet (optional)
    +
    +try: 
    +    # Updates a pet in the store with form data
    +    api_instance.updatePetWithForm(petId, name=name, status=status)
    +except ApiException as e:
    +    print("Exception when calling PetApi->updatePetWithForm: %s\n" % e)
    @@ -2999,7 +3222,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_updatePetWithForm_petId'); result.empty(); result.append(view.render()); @@ -3042,7 +3265,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_updatePetWithForm_name'); result.empty(); result.append(view.render()); @@ -3075,7 +3298,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_updatePetWithForm_status'); result.empty(); result.append(view.render()); @@ -3096,6 +3319,12 @@ try {

    Responses

    Status: 405 - Invalid input

    + + +
    +
    +
    @@ -3125,20 +3354,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X post "http://petstore.swagger.io/v2/pet/{petId}/uploadImage"
    -  
    +
    curl -X post "http://petstore.swagger.io/v2/pet/{petId}/uploadImage"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .PetApi;
    +import io.swagger.client.api.PetApi;
     
     import java.io.File;
     import java.util.*;
    @@ -3155,7 +3383,7 @@ public class PetApiExample {
             PetApi apiInstance = new PetApi();
             Long petId = 789; // Long | ID of pet to update
             String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
    -        file file = /path/to/file.txt; // file | file to upload
    +        File file = /path/to/file.txt; // File | file to upload
             try {
                 ApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
                 System.out.println(result);
    @@ -3164,14 +3392,11 @@ public class PetApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .PetApi;
    +                            
    import io.swagger.client.api.PetApi;
     
     public class PetApiExample {
     
    @@ -3179,7 +3404,7 @@ public class PetApiExample {
             PetApi apiInstance = new PetApi();
             Long petId = 789; // Long | ID of pet to update
             String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
    -        file file = /path/to/file.txt; // file | file to upload
    +        File file = /path/to/file.txt; // File | file to upload
             try {
                 ApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
                 System.out.println(result);
    @@ -3188,25 +3413,21 @@ public class PetApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  Configuration *apiConfig = [Configuration sharedConfig];
    +                              
    Configuration *apiConfig = [Configuration sharedConfig];
     
     // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
     [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
     
    -
     Long *petId = 789; // ID of pet to update
     String *additionalMetadata = additionalMetadata_example; // Additional data to pass to server (optional)
    -file *file = /path/to/file.txt; // file to upload (optional)
    +File *file = /path/to/file.txt; // file to upload (optional)
     
     PetApi *apiInstance = [[PetApi alloc] init];
     
    @@ -3222,26 +3443,24 @@ PetApi *apiInstance = [[PetApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    -var defaultClient = .ApiClient.instance;
    +                              
    var SwaggerPetstore = require('swagger_petstore');
    +var defaultClient = SwaggerPetstore.ApiClient.instance;
     
     // Configure OAuth2 access token for authorization: petstore_auth
     var petstore_auth = defaultClient.authentications['petstore_auth'];
     petstore_auth.accessToken = "YOUR ACCESS TOKEN"
     
    -var api = new .PetApi()
    +var api = new SwaggerPetstore.PetApi()
     
     var petId = 789; // {Long} ID of pet to update
     
     var opts = { 
       'additionalMetadata': additionalMetadata_example, // {String} Additional data to pass to server
    -  'file': /path/to/file.txt // {file} file to upload
    +  'file': /path/to/file.txt // {File} file to upload
     };
     
     var callback = function(error, data, response) {
    @@ -3252,20 +3471,18 @@ var callback = function(error, data, response) {
       }
     };
     api.uploadFile(petId, opts, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -3280,7 +3497,7 @@ namespace Example
                 var apiInstance = new PetApi();
                 var petId = 789;  // Long | ID of pet to update
                 var additionalMetadata = additionalMetadata_example;  // String | Additional data to pass to server (optional) 
    -            var file = new file(); // file | file to upload (optional) 
    +            var file = new File(); // File | file to upload (optional) 
     
                 try
                 {
    @@ -3294,23 +3511,20 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     // Configure OAuth2 access token for authorization: petstore_auth
    -io.swagger.client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
    +Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
     
    -$api_instance = new io.swagger.client\Api\PetApi();
    +$api_instance = new Swagger\Client\Api\PetApi();
     $petId = 789; // Long | ID of pet to update
     $additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
    -$file = /path/to/file.txt; // file | file to upload
    +$file = /path/to/file.txt; // File | file to upload
     
     try {
         $result = $api_instance->uploadFile($petId, $additionalMetadata, $file);
    @@ -3318,8 +3532,53 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::PetApi;
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
    +
    +my $api_instance = WWW::SwaggerClient::PetApi->new();
    +my $petId = 789; # Long | ID of pet to update
    +my $additionalMetadata = additionalMetadata_example; # String | Additional data to pass to server
    +my $file = /path/to/file.txt; # File | file to upload
    +
    +eval { 
    +    my $result = $api_instance->uploadFile(petId => $petId, additionalMetadata => $additionalMetadata, file => $file);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling PetApi->uploadFile: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure OAuth2 access token for authorization: petstore_auth
    +swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
    +
    +# create an instance of the API class
    +api_instance = swagger_client.PetApi()
    +petId = 789 # Long | ID of pet to update
    +additionalMetadata = additionalMetadata_example # String | Additional data to pass to server (optional)
    +file = /path/to/file.txt # File | file to upload (optional)
    +
    +try: 
    +    # uploads an image
    +    api_response = api_instance.uploadFile(petId, additionalMetadata=additionalMetadata, file=file)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling PetApi->uploadFile: %s\n" % e)
    @@ -3350,7 +3609,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_uploadFile_petId'); result.empty(); result.append(view.render()); @@ -3393,7 +3652,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_uploadFile_additionalMetadata'); result.empty(); result.append(view.render()); @@ -3426,7 +3685,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_uploadFile_file'); result.empty(); result.append(view.render()); @@ -3447,18 +3706,17 @@ try {

    Responses

    Status: 200 - successful operation

    - -
    -
    -
    - -
    - +
    -
    + +
    @@ -3519,20 +3779,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X delete "http://petstore.swagger.io/v2/store/order/{orderId}"
    -  
    +
    curl -X delete "http://petstore.swagger.io/v2/store/order/{orderId}"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .StoreApi;
    +import io.swagger.client.api.StoreApi;
     
     import java.io.File;
     import java.util.*;
    @@ -3550,14 +3809,11 @@ public class StoreApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .StoreApi;
    +                            
    import io.swagger.client.api.StoreApi;
     
     public class StoreApiExample {
     
    @@ -3571,18 +3827,14 @@ public class StoreApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  
    -String *orderId = orderId_example; // ID of the order that needs to be deleted
    +                              
    String *orderId = orderId_example; // ID of the order that needs to be deleted
     
     StoreApi *apiInstance = [[StoreApi alloc] init];
     
    @@ -3593,15 +3845,13 @@ StoreApi *apiInstance = [[StoreApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    +                              
    var SwaggerPetstore = require('swagger_petstore');
     
    -var api = new .StoreApi()
    +var api = new SwaggerPetstore.StoreApi()
     
     var orderId = orderId_example; // {String} ID of the order that needs to be deleted
     
    @@ -3614,20 +3864,18 @@ var callback = function(error, data, response) {
       }
     };
     api.deleteOrder(orderId, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -3650,17 +3898,14 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new io.swagger.client\Api\StoreApi();
    +$api_instance = new Swagger\Client\Api\StoreApi();
     $orderId = orderId_example; // String | ID of the order that needs to be deleted
     
     try {
    @@ -3668,8 +3913,41 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling StoreApi->deleteOrder: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::StoreApi;
    +
    +my $api_instance = WWW::SwaggerClient::StoreApi->new();
    +my $orderId = orderId_example; # String | ID of the order that needs to be deleted
    +
    +eval { 
    +    $api_instance->deleteOrder(orderId => $orderId);
    +};
    +if ($@) {
    +    warn "Exception when calling StoreApi->deleteOrder: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.StoreApi()
    +orderId = orderId_example # String | ID of the order that needs to be deleted
    +
    +try: 
    +    # Delete purchase order by ID
    +    api_instance.deleteOrder(orderId)
    +except ApiException as e:
    +    print("Exception when calling StoreApi->deleteOrder: %s\n" % e)
    @@ -3699,7 +3977,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_deleteOrder_orderId'); result.empty(); result.append(view.render()); @@ -3723,8 +4001,20 @@ try {

    Responses

    Status: 400 - Invalid ID supplied

    + + +
    +
    +

    Status: 404 - Order not found

    + + +
    +
    +
    @@ -3754,20 +4044,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X get -H "api_key: [[apiKey]]"  "http://petstore.swagger.io/v2/store/inventory"
    -  
    +
    curl -X get -H "api_key: [[apiKey]]" "http://petstore.swagger.io/v2/store/inventory"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .StoreApi;
    +import io.swagger.client.api.StoreApi;
     
     import java.io.File;
     import java.util.*;
    @@ -3792,14 +4081,11 @@ public class StoreApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .StoreApi;
    +                            
    import io.swagger.client.api.StoreApi;
     
     public class StoreApiExample {
     
    @@ -3813,17 +4099,14 @@ public class StoreApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  Configuration *apiConfig = [Configuration sharedConfig];
    +                              
    Configuration *apiConfig = [Configuration sharedConfig];
     
     // Configure API key authorization: (authentication scheme: api_key)
     [apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"];
    @@ -3831,7 +4114,6 @@ public class StoreApiExample {
     //[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"];
     
     
    -
     StoreApi *apiInstance = [[StoreApi alloc] init];
     
     // Returns pet inventories by status
    @@ -3844,14 +4126,12 @@ StoreApi *apiInstance = [[StoreApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    -var defaultClient = .ApiClient.instance;
    +                              
    var SwaggerPetstore = require('swagger_petstore');
    +var defaultClient = SwaggerPetstore.ApiClient.instance;
     
     // Configure API key authorization: api_key
     var api_key = defaultClient.authentications['api_key'];
    @@ -3859,7 +4139,7 @@ api_key.apiKey = "YOUR API KEY"
     // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
     //api_key.apiKeyPrefix['api_key'] = "Token"
     
    -var api = new .StoreApi()
    +var api = new SwaggerPetstore.StoreApi()
     
     var callback = function(error, data, response) {
       if (error) {
    @@ -3869,20 +4149,18 @@ var callback = function(error, data, response) {
       }
     };
     api.getInventory(callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -3910,22 +4188,19 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
     // Configure API key authorization: api_key
    -io.swagger.client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
    +Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
     // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    -// io.swagger.client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
    +// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
     
    -$api_instance = new io.swagger.client\Api\StoreApi();
    +$api_instance = new Swagger\Client\Api\StoreApi();
     
     try {
         $result = $api_instance->getInventory();
    @@ -3933,8 +4208,51 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling StoreApi->getInventory: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::StoreApi;
    +
    +# Configure API key authorization: api_key
    +$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
    +# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "Bearer";
    +
    +my $api_instance = WWW::SwaggerClient::StoreApi->new();
    +
    +eval { 
    +    my $result = $api_instance->getInventory();
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling StoreApi->getInventory: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure API key authorization: api_key
    +swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
    +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +# swagger_client.configuration.api_key_prefix['api_key'] = 'Bearer'
    +
    +# create an instance of the API class
    +api_instance = swagger_client.StoreApi()
    +
    +try: 
    +    # Returns pet inventories by status
    +    api_response = api_instance.getInventory()
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling StoreApi->getInventory: %s\n" % e)
    @@ -3948,18 +4266,17 @@ try {

    Responses

    Status: 200 - successful operation

    - -
    -
    -
    - -
    - +
    -
    + +
    @@ -4021,20 +4340,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X get "http://petstore.swagger.io/v2/store/order/{orderId}"
    -  
    +
    curl -X get "http://petstore.swagger.io/v2/store/order/{orderId}"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .StoreApi;
    +import io.swagger.client.api.StoreApi;
     
     import java.io.File;
     import java.util.*;
    @@ -4053,14 +4371,11 @@ public class StoreApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .StoreApi;
    +                            
    import io.swagger.client.api.StoreApi;
     
     public class StoreApiExample {
     
    @@ -4075,18 +4390,14 @@ public class StoreApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  
    -Long *orderId = 789; // ID of pet that needs to be fetched
    +                              
    Long *orderId = 789; // ID of pet that needs to be fetched
     
     StoreApi *apiInstance = [[StoreApi alloc] init];
     
    @@ -4100,15 +4411,13 @@ StoreApi *apiInstance = [[StoreApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    +                              
    var SwaggerPetstore = require('swagger_petstore');
     
    -var api = new .StoreApi()
    +var api = new SwaggerPetstore.StoreApi()
     
     var orderId = 789; // {Long} ID of pet that needs to be fetched
     
    @@ -4121,20 +4430,18 @@ var callback = function(error, data, response) {
       }
     };
     api.getOrderById(orderId, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -4158,17 +4465,14 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new io.swagger.client\Api\StoreApi();
    +$api_instance = new Swagger\Client\Api\StoreApi();
     $orderId = 789; // Long | ID of pet that needs to be fetched
     
     try {
    @@ -4177,8 +4481,43 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling StoreApi->getOrderById: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::StoreApi;
    +
    +my $api_instance = WWW::SwaggerClient::StoreApi->new();
    +my $orderId = 789; # Long | ID of pet that needs to be fetched
    +
    +eval { 
    +    my $result = $api_instance->getOrderById(orderId => $orderId);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling StoreApi->getOrderById: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.StoreApi()
    +orderId = 789 # Long | ID of pet that needs to be fetched
    +
    +try: 
    +    # Find purchase order by ID
    +    api_response = api_instance.getOrderById(orderId)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling StoreApi->getOrderById: %s\n" % e)
    @@ -4202,8 +4541,8 @@ try { "description" : "ID of pet that needs to be fetched", "required" : true, "type" : "integer", - "maximum" : 5.0, - "minimum" : 1.0, + "maximum" : 5, + "minimum" : 1, "format" : "int64" }; var schema = schemaWrapper; @@ -4211,7 +4550,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_getOrderById_orderId'); result.empty(); result.append(view.render()); @@ -4235,18 +4574,17 @@ try {

    Responses

    Status: 200 - successful operation

    - -
    -
    -
    - -
    - +
    -
    + +

    Status: 400 - Invalid ID supplied

    + + +
    +
    +

    Status: 404 - Order not found

    + + +
    +
    +
    @@ -4308,20 +4660,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X post "http://petstore.swagger.io/v2/store/order"
    -  
    +
    curl -X post "http://petstore.swagger.io/v2/store/order"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .StoreApi;
    +import io.swagger.client.api.StoreApi;
     
     import java.io.File;
     import java.util.*;
    @@ -4340,14 +4691,11 @@ public class StoreApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .StoreApi;
    +                            
    import io.swagger.client.api.StoreApi;
     
     public class StoreApiExample {
     
    @@ -4362,18 +4710,14 @@ public class StoreApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  
    -Order *body = ; // order placed for purchasing the pet
    +                              
    Order *body = ; // order placed for purchasing the pet
     
     StoreApi *apiInstance = [[StoreApi alloc] init];
     
    @@ -4387,15 +4731,13 @@ StoreApi *apiInstance = [[StoreApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    +                              
    var SwaggerPetstore = require('swagger_petstore');
     
    -var api = new .StoreApi()
    +var api = new SwaggerPetstore.StoreApi()
     
     var body = ; // {Order} order placed for purchasing the pet
     
    @@ -4408,20 +4750,18 @@ var callback = function(error, data, response) {
       }
     };
     api.placeOrder(body, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -4445,17 +4785,14 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new io.swagger.client\Api\StoreApi();
    +$api_instance = new Swagger\Client\Api\StoreApi();
     $body = ; // Order | order placed for purchasing the pet
     
     try {
    @@ -4464,8 +4801,43 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::StoreApi;
    +
    +my $api_instance = WWW::SwaggerClient::StoreApi->new();
    +my $body = WWW::SwaggerClient::Object::Order->new(); # Order | order placed for purchasing the pet
    +
    +eval { 
    +    my $result = $api_instance->placeOrder(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling StoreApi->placeOrder: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.StoreApi()
    +body =  # Order | order placed for purchasing the pet
    +
    +try: 
    +    # Place an order for a pet
    +    api_response = api_instance.placeOrder(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling StoreApi->placeOrder: %s\n" % e)
    @@ -4484,8 +4856,8 @@ try { -
    + var view = new JSONSchemaView(schema,2,{isBodyParam: true}); + var result = $('#d2e199_placeOrder_body'); + result.empty(); + result.append(view.render()); +}); + +
    @@ -4530,18 +4893,17 @@ try {

    Responses

    Status: 200 - successful operation

    - -
    -
    -
    - -
    - +
    -
    + +

    Status: 400 - Invalid Order

    + + +
    +
    +
    @@ -4604,20 +4974,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X post "http://petstore.swagger.io/v2/user"
    -  
    +
    curl -X post "http://petstore.swagger.io/v2/user"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .UserApi;
    +import io.swagger.client.api.UserApi;
     
     import java.io.File;
     import java.util.*;
    @@ -4635,14 +5004,11 @@ public class UserApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .UserApi;
    +                            
    import io.swagger.client.api.UserApi;
     
     public class UserApiExample {
     
    @@ -4656,18 +5022,14 @@ public class UserApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  
    -User *body = ; // Created user object
    +                              
    User *body = ; // Created user object
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
    @@ -4678,15 +5040,13 @@ UserApi *apiInstance = [[UserApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    +                              
    var SwaggerPetstore = require('swagger_petstore');
     
    -var api = new .UserApi()
    +var api = new SwaggerPetstore.UserApi()
     
     var body = ; // {User} Created user object
     
    @@ -4699,20 +5059,18 @@ var callback = function(error, data, response) {
       }
     };
     api.createUser(body, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -4735,17 +5093,14 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new io.swagger.client\Api\UserApi();
    +$api_instance = new Swagger\Client\Api\UserApi();
     $body = ; // User | Created user object
     
     try {
    @@ -4753,8 +5108,41 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::UserApi;
    +
    +my $api_instance = WWW::SwaggerClient::UserApi->new();
    +my $body = WWW::SwaggerClient::Object::User->new(); # User | Created user object
    +
    +eval { 
    +    $api_instance->createUser(body => $body);
    +};
    +if ($@) {
    +    warn "Exception when calling UserApi->createUser: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.UserApi()
    +body =  # User | Created user object
    +
    +try: 
    +    # Create user
    +    api_instance.createUser(body)
    +except ApiException as e:
    +    print("Exception when calling UserApi->createUser: %s\n" % e)
    @@ -4773,8 +5161,8 @@ try { -
    + var view = new JSONSchemaView(schema,2,{isBodyParam: true}); + var result = $('#d2e199_createUser_body'); + result.empty(); + result.append(view.render()); +}); + +
    @@ -4817,7 +5196,13 @@ try {

    Responses

    -

    Status: 0 - successful operation

    +

    Status: default - successful operation

    + + + +
    +
    @@ -4848,20 +5233,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X post "http://petstore.swagger.io/v2/user/createWithArray"
    -  
    +
    curl -X post "http://petstore.swagger.io/v2/user/createWithArray"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .UserApi;
    +import io.swagger.client.api.UserApi;
     
     import java.io.File;
     import java.util.*;
    @@ -4879,14 +5263,11 @@ public class UserApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .UserApi;
    +                            
    import io.swagger.client.api.UserApi;
     
     public class UserApiExample {
     
    @@ -4900,18 +5281,14 @@ public class UserApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  
    -array[User] *body = ; // List of user object
    +                              
    array[User] *body = ; // List of user object
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
    @@ -4922,15 +5299,13 @@ UserApi *apiInstance = [[UserApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    +                              
    var SwaggerPetstore = require('swagger_petstore');
     
    -var api = new .UserApi()
    +var api = new SwaggerPetstore.UserApi()
     
     var body = ; // {array[User]} List of user object
     
    @@ -4943,20 +5318,18 @@ var callback = function(error, data, response) {
       }
     };
     api.createUsersWithArrayInput(body, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -4979,17 +5352,14 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new io.swagger.client\Api\UserApi();
    +$api_instance = new Swagger\Client\Api\UserApi();
     $body = ; // array[User] | List of user object
     
     try {
    @@ -4997,8 +5367,41 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::UserApi;
    +
    +my $api_instance = WWW::SwaggerClient::UserApi->new();
    +my $body = [WWW::SwaggerClient::Object::array[User]->new()]; # array[User] | List of user object
    +
    +eval { 
    +    $api_instance->createUsersWithArrayInput(body => $body);
    +};
    +if ($@) {
    +    warn "Exception when calling UserApi->createUsersWithArrayInput: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.UserApi()
    +body =  # array[User] | List of user object
    +
    +try: 
    +    # Creates list of users with given input array
    +    api_instance.createUsersWithArrayInput(body)
    +except ApiException as e:
    +    print("Exception when calling UserApi->createUsersWithArrayInput: %s\n" % e)
    @@ -5017,8 +5420,8 @@ try { -
    + var view = new JSONSchemaView(schema,2,{isBodyParam: true}); + var result = $('#d2e199_createUsersWithArrayInput_body'); + result.empty(); + result.append(view.render()); +}); + +
    @@ -5064,7 +5458,13 @@ try {

    Responses

    -

    Status: 0 - successful operation

    +

    Status: default - successful operation

    + + + +
    +
    @@ -5095,20 +5495,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X post "http://petstore.swagger.io/v2/user/createWithList"
    -  
    +
    curl -X post "http://petstore.swagger.io/v2/user/createWithList"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .UserApi;
    +import io.swagger.client.api.UserApi;
     
     import java.io.File;
     import java.util.*;
    @@ -5126,14 +5525,11 @@ public class UserApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .UserApi;
    +                            
    import io.swagger.client.api.UserApi;
     
     public class UserApiExample {
     
    @@ -5147,18 +5543,14 @@ public class UserApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  
    -array[User] *body = ; // List of user object
    +                              
    array[User] *body = ; // List of user object
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
    @@ -5169,15 +5561,13 @@ UserApi *apiInstance = [[UserApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    +                              
    var SwaggerPetstore = require('swagger_petstore');
     
    -var api = new .UserApi()
    +var api = new SwaggerPetstore.UserApi()
     
     var body = ; // {array[User]} List of user object
     
    @@ -5190,20 +5580,18 @@ var callback = function(error, data, response) {
       }
     };
     api.createUsersWithListInput(body, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -5226,17 +5614,14 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new io.swagger.client\Api\UserApi();
    +$api_instance = new Swagger\Client\Api\UserApi();
     $body = ; // array[User] | List of user object
     
     try {
    @@ -5244,8 +5629,41 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::UserApi;
    +
    +my $api_instance = WWW::SwaggerClient::UserApi->new();
    +my $body = [WWW::SwaggerClient::Object::array[User]->new()]; # array[User] | List of user object
    +
    +eval { 
    +    $api_instance->createUsersWithListInput(body => $body);
    +};
    +if ($@) {
    +    warn "Exception when calling UserApi->createUsersWithListInput: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.UserApi()
    +body =  # array[User] | List of user object
    +
    +try: 
    +    # Creates list of users with given input array
    +    api_instance.createUsersWithListInput(body)
    +except ApiException as e:
    +    print("Exception when calling UserApi->createUsersWithListInput: %s\n" % e)
    @@ -5264,8 +5682,8 @@ try { -
    + var view = new JSONSchemaView(schema,2,{isBodyParam: true}); + var result = $('#d2e199_createUsersWithListInput_body'); + result.empty(); + result.append(view.render()); +}); + +
    @@ -5311,7 +5720,13 @@ try {

    Responses

    -

    Status: 0 - successful operation

    +

    Status: default - successful operation

    + + + +
    +
    @@ -5342,20 +5757,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X delete "http://petstore.swagger.io/v2/user/{username}"
    -  
    +
    curl -X delete "http://petstore.swagger.io/v2/user/{username}"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .UserApi;
    +import io.swagger.client.api.UserApi;
     
     import java.io.File;
     import java.util.*;
    @@ -5373,14 +5787,11 @@ public class UserApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .UserApi;
    +                            
    import io.swagger.client.api.UserApi;
     
     public class UserApiExample {
     
    @@ -5394,18 +5805,14 @@ public class UserApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  
    -String *username = username_example; // The name that needs to be deleted
    +                              
    String *username = username_example; // The name that needs to be deleted
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
    @@ -5416,15 +5823,13 @@ UserApi *apiInstance = [[UserApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    +                              
    var SwaggerPetstore = require('swagger_petstore');
     
    -var api = new .UserApi()
    +var api = new SwaggerPetstore.UserApi()
     
     var username = username_example; // {String} The name that needs to be deleted
     
    @@ -5437,20 +5842,18 @@ var callback = function(error, data, response) {
       }
     };
     api.deleteUser(username, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -5473,17 +5876,14 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new io.swagger.client\Api\UserApi();
    +$api_instance = new Swagger\Client\Api\UserApi();
     $username = username_example; // String | The name that needs to be deleted
     
     try {
    @@ -5491,8 +5891,41 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::UserApi;
    +
    +my $api_instance = WWW::SwaggerClient::UserApi->new();
    +my $username = username_example; # String | The name that needs to be deleted
    +
    +eval { 
    +    $api_instance->deleteUser(username => $username);
    +};
    +if ($@) {
    +    warn "Exception when calling UserApi->deleteUser: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.UserApi()
    +username = username_example # String | The name that needs to be deleted
    +
    +try: 
    +    # Delete user
    +    api_instance.deleteUser(username)
    +except ApiException as e:
    +    print("Exception when calling UserApi->deleteUser: %s\n" % e)
    @@ -5522,7 +5955,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_deleteUser_username'); result.empty(); result.append(view.render()); @@ -5546,8 +5979,20 @@ try {

    Responses

    Status: 400 - Invalid username supplied

    + + +
    +
    +

    Status: 404 - User not found

    + + +
    +
    +
    @@ -5577,20 +6022,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X get "http://petstore.swagger.io/v2/user/{username}"
    -  
    +
    curl -X get "http://petstore.swagger.io/v2/user/{username}"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .UserApi;
    +import io.swagger.client.api.UserApi;
     
     import java.io.File;
     import java.util.*;
    @@ -5609,14 +6053,11 @@ public class UserApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .UserApi;
    +                            
    import io.swagger.client.api.UserApi;
     
     public class UserApiExample {
     
    @@ -5631,18 +6072,14 @@ public class UserApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  
    -String *username = username_example; // The name that needs to be fetched. Use user1 for testing. 
    +                              
    String *username = username_example; // The name that needs to be fetched. Use user1 for testing. 
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
    @@ -5656,15 +6093,13 @@ UserApi *apiInstance = [[UserApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    +                              
    var SwaggerPetstore = require('swagger_petstore');
     
    -var api = new .UserApi()
    +var api = new SwaggerPetstore.UserApi()
     
     var username = username_example; // {String} The name that needs to be fetched. Use user1 for testing. 
     
    @@ -5677,20 +6112,18 @@ var callback = function(error, data, response) {
       }
     };
     api.getUserByName(username, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -5714,17 +6147,14 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new io.swagger.client\Api\UserApi();
    +$api_instance = new Swagger\Client\Api\UserApi();
     $username = username_example; // String | The name that needs to be fetched. Use user1 for testing. 
     
     try {
    @@ -5733,8 +6163,43 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling UserApi->getUserByName: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::UserApi;
    +
    +my $api_instance = WWW::SwaggerClient::UserApi->new();
    +my $username = username_example; # String | The name that needs to be fetched. Use user1 for testing. 
    +
    +eval { 
    +    my $result = $api_instance->getUserByName(username => $username);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling UserApi->getUserByName: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.UserApi()
    +username = username_example # String | The name that needs to be fetched. Use user1 for testing. 
    +
    +try: 
    +    # Get user by user name
    +    api_response = api_instance.getUserByName(username)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling UserApi->getUserByName: %s\n" % e)
    @@ -5764,7 +6229,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_getUserByName_username'); result.empty(); result.append(view.render()); @@ -5788,18 +6253,17 @@ try {

    Responses

    Status: 200 - successful operation

    - -
    -
    -
    - -
    - +
    -
    + +

    Status: 400 - Invalid username supplied

    + + +
    +
    +

    Status: 404 - User not found

    + + +
    +
    +
    @@ -5861,20 +6339,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X get "http://petstore.swagger.io/v2/user/login?username=&password="
    -  
    +
    curl -X get "http://petstore.swagger.io/v2/user/login?username=&password="
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .UserApi;
    +import io.swagger.client.api.UserApi;
     
     import java.io.File;
     import java.util.*;
    @@ -5894,14 +6371,11 @@ public class UserApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .UserApi;
    +                            
    import io.swagger.client.api.UserApi;
     
     public class UserApiExample {
     
    @@ -5917,18 +6391,14 @@ public class UserApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  
    -String *username = username_example; // The user name for login
    +                              
    String *username = username_example; // The user name for login
     String *password = password_example; // The password for login in clear text
     
     UserApi *apiInstance = [[UserApi alloc] init];
    @@ -5944,15 +6414,13 @@ UserApi *apiInstance = [[UserApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    +                              
    var SwaggerPetstore = require('swagger_petstore');
     
    -var api = new .UserApi()
    +var api = new SwaggerPetstore.UserApi()
     
     var username = username_example; // {String} The user name for login
     
    @@ -5967,20 +6435,18 @@ var callback = function(error, data, response) {
       }
     };
     api.loginUser(username, password, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -6005,17 +6471,14 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new io.swagger.client\Api\UserApi();
    +$api_instance = new Swagger\Client\Api\UserApi();
     $username = username_example; // String | The user name for login
     $password = password_example; // String | The password for login in clear text
     
    @@ -6025,8 +6488,45 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling UserApi->loginUser: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::UserApi;
    +
    +my $api_instance = WWW::SwaggerClient::UserApi->new();
    +my $username = username_example; # String | The user name for login
    +my $password = password_example; # String | The password for login in clear text
    +
    +eval { 
    +    my $result = $api_instance->loginUser(username => $username, password => $password);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling UserApi->loginUser: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.UserApi()
    +username = username_example # String | The user name for login
    +password = password_example # String | The password for login in clear text
    +
    +try: 
    +    # Logs user into the system
    +    api_response = api_instance.loginUser(username, password)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling UserApi->loginUser: %s\n" % e)
    @@ -6060,7 +6560,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_loginUser_username'); result.empty(); result.append(view.render()); @@ -6093,7 +6593,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_loginUser_password'); result.empty(); result.append(view.render()); @@ -6113,18 +6613,20 @@ try {

    Responses

    Status: 200 - successful operation

    - -
    -
    -
    - -
    - +
    -
    +
    + + + + + + + + + + + + + + + + + + + +
    NameTypeFormatDescription
    X-Rate-LimitIntegerint32calls per hour allowed by the user
    X-Expires-AfterDatedate-timedate in UTC when toekn expires
    +
    + +

    Status: 400 - Invalid username/password supplied

    + + +
    +
    +
    @@ -6196,20 +6728,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X get "http://petstore.swagger.io/v2/user/logout"
    -  
    +
    curl -X get "http://petstore.swagger.io/v2/user/logout"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .UserApi;
    +import io.swagger.client.api.UserApi;
     
     import java.io.File;
     import java.util.*;
    @@ -6226,14 +6757,11 @@ public class UserApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .UserApi;
    +                            
    import io.swagger.client.api.UserApi;
     
     public class UserApiExample {
     
    @@ -6246,9 +6774,7 @@ public class UserApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    
    -  
    -
     UserApi *apiInstance = [[UserApi alloc] init];
     
     // Logs out current logged in user session
    @@ -6267,15 +6791,13 @@ UserApi *apiInstance = [[UserApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    +                              
    var SwaggerPetstore = require('swagger_petstore');
     
    -var api = new .UserApi()
    +var api = new SwaggerPetstore.UserApi()
     
     var callback = function(error, data, response) {
       if (error) {
    @@ -6285,20 +6807,18 @@ var callback = function(error, data, response) {
       }
     };
     api.logoutUser(callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -6320,25 +6840,53 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new io.swagger.client\Api\UserApi();
    +$api_instance = new Swagger\Client\Api\UserApi();
     
     try {
         $api_instance->logoutUser();
     } catch (Exception $e) {
         echo 'Exception when calling UserApi->logoutUser: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::UserApi;
    +
    +my $api_instance = WWW::SwaggerClient::UserApi->new();
    +
    +eval { 
    +    $api_instance->logoutUser();
    +};
    +if ($@) {
    +    warn "Exception when calling UserApi->logoutUser: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.UserApi()
    +
    +try: 
    +    # Logs out current logged in user session
    +    api_instance.logoutUser()
    +except ApiException as e:
    +    print("Exception when calling UserApi->logoutUser: %s\n" % e)
    @@ -6350,7 +6898,13 @@ try {

    Responses

    -

    Status: 0 - successful operation

    +

    Status: default - successful operation

    + + + +
    +
    @@ -6381,20 +6935,19 @@ try {
  • C#
  • PHP
  • +
  • Perl
  • +
  • Python
  • -
    
    -  curl -X put "http://petstore.swagger.io/v2/user/{username}"
    -  
    +
    curl -X put "http://petstore.swagger.io/v2/user/{username}"
    -
    
    -  import io.swagger.client.*;
    +                            
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    -import .UserApi;
    +import io.swagger.client.api.UserApi;
     
     import java.io.File;
     import java.util.*;
    @@ -6413,14 +6966,11 @@ public class UserApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  import .UserApi;
    +                            
    import io.swagger.client.api.UserApi;
     
     public class UserApiExample {
     
    @@ -6435,18 +6985,14 @@ public class UserApiExample {
                 e.printStackTrace();
             }
         }
    -}
    -
    -                            
    +}
    -
    
    -  
    -String *username = username_example; // name that need to be deleted
    +                              
    String *username = username_example; // name that need to be deleted
     User *body = ; // Updated user object
     
     UserApi *apiInstance = [[UserApi alloc] init];
    @@ -6459,15 +7005,13 @@ UserApi *apiInstance = [[UserApi alloc] init];
                                     NSLog(@"Error: %@", error);
                                 }
                             }];
    -
    -                              
    +
    -
    
    -  var  = require('');
    +                              
    var SwaggerPetstore = require('swagger_petstore');
     
    -var api = new .UserApi()
    +var api = new SwaggerPetstore.UserApi()
     
     var username = username_example; // {String} name that need to be deleted
     
    @@ -6482,20 +7026,18 @@ var callback = function(error, data, response) {
       }
     };
     api.updateUser(username, body, callback);
    -
    -                              
    +
    -
    
    -  using System;
    +                              
    using System;
     using System.Diagnostics;
    -using .Api;
    -using .Client;
    -using ;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
     
     namespace Example
     {
    @@ -6519,17 +7061,14 @@ namespace Example
                 }
             }
         }
    -}
    -
    -                              
    +}
    -
    
    -  
    +                              
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    -$api_instance = new io.swagger.client\Api\UserApi();
    +$api_instance = new Swagger\Client\Api\UserApi();
     $username = username_example; // String | name that need to be deleted
     $body = ; // User | Updated user object
     
    @@ -6538,8 +7077,43 @@ try {
     } catch (Exception $e) {
         echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), PHP_EOL;
     }
    +?>
    +
    - +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::UserApi;
    +
    +my $api_instance = WWW::SwaggerClient::UserApi->new();
    +my $username = username_example; # String | name that need to be deleted
    +my $body = WWW::SwaggerClient::Object::User->new(); # User | Updated user object
    +
    +eval { 
    +    $api_instance->updateUser(username => $username, body => $body);
    +};
    +if ($@) {
    +    warn "Exception when calling UserApi->updateUser: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.UserApi()
    +username = username_example # String | name that need to be deleted
    +body =  # User | Updated user object
    +
    +try: 
    +    # Updated user
    +    api_instance.updateUser(username, body)
    +except ApiException as e:
    +    print("Exception when calling UserApi->updateUser: %s\n" % e)
    @@ -6569,7 +7143,7 @@ try { - var view = new JSONSchemaView(schema,0); + var view = new JSONSchemaView(schema,1); var result = $('#d2e199_updateUser_username'); result.empty(); result.append(view.render()); @@ -6598,8 +7172,8 @@ try { -
    + var view = new JSONSchemaView(schema,2,{isBodyParam: true}); + var result = $('#d2e199_updateUser_body'); + result.empty(); + result.append(view.render()); +}); + +
    @@ -6644,8 +7209,20 @@ try {

    Responses

    Status: 400 - Invalid user supplied

    + + +
    +
    +

    Status: 404 - User not found

    + + +
    +
    +
    @@ -6660,15 +7237,978 @@ try {
    http://www.apache.org/licenses/LICENSE-2.0.html
    -
    -
    - Generated 2017-04-06T03:19:44.348Z -
    -
    + + + +