Compare commits

...

11 Commits

Author SHA1 Message Date
William Cheng
1ba38d6a5c add TS server 2020-07-14 22:44:25 +08:00
Sebastien Rosset
b86a51ae17 fix typo (#6928) 2020-07-14 14:03:04 +08:00
William Cheng
5980c420e3 minor fix to sample code (java jersey2) (#6921) 2020-07-14 12:36:05 +08:00
Justin Black
dad931a25a Python exp sample component renaming + additions (#6917)
* Stops converting primitive models into object models, adds ComposedSchemas with mixed type

* Reverts java and mustache changes

* Reverts mroe files

* Samples regen

* Fixes remaining tests
2020-07-13 10:22:03 -07:00
William Cheng
29183e0280 [PowerShell] support default value in models (#6920)
* support default value in ps

* revert changes to the spec
2020-07-13 13:41:10 +08:00
William Cheng
1044c30293 add cake addin (#6918) 2020-07-13 10:19:06 +08:00
William Cheng
a7446983e8 Add a link to Go article in Qiita Blog (#6919) 2020-07-13 10:18:43 +08:00
William Cheng
53950f8aff Add a link to DreamFactory blog (#6910) 2020-07-11 23:09:52 +08:00
William Cheng
6a49c4ec02 add option disallowAdditionalPropertiesIfNotPresent to ps generator (#6909) 2020-07-11 22:41:24 +08:00
William Cheng
57bf9e85a1 [Go][Experimental] Add the option disallowAdditionalPropertiesIfNotPresent (#6908)
* add disallowAdditionalPropertiesIfNotPresent to go exp generator

* update cache key

* fix spring.xml with 5.0.0-SNAPSHOT
2020-07-11 16:53:28 +08:00
William Cheng
47b4e16420 Remove JDK7 tests in CircleCI (#6890)
* remove jdk7 tests in circleci

* test microprofile-rest-client in jdk8
2020-07-09 17:46:52 +08:00
136 changed files with 5068 additions and 1812 deletions

View File

@@ -60,8 +60,8 @@ elif [ "$NODE_INDEX" = "2" ]; then
# run integration tests
mvn --no-snapshot-updates --quiet verify -Psamples.misc -Dorg.slf4j.simpleLogger.defaultLogLevel=error
else
echo "Running node $NODE_INDEX to test 'samples.circleci.jdk7' defined in pom.xml ..."
sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
echo "Running node $NODE_INDEX to test 'samples.circleci.others' defined in pom.xml ..."
#sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
java -version
# install dart2
@@ -73,7 +73,7 @@ else
sudo apt-get install dart
export PATH="$PATH:/usr/lib/dart/bin"
mvn --no-snapshot-updates --quiet verify -Psamples.circleci.jdk7 -Dorg.slf4j.simpleLogger.defaultLogLevel=error
mvn --no-snapshot-updates --quiet verify -Psamples.circleci.others -Dorg.slf4j.simpleLogger.defaultLogLevel=error
fi

View File

@@ -757,6 +757,9 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- 2020-05-22 - [TypeScript REST API Client](https://dev.to/unhurried/typescript-rest-api-client-4in3) by ["unhurried"](https://dev.to/unhurried)
- 2020-05-28 - [【使用 lotify + Swagger 建置可共用的 LINE Notify bot】 - #NiJia @ Chatbot Developer Taiwan 第 #19 小聚](https://www.youtube.com/watch?v=agYVz6dzh1I) by [Chatbot Developer Taiwan](https://www.youtube.com/channel/UCxeYUyZNnHmpX23YNF-ewvw)
- 2020-06-23 - [新規サーバーアプリケーションにTypeScriptを採用してみた](https://www.cam-inc.co.jp/news/20200623) at [CAM Tech Blog](https://www.cam-inc.co.jp/news/tech-blog/)
- 2020-07-07 - [5 Best API Documentation Tools](https://blog.dreamfactory.com/5-best-api-documentation-tools/) by Susanna Bouse at [DreamFactory Blog](https://blog.dreamfactory.com/)
- 2020-07-12 - [Open API 3.0の定義からgolangのサーバコードのスケルトンを作成する](https://qiita.com/professor/items/4cbd04ec084d13057bc2) by [@professor (Qiita Blog)](https://qiita.com/professor)
## [6 - About Us](#table-of-contents)

View File

@@ -0,0 +1,32 @@
#!/bin/sh
SCRIPT="$0"
echo "# START SCRIPT: $SCRIPT"
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
if [ ! -f "$executable" ]
then
mvn -B clean package
fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-server -o samples/server/petstore/typescript-server/ $@"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -0,0 +1,14 @@
@ECHO OFF
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
If Not Exist %executable% (
mvn clean package
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
echo
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-server -o samples\server\petstore\typescript-server
java %JAVA_OPTS% -jar %executable% %ags%

View File

@@ -22,9 +22,9 @@ jobs:
- restore_cache:
keys:
# Default branch if not
- source-v1-{{ .Branch }}-{{ .Revision }}
- source-v1-{{ .Branch }}-
- source-v1-
- source-v2-{{ .Branch }}-{{ .Revision }}
- source-v2-{{ .Branch }}-
- source-v2-
# Machine Setup
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
# The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out.
@@ -70,7 +70,7 @@ jobs:
- run: ./CI/circle_parallel.sh
# Save dependency cache
- save_cache:
key: source-v1-{{ .Branch }}-{{ .Revision }}
key: source-v2-{{ .Branch }}-{{ .Revision }}
paths:
# This is a broad list of cache paths to include many possible development environments
# You can probably delete some of these entries

View File

@@ -5,6 +5,7 @@ sidebar_label: go-experimental
| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|disallowAdditionalPropertiesIfNotPresent|Specify the behavior when the 'additionalProperties' keyword is not present in the OAS document. If false: the 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. If true: when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.This setting is currently ignored for OAS 2.0 documents: 1) When the 'additionalProperties' keyword is not present in a 2.0 schema, additional properties are NOT allowed. 2) Boolean values of the 'additionalProperties' keyword are ignored. It's as if additional properties are NOT allowed.Note: the root cause are issues #1369 and #1371, which must be resolved in the swagger-parser project.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is automatically set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.</dd></dl>|true|
|enumClassPrefix|Prefix enum with class name| |false|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|isGoSubmodule|whether the generated Go module is a submodule| |false|

View File

@@ -7,6 +7,7 @@ sidebar_label: powershell
| ------ | ----------- | ------ | ------- |
|apiNamePrefix|Prefix that will be appended to all PS objects. Default: empty string. e.g. Pet =&gt; PSPet.| |null|
|commonVerbs|PS common verb mappings. e.g. Delete=Remove:Patch=Update to map Delete with Remove and Patch with Update accordingly.| |null|
|disallowAdditionalPropertiesIfNotPresent|Specify the behavior when the 'additionalProperties' keyword is not present in the OAS document. If false: the 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. If true: when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.This setting is currently ignored for OAS 2.0 documents: 1) When the 'additionalProperties' keyword is not present in a 2.0 schema, additional properties are NOT allowed. 2) Boolean values of the 'additionalProperties' keyword are ignored. It's as if additional properties are NOT allowed.Note: the root cause are issues #1369 and #1371, which must be resolved in the swagger-parser project.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is automatically set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.</dd></dl>|true|
|discardReadOnly|Set discardReadonly to true to generate the Initialize cmdlet without readonly parameters| |null|
|packageGuid|GUID for PowerShell module (e.g. a27b908d-2a20-467f-bc32-af6f3a654ac5). A random GUID will be generated by default.| |null|
|packageName|Client package name (e.g. PSTwitter).| |PSOpenAPITools|

View File

@@ -27,6 +27,10 @@ Please refer to https://github.com/upstart-commerce/sbt-openapi-generator
Please refer to https://github.com/OpenAPITools/openapi-generator-bazel
### Cake Addin
3rd-party Cake Addin provided by [Lukas Körfer](https://github.com/lukoerfer): https://github.com/lukoerfer/cake-openapi-generator
### GitHub Integration
To push the auto-generated SDK to GitHub, we provide `git_push.sh` to streamline the process. For example:

View File

@@ -20,7 +20,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>4.3.1-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -2514,7 +2514,11 @@ public class DefaultCodegen implements CodegenConfig {
// process 'additionalProperties'
if (schema.getAdditionalProperties() == null) {
m.isAdditionalPropertiesTrue = false; // TODO fix the old (incorrect) behaviour (likely with an option)
if (disallowAdditionalPropertiesIfNotPresent) {
m.isAdditionalPropertiesTrue = false;
} else {
m.isAdditionalPropertiesTrue = true;
}
} else if (schema.getAdditionalProperties() instanceof Boolean) {
if (Boolean.TRUE.equals(schema.getAdditionalProperties())) {
m.isAdditionalPropertiesTrue = true;

View File

@@ -47,6 +47,21 @@ public class GoClientExperimentalCodegen extends GoClientCodegen {
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata).stability(Stability.EXPERIMENTAL).build();
cliOptions.add(new CliOption(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC).defaultValue("false"));
// option to change how we process + set the data in the 'additionalProperties' keyword.
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
"when the 'additionalProperties' keyword is not present in a schema, " +
"the value of 'additionalProperties' is automatically set to false, i.e. no additional properties are allowed. " +
"Note: this mode is not compliant with the JSON schema specification. " +
"This is the original openapi-generator behavior.");
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
this.setDisallowAdditionalPropertiesIfNotPresent(true);
}
/**
@@ -102,6 +117,11 @@ public class GoClientExperimentalCodegen extends GoClientCodegen {
additionalProperties.put(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, useOneOfDiscriminatorLookup);
}
if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) {
this.setDisallowAdditionalPropertiesIfNotPresent(Boolean.valueOf(additionalProperties
.get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString()));
}
}
public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) {

View File

@@ -501,6 +501,21 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
cliOptions.add(new CliOption("commonVerbs", "PS common verb mappings. e.g. Delete=Remove:Patch=Update to map Delete with Remove and Patch with Update accordingly."));
cliOptions.add(new CliOption(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC));
cliOptions.add(new CliOption("discardReadOnly", "Set discardReadonly to true to generate the Initialize cmdlet without readonly parameters"));
// option to change how we process + set the data in the 'additionalProperties' keyword.
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString());
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
"when the 'additionalProperties' keyword is not present in a schema, " +
"the value of 'additionalProperties' is automatically set to false, i.e. no additional properties are allowed. " +
"Note: this mode is not compliant with the JSON schema specification. " +
"This is the original openapi-generator behavior.");
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
this.setDisallowAdditionalPropertiesIfNotPresent(true);
// default value in the template
additionalProperties.put("powershellVersion", "6.2"); // minimal PS version
@@ -550,7 +565,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
public boolean getUseOneOfDiscriminatorLookup() {
return this.useOneOfDiscriminatorLookup;
}
public void setDiscardReadOnly(boolean discardReadOnly) {
this.discardReadOnly = discardReadOnly;
}
@@ -632,6 +647,11 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
LOGGER.warn(CodegenConstants.API_PACKAGE + " with " + this.getName() + " generator is ignored. Setting this value independently of " + CodegenConstants.PACKAGE_NAME + " is not currently supported.");
}
if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) {
this.setDisallowAdditionalPropertiesIfNotPresent(Boolean.valueOf(additionalProperties
.get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString()));
}
additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage());
additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage());
@@ -931,13 +951,13 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
for (CodegenProperty cp : model.allVars) {
cp.vendorExtensions.put("x-powershell-data-type", getPSDataType(cp));
if(this.discardReadOnly && !cp.isReadOnly) {
if (this.discardReadOnly && !cp.isReadOnly) {
lastWritableProperty = cp;
}
}
// Mark the last readonly false property
if(this.discardReadOnly && lastWritableProperty != null) {
if (this.discardReadOnly && lastWritableProperty != null) {
lastWritableProperty.vendorExtensions.put("x-powershell-last-writable", true);
model.allVars.set(model.allVars.indexOf(lastWritableProperty), lastWritableProperty);
}
@@ -1181,4 +1201,29 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo
return escapeText(pattern);
}
@Override
public String toDefaultValue(Schema p) {
if (p.getDefault() != null) {
if (ModelUtils.isBooleanSchema(p)) {
if (Boolean.valueOf(p.getDefault().toString())) {
return "$true";
} else {
return "$false";
}
} else if (ModelUtils.isDateSchema(p)) {
LOGGER.warn("Default value for `date` not yet supported. Please open an issue with https://github.com/openapitools/openapi-generator");
} else if (ModelUtils.isDateTimeSchema(p)) {
LOGGER.warn("Default value for `datetime` not yet supported. Please open an issue with https://github.com/openapitools/openapi-generator");
} else if (ModelUtils.isNumberSchema(p)) {
return p.getDefault().toString();
} else if (ModelUtils.isIntegerSchema(p)) {
return p.getDefault().toString();
} else if (ModelUtils.isStringSchema(p)) {
return "\"" + p.getDefault() + "\"";
}
}
return null;
}
}

View File

@@ -0,0 +1,201 @@
/*
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.codegen.languages;
import io.swagger.v3.oas.models.media.ArraySchema;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.parser.util.SchemaTypeUtil;
import org.openapitools.codegen.*;
import org.openapitools.codegen.utils.ModelUtils;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.TreeSet;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Map;
// TODO rename AbstractTypeScriptClientCodegen to AbstractTypeScriptCodegen later
public class TypeScriptServerCodegen extends AbstractTypeScriptClientCodegen {
public static final String NPM_REPOSITORY = "npmRepository";
public static final String WITH_INTERFACES = "withInterfaces";
protected String npmRepository = null;
public TypeScriptServerCodegen() {
super();
outputFolder = "generated-code/typescript-server";
embeddedTemplateDir = templateDir = "typescript-server";
this.apiPackage = "apis";
this.apiTemplateFiles.put("apis.mustache", ".ts");
this.modelPackage = "models";
this.modelTemplateFiles.put("models.mustache", ".ts");
this.cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json"));
this.cliOptions.add(new CliOption(WITH_INTERFACES, "Setting this property to true will generate interfaces next to the default class implementations.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString()));
}
@Override
public String getName() {
return "typescript-server";
}
@Override
public String getHelp() {
return "Generates a TypeScript server stub (beta).";
}
public String getNpmRepository() {
return npmRepository;
}
public void setNpmRepository(String npmRepository) {
this.npmRepository = npmRepository;
}
@Override
public void processOpts() {
super.processOpts();
additionalProperties.put("isOriginalModelPropertyNaming", getModelPropertyNaming().equals("original"));
additionalProperties.put("modelPropertyNaming", getModelPropertyNaming());
supportingFiles.add(new SupportingFile("index.mustache", "", "index.ts"));
supportingFiles.add(new SupportingFile("runtime.mustache", "", "runtime.ts"));
supportingFiles.add(new SupportingFile("apis.index.mustache", apiPackage().replace('.', File.separatorChar), "index.ts"));
supportingFiles.add(new SupportingFile("models.index.mustache", modelPackage().replace('.', File.separatorChar), "index.ts"));
supportingFiles.add(new SupportingFile("tsconfig.mustache", "", "tsconfig.json"));
supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore"));
if (additionalProperties.containsKey(NPM_NAME)) {
addNpmPackageGeneration();
}
}
@Override
public boolean isDataTypeFile(final String dataType) {
return dataType != null && dataType.equals("Blob");
}
@Override
public String getTypeDeclaration(Schema p) {
Schema inner;
if (ModelUtils.isArraySchema(p)) {
inner = ((ArraySchema) p).getItems();
return this.getSchemaType(p) + "<" + this.getTypeDeclaration(inner) + ">";
} else if (ModelUtils.isMapSchema(p)) {
inner = ModelUtils.getAdditionalProperties(p);
return "{ [key: string]: " + this.getTypeDeclaration(inner) + "; }";
} else if (ModelUtils.isFileSchema(p)) {
return "Blob";
} else if (ModelUtils.isBinarySchema(p)) {
return "Blob";
} else if (ModelUtils.isDateSchema(p)) {
return "Date";
} else if (ModelUtils.isDateTimeSchema(p)) {
return "Date";
}
return super.getTypeDeclaration(p);
}
@Override
protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) {
codegenModel.additionalPropertiesType = getTypeDeclaration(ModelUtils.getAdditionalProperties(schema));
addImport(codegenModel, codegenModel.additionalPropertiesType);
}
@Override
public Map<String, Object> postProcessModels(Map<String, Object> objs) {
/* comment out the following as we're not sure if we need these in the TS Server generator
// process enum in models
List<Object> models = (List<Object>) postProcessModelsEnum(objs).get("models");
for (Object _mo : models) {
Map<String, Object> mo = (Map<String, Object>) _mo;
CodegenModel cm = (CodegenModel) mo.get("model");
cm.imports = new TreeSet(cm.imports);
// name enum with model name, e.g. StatusEnum => PetStatusEnum
for (CodegenProperty var : cm.vars) {
if (Boolean.TRUE.equals(var.isEnum)) {
// behaviour for enum names is specific for typescript to not use namespaces
var.datatypeWithEnum = var.datatypeWithEnum.replace(var.enumName, cm.classname + var.enumName);
}
}
if (cm.parent != null) {
for (CodegenProperty var : cm.allVars) {
if (Boolean.TRUE.equals(var.isEnum)) {
var.datatypeWithEnum = var.datatypeWithEnum
.replace(var.enumName, cm.classname + var.enumName);
}
}
}
}
*/
return objs;
}
@Override
public Map<String, Object> postProcessAllModels(Map<String, Object> objs) {
Map<String, Object> result = super.postProcessAllModels(objs);
/* comment out the following as we're not sure if we need these in the TS Server generator
for (Map.Entry<String, Object> entry : result.entrySet()) {
Map<String, Object> inner = (Map<String, Object>) entry.getValue();
List<Map<String, Object>> models = (List<Map<String, Object>>) inner.get("models");
for (Map<String, Object> model : models) {
CodegenModel codegenModel = (CodegenModel) model.get("model");
model.put("hasImports", codegenModel.imports.size() > 0);
}
}
*/
return result;
}
@Override
public String getSchemaType(Schema p) {
String openAPIType = super.getSchemaType(p);
if (isLanguagePrimitive(openAPIType)) {
return openAPIType;
}
applyLocalTypeMapping(openAPIType);
return openAPIType;
}
private String applyLocalTypeMapping(String type) {
if (typeMapping.containsKey(type)) {
type = typeMapping.get(type);
}
return type;
}
private boolean isLanguagePrimitive(String type) {
return languageSpecificPrimitives.contains(type);
}
private void addNpmPackageGeneration() {
if (additionalProperties.containsKey(NPM_REPOSITORY)) {
this.setNpmRepository(additionalProperties.get(NPM_REPOSITORY).toString());
}
// Files for building our lib
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
supportingFiles.add(new SupportingFile("package.mustache", "", "package.json"));
}
}

View File

@@ -888,7 +888,7 @@ public class ApiClient {
* @param obj Object
* @param formParams Form parameters
* @param contentType Context type
* @param isBodyNulalble True if the body is nullable
* @param isBodyNullable True if the body is nullable
* @return String
* @throws ApiException API exception
*/

View File

@@ -33,7 +33,7 @@ import {{{invokerPackage}}}.ApiClient;
import {{{invokerPackage}}}.ApiException;
import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}}
import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}}
import {{{invokerPackage}}}.models.*;
import {{{invokerPackage}}}.model.*;
import {{{package}}}.{{{classname}}};
public class Example {

View File

@@ -127,3 +127,4 @@ org.openapitools.codegen.languages.TypeScriptJqueryClientCodegen
org.openapitools.codegen.languages.TypeScriptNodeClientCodegen
org.openapitools.codegen.languages.TypeScriptReduxQueryClientCodegen
org.openapitools.codegen.languages.TypeScriptRxjsClientCodegen
org.openapitools.codegen.languages.TypeScriptServerCodegen

View File

@@ -41,7 +41,7 @@ function Initialize-{{{apiNamePrefix}}}{{{classname}}} {
{{/isEnum}}
[{{vendorExtensions.x-powershell-data-type}}]
{{=<% %>=}}
${<%name%>}<%^vendorExtensions.x-powershell-last-writable%>,<%/vendorExtensions.x-powershell-last-writable%>
${<%name%>}<%#defaultValue%> = <%&.%><%/defaultValue%><%^vendorExtensions.x-powershell-last-writable%>,<%/vendorExtensions.x-powershell-last-writable%>
<%={{ }}=%>
{{/isReadOnly}}
{{/allVars}}
@@ -59,7 +59,7 @@ function Initialize-{{{apiNamePrefix}}}{{{classname}}} {
{{/isEnum}}
[{{vendorExtensions.x-powershell-data-type}}]
{{=<% %>=}}
${<%name%>}<%^-last%>,<%/-last%>
${<%name%>}<%#defaultValue%> = <%&.%><%/defaultValue%><%^-last%>,<%/-last%>
<%={{ }}=%>
{{/allVars}}
{{/discardReadOnly}}

View File

@@ -0,0 +1,87 @@
## {{npmName}}@{{npmVersion}}
This generator creates TypeScript/JavaScript client that utilizes [RxJS](https://rxjs-dev.firebaseapp.com/). The generated Node module can be used in the following environments:
Environment
* Node.js
* Webpack
* Browserify
Language level
* ES5 - you must have a Promises/A+ library installed
* ES6
Module system
* CommonJS
* ES6 module system
It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html))
### Building
To build and compile the typescript sources to javascript use:
```
npm install
npm run build
```
### Publishing
First build the package then run `npm publish`
### Consuming
navigate to the folder of your consuming project and run one of the following commands.
_published:_
```
npm install {{npmName}}@{{npmVersion}} --save
```
_unPublished (not recommended):_
```
npm install PATH_TO_GENERATED_PACKAGE --save
```
### How to apply middleware
First, add a singleton class that extends the generated `Configuration` class.
```
export class AuthInterceptor extends Configuration {
private static config: AuthInterceptor;
private constructor() {
const middleware: Middleware[] = [
{
pre(request: RequestArgs): RequestArgs {
const token = getAuthToken();
return {
...request,
headers: {
...request.headers,
Authorization: `Bearer ${token}`,
},
};
},
},
];
super({ middleware });
}
public static get Instance() {
return AuthInterceptor.config || (AuthInterceptor.config = new this());
}
}
```
Next, pass it to the generated api controller.
```
const api = new StoreApi(AuthInterceptor.Instance);
```

View File

@@ -0,0 +1,7 @@
{{#apiInfo}}
{{#apis}}
{{#operations}}
export * from './{{ classFilename }}';
{{/operations}}
{{/apis}}
{{/apiInfo}}

View File

@@ -0,0 +1,204 @@
// tslint:disable
{{>licenseInfo}}
import { Observable } from 'rxjs';
import { BaseAPI{{#hasHttpHeaders}}, HttpHeaders{{/hasHttpHeaders}}{{#hasQueryParams}}, HttpQuery{{/hasQueryParams}}{{#hasRequiredParameters}}, throwIfRequired{{/hasRequiredParameters}}{{#hasPathParams}}, encodeURI{{/hasPathParams}}{{#hasListContainers}}, COLLECTION_FORMATS{{/hasListContainers}} } from '../runtime';
{{#imports.0}}
import {
{{#imports}}
{{className}},
{{/imports}}
} from '../models';
{{/imports.0}}
{{#operations}}
{{#operation}}
{{#allParams.0}}
export interface {{operationIdCamelCase}}Request {
{{#allParams}}
{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}};
{{/allParams}}
}
{{/allParams.0}}
{{/operation}}
{{/operations}}
{{#operations}}
/**
* {{#description}}{{{description}}}{{/description}}{{^description}}no description{{/description}}
*/
export class {{classname}} extends BaseAPI {
{{#operation}}
/**
{{#notes}}
* {{&notes}}
{{/notes}}
{{#summary}}
* {{&summary}}
{{/summary}}
*/
{{nickname}} = ({{#allParams.0}}requestParameters: {{operationIdCamelCase}}Request{{/allParams.0}}): Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> => {
{{#hasParams}}
{{#allParams}}
{{#required}}
throwIfRequired(requestParameters, '{{paramName}}', '{{nickname}}');
{{/required}}
{{/allParams}}
{{/hasParams}}
{{#hasHttpHeaders}}
const headers: HttpHeaders = {
{{#bodyParam}}
{{^consumes}}
'Content-Type': 'application/json',
{{/consumes}}
{{#consumes.0}}
'Content-Type': '{{{mediaType}}}',
{{/consumes.0}}
{{/bodyParam}}
{{#headerParams}}
{{#isListContainer}}
...(requestParameters.{{paramName}} && { '{{baseName}}': requestParameters.{{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])) }),
{{/isListContainer}}
{{^isListContainer}}
...(requestParameters.{{paramName}} && { '{{baseName}}': String(requestParameters.{{paramName}}) }),
{{/isListContainer}}
{{/headerParams}}
{{#authMethods}}
{{#isBasic}}
...(this.configuration.username && this.configuration.password && { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` }),
{{/isBasic}}
{{#isApiKey}}
{{#isKeyInHeader}}
...(this.configuration.apiKey && { '{{keyParamName}}': this.configuration.apiKey('{{keyParamName}}') }), // {{name}} authentication
{{/isKeyInHeader}}
{{/isApiKey}}
{{#isOAuth}}
// oauth required
...(this.configuration.accessToken && {
Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken('{{name}}', [{{#scopes}}'{{{scope}}}'{{^-last}}, {{/-last}}{{/scopes}}])
: this.configuration.accessToken)
}),
{{/isOAuth}}
{{/authMethods}}
};
{{/hasHttpHeaders}}
{{#hasQueryParams}}
const query: HttpQuery = {
{{#queryParams}}
{{#isListContainer}}
{{#isCollectionFormatMulti}}
...(requestParameters.{{paramName}} && { '{{baseName}}': requestParameters.{{paramName}} }),
{{/isCollectionFormatMulti}}
{{^isCollectionFormatMulti}}
...(requestParameters.{{paramName}} && { '{{baseName}}': requestParameters.{{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']) }),
{{/isCollectionFormatMulti}}
{{/isListContainer}}
{{^isListContainer}}
{{#isDateTime}}
...(requestParameters.{{paramName}} && { '{{baseName}}': (requestParameters.{{paramName}} as any).toISOString() }),
{{/isDateTime}}
{{^isDateTime}}
{{#isDate}}
...(requestParameters.{{paramName}} && { '{{baseName}}': (requestParameters.{{paramName}} as any).toISOString() }),
{{/isDate}}
{{^isDate}}
...(requestParameters.{{paramName}} && { '{{baseName}}': requestParameters.{{paramName}} }),
{{/isDate}}
{{/isDateTime}}
{{/isListContainer}}
{{/queryParams}}
{{#authMethods}}
{{#isApiKey}}
{{#isKeyInQuery}}
...(this.configuration.apiKey && { '{{keyParamName}}': this.configuration.apiKey && this.configuration.apiKey('{{keyParamName}}') }), // {{name}} authentication
{{/isKeyInQuery}}
{{/isApiKey}}
{{/authMethods}}
};
{{/hasQueryParams}}
{{#hasFormParams}}
const formData = new FormData();
{{/hasFormParams}}
{{#formParams}}
{{#isListContainer}}
if (requestParameters.{{paramName}}) {
{{#isCollectionFormatMulti}}
requestParameters.{{paramName}}.forEach((element) => {
formData.append('{{baseName}}', element as any);
})
{{/isCollectionFormatMulti}}
{{^isCollectionFormatMulti}}
formData.append('{{baseName}}', requestParameters.{{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']));
{{/isCollectionFormatMulti}}
}
{{/isListContainer}}
{{^isListContainer}}
if (requestParameters.{{paramName}} !== undefined) {
formData.append('{{baseName}}', requestParameters.{{paramName}} as any);
}
{{/isListContainer}}
{{/formParams}}
return this.request<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}>({
path: '{{{path}}}'{{#pathParams}}.replace({{=<% %>=}}'{<%baseName%>}'<%={{ }}=%>, encodeURI(requestParameters.{{paramName}})){{/pathParams}},
method: '{{httpMethod}}',
{{#hasHttpHeaders}}
headers,
{{/hasHttpHeaders}}
{{#hasQueryParams}}
query,
{{/hasQueryParams}}
{{#hasBodyParam}}
{{#bodyParam}}
{{#isContainer}}
body: requestParameters.{{paramName}},
{{/isContainer}}
{{^isContainer}}
{{^isPrimitiveType}}
body: requestParameters.{{paramName}},
{{/isPrimitiveType}}
{{#isPrimitiveType}}
body: requestParameters.{{paramName}} as any,
{{/isPrimitiveType}}
{{/isContainer}}
{{/bodyParam}}
{{/hasBodyParam}}
{{#hasFormParams}}
body: formData,
{{/hasFormParams}}
{{#isResponseFile}}
responseType: 'blob'
{{/isResponseFile}}
});
};
{{/operation}}
}
{{/operations}}
{{#hasEnums}}
{{#operations}}
{{#operation}}
{{#allParams}}
{{#isEnum}}
/**
* @export
* @enum {string}
*/
export enum {{operationIdCamelCase}}{{enumName}} {
{{#allowableValues}}
{{#enumVars}}
{{{name}}} = {{{value}}}{{^-last}},{{/-last}}
{{/enumVars}}
{{/allowableValues}}
}
{{/isEnum}}
{{/allParams}}
{{/operation}}
{{/operations}}
{{/hasEnums}}

View File

@@ -0,0 +1,4 @@
wwwroot/*.js
node_modules
typings
dist

View File

@@ -0,0 +1,3 @@
export * from './runtime';
export * from './apis';
export * from './models';

View File

@@ -0,0 +1,11 @@
/**
* {{{appName}}}
* {{{appDescription}}}
*
* {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}}
* {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -0,0 +1,12 @@
/**
* {{{description}}}
* @export
* @enum {string}
*/
export enum {{classname}} {
{{#allowableValues}}
{{#enumVars}}
{{{name}}} = {{{value}}}{{^-last}},{{/-last}}
{{/enumVars}}
{{/allowableValues}}
}

View File

@@ -0,0 +1,43 @@
{{#hasImports}}
import {
{{#imports}}
{{{.}}},
{{/imports}}
} from './';
{{/hasImports}}
/**{{#description}}
* {{{description}}}{{/description}}
* @export
* @interface {{classname}}
*/
export interface {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{
{{#additionalPropertiesType}}
[key: string]: {{{additionalPropertiesType}}}{{#hasVars}} | any{{/hasVars}};
{{/additionalPropertiesType}}
{{#vars}}
/**{{#description}}
* {{{description}}}{{/description}}
* @type {{=<% %>=}}{<%&datatype%>}<%={{ }}=%>
* @memberof {{classname}}
*/
{{#isReadOnly}}readonly {{/isReadOnly}}{{name}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{/isEnum}};
{{/vars}}
}{{#hasEnums}}
{{#vars}}
{{#isEnum}}
/**
* @export
* @enum {string}
*/
export enum {{classname}}{{enumName}} {
{{#allowableValues}}
{{#enumVars}}
{{{name}}} = {{{value}}}{{^-last}},{{/-last}}
{{/enumVars}}
{{/allowableValues}}
}
{{/isEnum}}
{{/vars}}
{{/hasEnums}}

View File

@@ -0,0 +1,14 @@
{{#hasImports}}
import {
{{#imports}}
{{{.}}},
{{/imports}}
} from './';
{{/hasImports}}
/**
* @type {{classname}}{{#description}}
* {{{description}}}{{/description}}
* @export
*/
export type {{classname}} = {{#oneOf}}{{{.}}}{{^-last}} | {{/-last}}{{/oneOf}};

View File

@@ -0,0 +1,5 @@
{{#models}}
{{#model}}
export * from './{{{ classFilename }}}';
{{/model}}
{{/models}}

View File

@@ -0,0 +1,7 @@
// tslint:disable
{{>licenseInfo}}
{{#models}}
{{#model}}
{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{^isEnum}}{{^oneOf}}{{>modelGeneric}}{{/oneOf}}{{/isEnum}}
{{/model}}
{{/models}}

View File

@@ -0,0 +1,23 @@
{
"name": "{{npmName}}",
"version": "{{npmVersion}}",
"description": "OpenAPI client for {{npmName}}",
"author": "OpenAPI-Generator",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"scripts" : {
"build": "tsc --outDir dist/",
"prepare": "npm run build"
},
"dependencies": {
"rxjs": "^6.3.3"
},
"devDependencies": {
"typescript": "^3.0.1"
}{{#npmRepository}},{{/npmRepository}}
{{#npmRepository}}
"publishConfig": {
"registry": "{{npmRepository}}"
}
{{/npmRepository}}
}

View File

@@ -0,0 +1,183 @@
// tslint:disable
{{>licenseInfo}}
import { Observable, of } from 'rxjs';
import { ajax, AjaxRequest, AjaxResponse } from 'rxjs/ajax';
import { map, concatMap } from 'rxjs/operators';
export const BASE_PATH = '{{{basePath}}}'.replace(/\/+$/, '');
export interface ConfigurationParameters {
basePath?: string; // override base path
middleware?: Middleware[]; // middleware to apply before/after rxjs requests
username?: string; // parameter for basic security
password?: string; // parameter for basic security
apiKey?: string | ((name: string) => string); // parameter for apiKey security
accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security
}
export class Configuration {
constructor(private configuration: ConfigurationParameters = {}) {}
get basePath(): string {
return this.configuration.basePath || BASE_PATH;
}
get middleware(): Middleware[] {
return this.configuration.middleware || [];
}
get username(): string | undefined {
return this.configuration.username;
}
get password(): string | undefined {
return this.configuration.password;
}
get apiKey(): ((name: string) => string) | undefined {
const apiKey = this.configuration.apiKey;
if (apiKey) {
return typeof apiKey === 'function' ? apiKey : () => apiKey;
}
return undefined;
}
get accessToken(): ((name: string, scopes?: string[]) => string) | undefined {
const accessToken = this.configuration.accessToken;
if (accessToken) {
return typeof accessToken === 'function' ? accessToken : () => accessToken;
}
return undefined;
}
}
/**
* This is the base class for all generated API classes.
*/
export class BaseAPI {
private middleware: Middleware[] = [];
constructor(protected configuration = new Configuration()) {
this.middleware = configuration.middleware;
}
withMiddleware = <T extends BaseAPI>(middlewares: Middleware[]) => {
const next = this.clone<T>();
next.middleware = next.middleware.concat(middlewares);
return next;
};
withPreMiddleware = <T extends BaseAPI>(preMiddlewares: Array<Middleware['pre']>) =>
this.withMiddleware<T>(preMiddlewares.map((pre) => ({ pre })));
withPostMiddleware = <T extends BaseAPI>(postMiddlewares: Array<Middleware['post']>) =>
this.withMiddleware<T>(postMiddlewares.map((post) => ({ post })));
protected request = <T>(requestOpts: RequestOpts): Observable<T> =>
this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe(
map((res) => {
if (res.status >= 200 && res.status < 300) {
return res.response as T;
}
throw res;
})
);
private createRequestArgs = (requestOpts: RequestOpts): RequestArgs => {
let url = this.configuration.basePath + requestOpts.path;
if (requestOpts.query !== undefined && Object.keys(requestOpts.query).length !== 0) {
// only add the queryString to the URL if there are query parameters.
// this is done to avoid urls ending with a '?' character which buggy webservers
// do not handle correctly sometimes.
url += '?' + queryString(requestOpts.query);
}
return {
url,
method: requestOpts.method,
headers: requestOpts.headers,
body: requestOpts.body instanceof FormData ? requestOpts.body : JSON.stringify(requestOpts.body),
responseType: requestOpts.responseType || 'json',
};
}
private rxjsRequest = (params: RequestArgs): Observable<AjaxResponse> =>
of(params).pipe(
map((request) => {
this.middleware.filter((item) => item.pre).forEach((mw) => (request = mw.pre!(request)));
return request;
}),
concatMap((args) =>
ajax(args).pipe(
map((response) => {
this.middleware.filter((item) => item.post).forEach((mw) => (response = mw.post!(response)));
return response;
})
)
)
);
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
private clone = <T extends BaseAPI>(): T =>
Object.assign(Object.create(Object.getPrototypeOf(this)), this);
}
// export for not being a breaking change
export class RequiredError extends Error {
name: 'RequiredError' = 'RequiredError';
}
export const COLLECTION_FORMATS = {
csv: ',',
ssv: ' ',
tsv: '\t',
pipes: '|',
};
export type Json = any;
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
export type HttpHeaders = { [key: string]: string };
export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array<string | number | null | boolean> }>; // partial is needed for strict mode
export type HttpBody = Json | FormData;
export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
export interface RequestOpts {
path: string;
method: HttpMethod;
headers?: HttpHeaders;
query?: HttpQuery;
body?: HttpBody;
responseType?: 'json' | 'blob' | 'arraybuffer' | 'text';
}
export const encodeURI = (value: any) => encodeURIComponent(String(value));
const queryString = (params: HttpQuery): string => Object.keys(params)
.map((key) => {
const value = params[key];
return (value instanceof Array)
? value.map((val) => `${encodeURI(key)}=${encodeURI(val)}`).join('&')
: `${encodeURI(key)}=${encodeURI(value)}`;
})
.join('&');
// alias fallback for not being a breaking change
export const querystring = queryString;
export const throwIfRequired = (params: {[key: string]: any}, key: string, nickname: string) => {
if (!params || params[key] === null || params[key] === undefined) {
throw new RequiredError(`Required parameter ${key} was null or undefined when calling ${nickname}.`);
}
};
// alias for easier importing
export interface RequestArgs extends AjaxRequest {}
export interface ResponseArgs extends AjaxResponse {}
export interface Middleware {
pre?(request: RequestArgs): RequestArgs;
post?(response: ResponseArgs): ResponseArgs;
}

View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"declaration": true,
"target": "{{#supportsES6}}es6{{/supportsES6}}{{^supportsES6}}es5{{/supportsES6}}",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "dist",
"rootDir": ".",
{{^supportsES6}}
"lib": [
"es6",
"dom"
],
{{/supportsES6}}
"typeRoots": [
"node_modules/@types"
]
},
"exclude": [
"dist",
"node_modules"
]
}

View File

@@ -843,91 +843,108 @@ paths:
responses:
'400':
description: Someting wrong
/fake/outer/number:
/fake/refs/number:
post:
tags:
- fake
description: Test serialization of outer number types
operationId: fakeOuterNumberSerialize
operationId: NumberWithValidations
parameters:
- name: body
in: body
description: Input number as post body
schema:
$ref: '#/definitions/OuterNumber'
$ref: '#/definitions/NumberWithValidations'
responses:
'200':
description: Output number
schema:
$ref: '#/definitions/OuterNumber'
/fake/outer/string:
$ref: '#/definitions/NumberWithValidations'
/fake/refs/string:
post:
tags:
- fake
description: Test serialization of outer string types
operationId: fakeOuterStringSerialize
operationId: String
parameters:
- name: body
in: body
description: Input string as post body
schema:
$ref: '#/definitions/OuterString'
$ref: '#/definitions/String'
responses:
'200':
description: Output string
schema:
$ref: '#/definitions/OuterString'
/fake/outer/boolean:
$ref: '#/definitions/String'
/fake/refs/boolean:
post:
tags:
- fake
description: Test serialization of outer boolean types
operationId: fakeOuterBooleanSerialize
operationId: Boolean
parameters:
- name: body
in: body
description: Input boolean as post body
schema:
$ref: '#/definitions/OuterBoolean'
$ref: '#/definitions/Boolean'
responses:
'200':
description: Output boolean
schema:
$ref: '#/definitions/OuterBoolean'
/fake/outer/composite:
$ref: '#/definitions/Boolean'
/fake/refs/arraymodel:
post:
tags:
- fake
description: Test serialization of object with outer number type
operationId: fakeOuterCompositeSerialize
description: Test serialization of ArrayModel
operationId: ArrayModel
parameters:
- name: body
in: body
description: Input composite as post body
description: Input model
schema:
$ref: '#/definitions/OuterComposite'
$ref: '#/definitions/AnimalFarm'
responses:
'200':
description: Output composite
description: Output model
schema:
$ref: '#/definitions/OuterComposite'
/fake/outer/enum:
$ref: '#/definitions/AnimalFarm'
/fake/refs/object_model_with_ref_props:
post:
tags:
- fake
description: Test serialization of object with $refed properties
operationId: ObjectModelWithRefProps
parameters:
- name: body
in: body
description: Input model
schema:
$ref: '#/definitions/ObjectModelWithRefProps'
responses:
'200':
description: Output model
schema:
$ref: '#/definitions/ObjectModelWithRefProps'
/fake/refs/enum:
post:
tags:
- fake
description: Test serialization of outer enum
operationId: fakeOuterEnumSerialize
operationId: StringEnum
parameters:
- name: body
in: body
description: Input enum as post body
description: Input enum
schema:
$ref: '#/definitions/OuterEnum'
$ref: '#/definitions/StringEnum'
responses:
'200':
description: Output enum
schema:
$ref: '#/definitions/OuterEnum'
$ref: '#/definitions/StringEnum'
/fake/jsonFormData:
get:
tags:
@@ -1475,8 +1492,8 @@ definitions:
enum:
- 1.1
- -1.2
outerEnum:
$ref: '#/definitions/OuterEnum'
stringEnum:
$ref: '#/definitions/StringEnum'
AdditionalPropertiesClass:
type: object
properties:
@@ -1743,28 +1760,29 @@ definitions:
# enum:
# - Cat
# - Dog
OuterEnum:
StringEnum:
type: string
enum:
- "placed"
- "approved"
- "delivered"
OuterComposite:
ObjectModelWithRefProps:
description: a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations
type: object
properties:
my_number:
$ref: '#/definitions/OuterNumber'
$ref: '#/definitions/NumberWithValidations'
my_string:
$ref: '#/definitions/OuterString'
$ref: '#/definitions/String'
my_boolean:
$ref: '#/definitions/OuterBoolean'
OuterNumber:
$ref: '#/definitions/Boolean'
NumberWithValidations:
type: number
minimum: 10
maximum: 20
OuterString:
String:
type: string
OuterBoolean:
Boolean:
type: boolean
x-codegen-body-parameter-name: boolean_post_body
StringBooleanMap:

View File

@@ -31,8 +31,8 @@ paths:
$ref: '#/components/schemas/Foo'
/pet:
servers:
- url: 'http://petstore.swagger.io/v2'
- url: 'http://path-server-test.petstore.local/v2'
- url: 'http://petstore.swagger.io/v2'
- url: 'http://path-server-test.petstore.local/v2'
post:
tags:
- pet
@@ -822,82 +822,171 @@ paths:
responses:
'400':
description: Someting wrong
/fake/outer/number:
/fake/refs/number:
post:
tags:
- fake
description: Test serialization of outer number types
operationId: fakeOuterNumberSerialize
operationId: NumberWithValidations
requestBody:
description: Input number as post body
content:
application/json:
schema:
$ref: '#/components/schemas/NumberWithValidations'
required: false
responses:
'200':
description: Output number
content:
'*/*':
application/json:
schema:
$ref: '#/components/schemas/OuterNumber'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OuterNumber'
description: Input number as post body
/fake/outer/string:
$ref: '#/components/schemas/NumberWithValidations'
/fake/refs/string:
post:
tags:
- fake
description: Test serialization of outer string types
operationId: fakeOuterStringSerialize
operationId: String
requestBody:
description: Input string as post body
content:
application/json:
schema:
$ref: '#/components/schemas/String'
required: false
responses:
'200':
description: Output string
content:
'*/*':
application/json:
schema:
$ref: '#/components/schemas/OuterString'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OuterString'
description: Input string as post body
/fake/outer/boolean:
$ref: '#/components/schemas/String'
x-codegen-request-body-name: body
/fake/refs/boolean:
post:
tags:
- fake
description: Test serialization of outer boolean types
operationId: fakeOuterBooleanSerialize
operationId: Boolean
requestBody:
description: Input boolean as post body
content:
application/json:
schema:
$ref: '#/components/schemas/Boolean'
required: false
responses:
'200':
description: Output boolean
content:
'*/*':
application/json:
schema:
$ref: '#/components/schemas/OuterBoolean'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OuterBoolean'
description: Input boolean as post body
/fake/outer/composite:
$ref: '#/components/schemas/Boolean'
x-codegen-request-body-name: body
/fake/refs/arraymodel:
post:
tags:
- fake
description: Test serialization of object with outer number type
operationId: fakeOuterCompositeSerialize
responses:
'200':
description: Output composite
content:
'*/*':
schema:
$ref: '#/components/schemas/OuterComposite'
description: Test serialization of ArrayModel
operationId: ArrayModel
requestBody:
description: Input model
content:
application/json:
schema:
$ref: '#/components/schemas/OuterComposite'
description: Input composite as post body
$ref: '#/components/schemas/AnimalFarm'
required: false
responses:
'200':
description: Output model
content:
application/json:
schema:
$ref: '#/components/schemas/AnimalFarm'
x-codegen-request-body-name: body
/fake/refs/object_model_with_ref_props:
post:
tags:
- fake
description: Test serialization of object with $refed properties
operationId: ObjectModelWithRefProps
requestBody:
description: Input model
content:
application/json:
schema:
$ref: '#/components/schemas/ObjectModelWithRefProps'
required: false
responses:
'200':
description: Output model
content:
application/json:
schema:
$ref: '#/components/schemas/ObjectModelWithRefProps'
x-codegen-request-body-name: body
/fake/refs/enum:
post:
tags:
- fake
description: Test serialization of outer enum
operationId: StringEnum
requestBody:
description: Input enum
content:
application/json:
schema:
$ref: '#/components/schemas/StringEnum'
required: false
responses:
'200':
description: Output enum
content:
application/json:
schema:
$ref: '#/components/schemas/StringEnum'
x-codegen-request-body-name: body
/fake/refs/array-of-enums:
post:
tags:
- fake
summary: Array of Enums
operationId: ArrayOfEnums
requestBody:
description: Input enum
content:
application/json:
schema:
$ref: '#/components/schemas/ArrayOfEnums'
required: false
responses:
200:
description: Got named array of enums
content:
application/json:
schema:
$ref: '#/components/schemas/ArrayOfEnums'
/fake/additional-properties-with-array-of-enums:
get:
tags:
- fake
summary: Additional Properties with Array of Enums
operationId: AdditionalPropertiesWithArrayOfEnums
requestBody:
description: Input enum
content:
application/json:
schema:
$ref: '#/components/schemas/AdditionalPropertiesWithArrayOfEnums'
required: false
responses:
200:
description: Got object with additional properties with array of enums
content:
application/json:
schema:
$ref: '#/components/schemas/AdditionalPropertiesWithArrayOfEnums'
/fake/jsonFormData:
get:
tags:
@@ -1099,32 +1188,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/HealthCheckResult'
/fake/array-of-enums:
get:
tags:
- fake
summary: Array of Enums
operationId: getArrayOfEnums
responses:
200:
description: Got named array of enums
content:
application/json:
schema:
$ref: '#/components/schemas/ArrayOfEnums'
/fake/additional-properties-with-array-of-enums:
get:
tags:
- fake
summary: Additional Properties with Array of Enums
operationId: getAdditionalPropertiesWithArrayOfEnums
responses:
200:
description: Got object with additional properties with array of enums
content:
application/json:
schema:
$ref: '#/components/schemas/AdditionalPropertiesWithArrayOfEnums'
servers:
- url: 'http://{server}.swagger.io:{port}/v2'
description: petstore server
@@ -1430,7 +1493,7 @@ components:
Address:
type: object
additionalProperties:
type: integer
type: integer
Animal:
type: object
discriminator:
@@ -1553,14 +1616,16 @@ components:
enum:
- 1.1
- -1.2
outerEnum:
$ref: '#/components/schemas/OuterEnum'
outerEnumInteger:
$ref: '#/components/schemas/OuterEnumInteger'
outerEnumDefaultValue:
$ref: '#/components/schemas/OuterEnumDefaultValue'
outerEnumIntegerDefaultValue:
$ref: '#/components/schemas/OuterEnumIntegerDefaultValue'
stringEnum:
$ref: '#/components/schemas/StringEnum'
IntegerEnum:
$ref: '#/components/schemas/IntegerEnum'
StringEnumWithDefaultValue:
$ref: '#/components/schemas/StringEnumWithDefaultValue'
IntegerEnumWithDefaultValue:
$ref: '#/components/schemas/IntegerEnumWithDefaultValue'
IntegerEnumOneValue:
$ref: '#/components/schemas/IntegerEnumOneValue'
AdditionalPropertiesClass:
type: object
properties:
@@ -1727,47 +1792,56 @@ components:
enum:
- fish
- crab
OuterEnum:
StringEnum:
nullable: true
type: string
enum:
- "placed"
- "approved"
- "delivered"
IntegerEnum:
type: integer
enum:
- 0
- 1
- 2
StringEnumWithDefaultValue:
type: string
enum:
- placed
- approved
- delivered
OuterEnumInteger:
type: integer
enum:
- 0
- 1
- 2
OuterEnumDefaultValue:
type: string
enum:
- placed
- approved
- delivered
default: placed
OuterEnumIntegerDefaultValue:
IntegerEnumWithDefaultValue:
type: integer
enum:
- 0
- 1
- 2
- 0
- 1
- 2
default: 0
OuterComposite:
IntegerEnumOneValue:
type: integer
enum:
- 0
ObjectModelWithRefProps:
description: a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations
type: object
properties:
my_number:
$ref: '#/components/schemas/OuterNumber'
$ref: '#/definitions/NumberWithValidations'
my_string:
$ref: '#/components/schemas/OuterString'
$ref: '#/definitions/String'
my_boolean:
$ref: '#/components/schemas/OuterBoolean'
OuterNumber:
$ref: '#/definitions/Boolean'
NumberWithValidations:
type: number
OuterString:
minimum: 10
maximum: 20
Number:
type: number
String:
type: string
OuterBoolean:
Boolean:
type: boolean
x-codegen-body-parameter-name: boolean_post_body
StringBooleanMap:
@@ -1939,19 +2013,19 @@ components:
required:
- className
gmFruit:
properties:
color:
type: string
anyOf:
- $ref: '#/components/schemas/apple'
- $ref: '#/components/schemas/banana'
additionalProperties: false
properties:
color:
type: string
anyOf:
- $ref: '#/components/schemas/apple'
- $ref: '#/components/schemas/banana'
additionalProperties: false
fruitReq:
oneOf:
- type: 'null'
- $ref: '#/components/schemas/appleReq'
- $ref: '#/components/schemas/bananaReq'
additionalProperties: false
oneOf:
- type: 'null'
- $ref: '#/components/schemas/appleReq'
- $ref: '#/components/schemas/bananaReq'
additionalProperties: false
appleReq:
type: object
properties:
@@ -2103,7 +2177,7 @@ components:
ArrayOfEnums:
type: array
items:
$ref: '#/components/schemas/OuterEnum'
$ref: '#/components/schemas/StringEnum'
AdditionalPropertiesWithArrayOfEnums:
type: object
additionalProperties:

48
pom.xml
View File

@@ -1267,6 +1267,7 @@
<module>samples/client/petstore/java/google-api-client</module>
<module>samples/client/petstore/java/rest-assured</module>
<module>samples/client/petstore/java/rest-assured-jackson</module>
<module>samples/client/petstore/java/microprofile-rest-client</module>
<module>samples/client/petstore/groovy</module>
<!-- servers -->
<module>samples/server/petstore/jaxrs-jersey</module>
@@ -1322,13 +1323,13 @@
<module>samples/server/petstore/kotlin-springboot</module>
</modules>
</profile>
<!-- test with JDK7 in CircleCI -->
<!-- other tests in CircleCI -->
<profile>
<id>samples.circleci.jdk7</id>
<id>samples.circleci.others</id>
<activation>
<property>
<name>env</name>
<value>samples.circleci.jdk7</value>
<value>samples.circleci.others</value>
</property>
</activation>
<modules>
@@ -1336,50 +1337,9 @@
<module>samples/client/petstore/javascript-promise-es6</module>
<module>samples/server/petstore/go-api-server</module>
<module>samples/server/petstore/go-gin-api-server</module>
<!-- test java-related projects -->
<module>samples/client/petstore/dart2/petstore</module>
<module>samples/client/petstore/dart-jaguar/openapi</module>
<module>samples/client/petstore/dart-jaguar/flutter_petstore/openapi</module>
<module>samples/client/petstore/scala-akka</module>
<module>samples/client/petstore/scala-httpclient</module>
<module>samples/client/petstore/java/jersey1</module>
<module>samples/client/petstore/java/okhttp-gson</module>
<module>samples/client/petstore/java/retrofit2</module>
<module>samples/client/petstore/jaxrs-cxf-client</module>
<module>samples/client/petstore/java/resttemplate</module>
<module>samples/client/petstore/java/resttemplate-withXml</module>
<module>samples/client/petstore/java/vertx</module>
<module>samples/client/petstore/java/resteasy</module>
<module>samples/client/petstore/java/google-api-client</module>
<module>samples/client/petstore/java/microprofile-rest-client</module>
<!-- servers -->
<module>samples/server/petstore/jaxrs-jersey</module>
<module>samples/server/petstore/jaxrs-spec</module>
<module>samples/server/petstore/jaxrs-spec-interface</module>
<module>samples/server/petstore/jaxrs-spec-interface-response</module>
<module>samples/server/petstore/java-vertx/rx</module>
<module>samples/server/petstore/java-vertx/async</module>
<module>samples/server/petstore/java-inflector</module>
<module>samples/server/petstore/java-undertow</module>
<module>samples/server/petstore/jaxrs/jersey1</module>
<module>samples/server/petstore/jaxrs/jersey2</module>
<module>samples/server/petstore/jaxrs/jersey1-useTags</module>
<module>samples/server/petstore/jaxrs/jersey2-useTags</module>
<module>samples/server/petstore/jaxrs-resteasy/default</module>
<module>samples/server/petstore/jaxrs-resteasy/eap</module>
<module>samples/server/petstore/jaxrs-resteasy/eap-joda</module>
<module>samples/server/petstore/jaxrs-resteasy/eap-java8</module>
<module>samples/server/petstore/jaxrs-resteasy/joda</module>
<module>samples/server/petstore/spring-mvc</module>
<module>samples/client/petstore/spring-cloud</module>
<module>samples/server/petstore/springboot</module>
<module>samples/server/petstore/springboot-beanvalidation</module>
<module>samples/server/petstore/springboot-useoptional</module>
<module>samples/server/petstore/jaxrs-cxf</module>
<module>samples/server/petstore/jaxrs-cxf-annotated-base-path</module>
<module>samples/server/petstore/jaxrs-cxf-cdi</module>
<module>samples/server/petstore/jaxrs-cxf-non-spring-app</module>
<module>samples/server/petstore/java-msf4j</module>
</modules>
</profile>
<!-- test with JDK9 in Shippable CI -->

View File

@@ -23,7 +23,7 @@ To test special tags and operation ID starting with number
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AnotherFakeApi;
public class Example {

View File

@@ -36,7 +36,7 @@ this route creates an XmlItem
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -100,7 +100,7 @@ Test serialization of outer boolean types
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -165,7 +165,7 @@ Test serialization of object with outer number type
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -230,7 +230,7 @@ Test serialization of outer number types
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -295,7 +295,7 @@ Test serialization of outer string types
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -360,7 +360,7 @@ For this test, the body for this request much reference a schema named `File`.
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -422,7 +422,7 @@ No authorization required
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -488,7 +488,7 @@ To test "client" model
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -557,7 +557,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -653,7 +653,7 @@ To test enum parameters
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -732,7 +732,7 @@ Fake endpoint to test group parameters (optional)
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -811,7 +811,7 @@ test inline additionalProperties
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -873,7 +873,7 @@ test json serialization of form data
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -939,7 +939,7 @@ To test the collection format in query parameters
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {

View File

@@ -24,7 +24,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeClassnameTags123Api;
public class Example {

View File

@@ -30,7 +30,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {
@@ -98,7 +98,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {
@@ -170,7 +170,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {
@@ -241,7 +241,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {
@@ -312,7 +312,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {
@@ -384,7 +384,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {
@@ -454,7 +454,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {
@@ -525,7 +525,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {
@@ -597,7 +597,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {

View File

@@ -26,7 +26,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.StoreApi;
public class Example {
@@ -92,7 +92,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.StoreApi;
public class Example {
@@ -159,7 +159,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.StoreApi;
public class Example {
@@ -224,7 +224,7 @@ Place an order for a pet
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.StoreApi;
public class Example {

View File

@@ -30,7 +30,7 @@ This can only be done by the logged in user.
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserApi;
public class Example {
@@ -92,7 +92,7 @@ Creates list of users with given input array
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserApi;
public class Example {
@@ -154,7 +154,7 @@ Creates list of users with given input array
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserApi;
public class Example {
@@ -218,7 +218,7 @@ This can only be done by the logged in user.
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserApi;
public class Example {
@@ -281,7 +281,7 @@ Get user by user name
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserApi;
public class Example {
@@ -346,7 +346,7 @@ Logs user into the system
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserApi;
public class Example {
@@ -412,7 +412,7 @@ Logs out current logged in user session
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserApi;
public class Example {
@@ -472,7 +472,7 @@ This can only be done by the logged in user.
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserApi;
public class Example {

View File

@@ -805,7 +805,7 @@ public class ApiClient {
* @param obj Object
* @param formParams Form parameters
* @param contentType Context type
* @param isBodyNulalble True if the body is nullable
* @param isBodyNullable True if the body is nullable
* @return String
* @throws ApiException API exception
*/

View File

@@ -3,9 +3,9 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Code** | **Int32** | | [optional] [default to null]
**Type** | **String** | | [optional] [default to null]
**Message** | **String** | | [optional] [default to null]
**Code** | **Int32** | | [optional]
**Type** | **String** | | [optional]
**Message** | **String** | | [optional]
## Examples

View File

@@ -3,8 +3,8 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **Int64** | | [optional] [default to null]
**Name** | **String** | | [optional] [default to null]
**Id** | **Int64** | | [optional]
**Name** | **String** | | [optional]
## Examples

View File

@@ -3,8 +3,8 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **String** | Updated name of the pet | [optional] [default to null]
**Status** | **String** | Updated status of the pet | [optional] [default to null]
**Name** | **String** | Updated name of the pet | [optional]
**Status** | **String** | Updated status of the pet | [optional]
## Examples

View File

@@ -3,8 +3,8 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AdditionalMetadata** | **String** | Additional data to pass to server | [optional] [default to null]
**File** | **System.IO.FileInfo** | file to upload | [optional] [default to null]
**AdditionalMetadata** | **String** | Additional data to pass to server | [optional]
**File** | **System.IO.FileInfo** | file to upload | [optional]
## Examples

View File

@@ -3,12 +3,12 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **Int64** | | [optional] [default to null]
**PetId** | **Int64** | | [optional] [default to null]
**Quantity** | **Int32** | | [optional] [default to null]
**ShipDate** | **System.DateTime** | | [optional] [default to null]
**Status** | **String** | Order Status | [optional] [default to null]
**Complete** | **Boolean** | | [optional] [default to false]
**Id** | **Int64** | | [optional]
**PetId** | **Int64** | | [optional]
**Quantity** | **Int32** | | [optional]
**ShipDate** | **System.DateTime** | | [optional]
**Status** | **String** | Order Status | [optional]
**Complete** | **Boolean** | | [optional] [default to $false]
## Examples

View File

@@ -77,8 +77,8 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$PetId = 987 # Int64 | Pet id to delete (default to null)
$ApiKey = "ApiKey_example" # String | (optional) (default to null)
$PetId = 987 # Int64 | Pet id to delete
$ApiKey = "ApiKey_example" # String | (optional)
# Deletes a pet
try {
@@ -93,8 +93,8 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**PetId** | **Int64**| Pet id to delete | [default to null]
**ApiKey** | **String**| | [optional] [default to null]
**PetId** | **Int64**| Pet id to delete |
**ApiKey** | **String**| | [optional]
### Return type
@@ -128,7 +128,7 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$Status = @("Status_example") # String[] | Status values that need to be considered for filter (default to null)
$Status = @("Status_example") # String[] | Status values that need to be considered for filter
# Finds Pets by status
try {
@@ -143,7 +143,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**Status** | [**String[]**](String.md)| Status values that need to be considered for filter | [default to null]
**Status** | [**String[]**](String.md)| Status values that need to be considered for filter |
### Return type
@@ -177,7 +177,7 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$Tags = @("Inner_example") # String[] | Tags to filter by (default to null)
$Tags = @("Inner_example") # String[] | Tags to filter by
# Finds Pets by tags
try {
@@ -192,7 +192,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**Tags** | [**String[]**](String.md)| Tags to filter by | [default to null]
**Tags** | [**String[]**](String.md)| Tags to filter by |
### Return type
@@ -228,7 +228,7 @@ $Configuration["ApiKey"]["api_key"] = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration["ApiKeyPrefix"]["api_key"] = "Bearer"
$PetId = 987 # Int64 | ID of pet to return (default to null)
$PetId = 987 # Int64 | ID of pet to return
# Find pet by ID
try {
@@ -243,7 +243,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**PetId** | **Int64**| ID of pet to return | [default to null]
**PetId** | **Int64**| ID of pet to return |
### Return type
@@ -324,9 +324,9 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$PetId = 987 # Int64 | ID of pet that needs to be updated (default to null)
$Name = "Name_example" # String | Updated name of the pet (optional) (default to null)
$Status = "Status_example" # String | Updated status of the pet (optional) (default to null)
$PetId = 987 # Int64 | 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)
# Updates a pet in the store with form data
try {
@@ -341,9 +341,9 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**PetId** | **Int64**| ID of pet that needs to be updated | [default to null]
**Name** | **String**| Updated name of the pet | [optional] [default to null]
**Status** | **String**| Updated status of the pet | [optional] [default to null]
**PetId** | **Int64**| ID of pet that needs to be updated |
**Name** | **String**| Updated name of the pet | [optional]
**Status** | **String**| Updated status of the pet | [optional]
### Return type
@@ -377,9 +377,9 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$PetId = 987 # Int64 | ID of pet to update (default to null)
$AdditionalMetadata = "AdditionalMetadata_example" # String | Additional data to pass to server (optional) (default to null)
$File = 987 # System.IO.FileInfo | file to upload (optional) (default to null)
$PetId = 987 # Int64 | ID of pet to update
$AdditionalMetadata = "AdditionalMetadata_example" # String | Additional data to pass to server (optional)
$File = 987 # System.IO.FileInfo | file to upload (optional)
# uploads an image
try {
@@ -394,9 +394,9 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**PetId** | **Int64**| ID of pet to update | [default to null]
**AdditionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null]
**File** | **System.IO.FileInfo****System.IO.FileInfo**| file to upload | [optional] [default to null]
**PetId** | **Int64**| ID of pet to update |
**AdditionalMetadata** | **String**| Additional data to pass to server | [optional]
**File** | **System.IO.FileInfo****System.IO.FileInfo**| file to upload | [optional]
### Return type

View File

@@ -23,7 +23,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
```powershell
Import-Module -Name PSPetstore
$OrderId = "OrderId_example" # String | ID of the order that needs to be deleted (default to null)
$OrderId = "OrderId_example" # String | ID of the order that needs to be deleted
# Delete purchase order by ID
try {
@@ -38,7 +38,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**OrderId** | **String**| ID of the order that needs to be deleted | [default to null]
**OrderId** | **String**| ID of the order that needs to be deleted |
### Return type
@@ -114,7 +114,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
```powershell
Import-Module -Name PSPetstore
$OrderId = 987 # Int64 | ID of pet that needs to be fetched (default to null)
$OrderId = 987 # Int64 | ID of pet that needs to be fetched
# Find purchase order by ID
try {
@@ -129,7 +129,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**OrderId** | **Int64**| ID of pet that needs to be fetched | [default to null]
**OrderId** | **Int64**| ID of pet that needs to be fetched |
### Return type

View File

@@ -182,7 +182,7 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
$Username = "Username_example" # String | The name that needs to be deleted (default to null)
$Username = "Username_example" # String | The name that needs to be deleted
# Delete user
try {
@@ -197,7 +197,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**Username** | **String**| The name that needs to be deleted | [default to null]
**Username** | **String**| The name that needs to be deleted |
### Return type
@@ -225,7 +225,7 @@ Get user by user name
```powershell
Import-Module -Name PSPetstore
$Username = "Username_example" # String | The name that needs to be fetched. Use user1 for testing. (default to null)
$Username = "Username_example" # String | The name that needs to be fetched. Use user1 for testing.
# Get user by user name
try {
@@ -240,7 +240,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**Username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null]
**Username** | **String**| The name that needs to be fetched. Use user1 for testing. |
### Return type
@@ -269,8 +269,8 @@ Logs user into the system
```powershell
Import-Module -Name PSPetstore
$Username = "Username_example" # String | The user name for login (default to null)
$Password = "Password_example" # String | The password for login in clear text (default to null)
$Username = "Username_example" # String | The user name for login
$Password = "Password_example" # String | The password for login in clear text
# Logs user into the system
try {
@@ -285,8 +285,8 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**Username** | **String**| The user name for login | [default to null]
**Password** | **String**| The password for login in clear text | [default to null]
**Username** | **String**| The user name for login |
**Password** | **String**| The password for login in clear text |
### Return type
@@ -367,7 +367,7 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
$Username = "Username_example" # String | name that need to be deleted (default to null)
$Username = "Username_example" # String | name that need to be deleted
$User = # User | Updated user object
# Updated user
@@ -383,7 +383,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**Username** | **String**| name that need to be deleted | [default to null]
**Username** | **String**| name that need to be deleted |
**User** | [**User**](User.md)| Updated user object |
### Return type

View File

@@ -3,12 +3,12 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **Int64** | | [optional] [default to null]
**Category** | [**Category**](Category.md) | | [optional] [default to null]
**Name** | **String** | | [default to null]
**PhotoUrls** | **String[]** | | [default to null]
**Tags** | [**Tag[]**](Tag.md) | | [optional] [default to null]
**Status** | **String** | pet status in the store | [optional] [default to null]
**Id** | **Int64** | | [optional]
**Category** | [**Category**](Category.md) | | [optional]
**Name** | **String** | |
**PhotoUrls** | **String[]** | |
**Tags** | [**Tag[]**](Tag.md) | | [optional]
**Status** | **String** | pet status in the store | [optional]
## Examples

View File

@@ -3,8 +3,8 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **Int64** | | [optional] [default to null]
**Name** | **String** | | [optional] [default to null]
**Id** | **Int64** | | [optional]
**Name** | **String** | | [optional]
## Examples

View File

@@ -3,14 +3,14 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **Int64** | | [optional] [default to null]
**Username** | **String** | | [optional] [default to null]
**FirstName** | **String** | | [optional] [default to null]
**LastName** | **String** | | [optional] [default to null]
**Email** | **String** | | [optional] [default to null]
**Password** | **String** | | [optional] [default to null]
**Phone** | **String** | | [optional] [default to null]
**UserStatus** | **Int32** | User Status | [optional] [default to null]
**Id** | **Int64** | | [optional]
**Username** | **String** | | [optional]
**FirstName** | **String** | | [optional]
**LastName** | **String** | | [optional]
**Email** | **String** | | [optional]
**Password** | **String** | | [optional]
**Phone** | **String** | | [optional]
**UserStatus** | **Int32** | User Status | [optional]
## Examples

View File

@@ -52,7 +52,7 @@ function Initialize-PSOrder {
${Status},
[Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)]
[System.Nullable[Boolean]]
${Complete}
${Complete} = $false
)
Process {

View File

@@ -51,10 +51,9 @@ docs/Model200Response.md
docs/ModelReturn.md
docs/Name.md
docs/NumberOnly.md
docs/NumberWithValidations.md
docs/ObjectModelWithRefProps.md
docs/Order.md
docs/OuterComposite.md
docs/OuterEnum.md
docs/OuterNumber.md
docs/Parent.md
docs/ParentAllOf.md
docs/ParentPet.md
@@ -65,6 +64,7 @@ docs/ReadOnlyFirst.md
docs/SpecialModelName.md
docs/StoreApi.md
docs/StringBooleanMap.md
docs/StringEnum.md
docs/Tag.md
docs/TypeHolderDefault.md
docs/TypeHolderExample.md
@@ -131,10 +131,9 @@ petstore_api/model/model200_response.py
petstore_api/model/model_return.py
petstore_api/model/name.py
petstore_api/model/number_only.py
petstore_api/model/number_with_validations.py
petstore_api/model/object_model_with_ref_props.py
petstore_api/model/order.py
petstore_api/model/outer_composite.py
petstore_api/model/outer_enum.py
petstore_api/model/outer_number.py
petstore_api/model/parent.py
petstore_api/model/parent_all_of.py
petstore_api/model/parent_pet.py
@@ -143,6 +142,7 @@ petstore_api/model/player.py
petstore_api/model/read_only_first.py
petstore_api/model/special_model_name.py
petstore_api/model/string_boolean_map.py
petstore_api/model/string_enum.py
petstore_api/model/tag.py
petstore_api/model/type_holder_default.py
petstore_api/model/type_holder_example.py

View File

@@ -81,12 +81,13 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
*FakeApi* | [**array_model**](docs/FakeApi.md#array_model) | **POST** /fake/refs/arraymodel |
*FakeApi* | [**boolean**](docs/FakeApi.md#boolean) | **POST** /fake/refs/boolean |
*FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem
*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_enum_serialize**](docs/FakeApi.md#fake_outer_enum_serialize) | **POST** /fake/outer/enum |
*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* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number |
*FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props |
*FakeApi* | [**string**](docs/FakeApi.md#string) | **POST** /fake/refs/string |
*FakeApi* | [**string_enum**](docs/FakeApi.md#string_enum) | **POST** /fake/refs/enum |
*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \&quot;client\&quot; model
@@ -168,10 +169,9 @@ Class | Method | HTTP request | Description
- [model_return.ModelReturn](docs/ModelReturn.md)
- [name.Name](docs/Name.md)
- [number_only.NumberOnly](docs/NumberOnly.md)
- [number_with_validations.NumberWithValidations](docs/NumberWithValidations.md)
- [object_model_with_ref_props.ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md)
- [order.Order](docs/Order.md)
- [outer_composite.OuterComposite](docs/OuterComposite.md)
- [outer_enum.OuterEnum](docs/OuterEnum.md)
- [outer_number.OuterNumber](docs/OuterNumber.md)
- [parent.Parent](docs/Parent.md)
- [parent_all_of.ParentAllOf](docs/ParentAllOf.md)
- [parent_pet.ParentPet](docs/ParentPet.md)
@@ -180,6 +180,7 @@ Class | Method | HTTP request | Description
- [read_only_first.ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [special_model_name.SpecialModelName](docs/SpecialModelName.md)
- [string_boolean_map.StringBooleanMap](docs/StringBooleanMap.md)
- [string_enum.StringEnum](docs/StringEnum.md)
- [tag.Tag](docs/Tag.md)
- [type_holder_default.TypeHolderDefault](docs/TypeHolderDefault.md)
- [type_holder_example.TypeHolderExample](docs/TypeHolderExample.md)

View File

@@ -7,7 +7,7 @@ Name | Type | Description | Notes
**enum_string** | **str** | | [optional]
**enum_integer** | **int** | | [optional]
**enum_number** | **float** | | [optional]
**outer_enum** | [**outer_enum.OuterEnum**](OuterEnum.md) | | [optional]
**string_enum** | [**string_enum.StringEnum**](StringEnum.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)

View File

@@ -4,12 +4,13 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**array_model**](FakeApi.md#array_model) | **POST** /fake/refs/arraymodel |
[**boolean**](FakeApi.md#boolean) | **POST** /fake/refs/boolean |
[**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem
[**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_enum_serialize**](FakeApi.md#fake_outer_enum_serialize) | **POST** /fake/outer/enum |
[**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 |
[**number_with_validations**](FakeApi.md#number_with_validations) | **POST** /fake/refs/number |
[**object_model_with_ref_props**](FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props |
[**string**](FakeApi.md#string) | **POST** /fake/refs/string |
[**string_enum**](FakeApi.md#string_enum) | **POST** /fake/refs/enum |
[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \&quot;client\&quot; model
@@ -21,6 +22,133 @@ Method | HTTP request | Description
[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
# **array_model**
> animal_farm.AnimalFarm array_model()
Test serialization of ArrayModel
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from petstore_api.model import animal_farm
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
body = animal_farm.AnimalFarm() # animal_farm.AnimalFarm | Input model (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.array_model(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->array_model: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**animal_farm.AnimalFarm**](AnimalFarm.md)| Input model | [optional]
### Return type
[**animal_farm.AnimalFarm**](AnimalFarm.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Output model | - |
[[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)
# **boolean**
> bool boolean()
Test serialization of outer boolean types
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
body = True # bool | Input boolean as post body (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.boolean(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->boolean: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **bool**| Input boolean as post body | [optional]
### Return type
**bool**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Output boolean | - |
[[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)
# **create_xml_item**
> create_xml_item(xml_item)
@@ -84,199 +212,8 @@ No authorization required
[[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_boolean_serialize**
> bool fake_outer_boolean_serialize()
Test serialization of outer boolean types
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
body = True # bool | Input boolean as post body (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.fake_outer_boolean_serialize(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **bool**| Input boolean as post body | [optional]
### Return type
**bool**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Output boolean | - |
[[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**
> outer_composite.OuterComposite fake_outer_composite_serialize()
Test serialization of object with outer number type
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from petstore_api.model import outer_composite
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
body = outer_composite.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.fake_outer_composite_serialize(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**outer_composite.OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
### Return type
[**outer_composite.OuterComposite**](OuterComposite.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Output composite | - |
[[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_enum_serialize**
> outer_enum.OuterEnum fake_outer_enum_serialize()
Test serialization of outer enum
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from petstore_api.model import outer_enum
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
body = outer_enum.OuterEnum("placed") # outer_enum.OuterEnum | Input enum as post body (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.fake_outer_enum_serialize(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->fake_outer_enum_serialize: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**outer_enum.OuterEnum**](OuterEnum.md)| Input enum as post body | [optional]
### Return type
[**outer_enum.OuterEnum**](OuterEnum.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Output enum | - |
[[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**
> outer_number.OuterNumber fake_outer_number_serialize()
# **number_with_validations**
> number_with_validations.NumberWithValidations number_with_validations()
@@ -289,7 +226,7 @@ from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from petstore_api.model import outer_number
from petstore_api.model import number_with_validations
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -302,26 +239,26 @@ configuration = petstore_api.Configuration(
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
body = outer_number.OuterNumber(3.4) # outer_number.OuterNumber | Input number as post body (optional)
body = number_with_validations.NumberWithValidations(3.4) # number_with_validations.NumberWithValidations | Input number as post body (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.fake_outer_number_serialize(body=body)
api_response = api_instance.number_with_validations(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e)
print("Exception when calling FakeApi->number_with_validations: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**outer_number.OuterNumber**](OuterNumber.md)| Input number as post body | [optional]
**body** | [**number_with_validations.NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional]
### Return type
[**outer_number.OuterNumber**](OuterNumber.md)
[**number_with_validations.NumberWithValidations**](NumberWithValidations.md)
### Authorization
@@ -339,8 +276,72 @@ No authorization required
[[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**
> str fake_outer_string_serialize()
# **object_model_with_ref_props**
> object_model_with_ref_props.ObjectModelWithRefProps object_model_with_ref_props()
Test serialization of object with $refed properties
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from petstore_api.model import object_model_with_ref_props
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
body = object_model_with_ref_props.ObjectModelWithRefProps() # object_model_with_ref_props.ObjectModelWithRefProps | Input model (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.object_model_with_ref_props(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->object_model_with_ref_props: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**object_model_with_ref_props.ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional]
### Return type
[**object_model_with_ref_props.ObjectModelWithRefProps**](ObjectModelWithRefProps.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Output model | - |
[[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)
# **string**
> str string()
@@ -370,10 +371,10 @@ with petstore_api.ApiClient() as api_client:
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.fake_outer_string_serialize(body=body)
api_response = api_instance.string(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e)
print("Exception when calling FakeApi->string: %s\n" % e)
```
### Parameters
@@ -402,6 +403,70 @@ No authorization required
[[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)
# **string_enum**
> string_enum.StringEnum string_enum()
Test serialization of outer enum
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from petstore_api.model import string_enum
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
body = string_enum.StringEnum("placed") # string_enum.StringEnum | Input enum (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.string_enum(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->string_enum: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**string_enum.StringEnum**](StringEnum.md)| Input enum | [optional]
### Return type
[**string_enum.StringEnum**](StringEnum.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Output enum | - |
[[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_body_with_file_schema**
> test_body_with_file_schema(body)

View File

@@ -1,4 +1,4 @@
# outer_number.OuterNumber
# number_with_validations.NumberWithValidations
## Properties
Name | Type | Description | Notes

View File

@@ -1,9 +1,10 @@
# outer_composite.OuterComposite
# object_model_with_ref_props.ObjectModelWithRefProps
a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**my_number** | [**outer_number.OuterNumber**](OuterNumber.md) | | [optional]
**my_number** | [**number_with_validations.NumberWithValidations**](NumberWithValidations.md) | | [optional]
**my_string** | **str** | | [optional]
**my_boolean** | **bool** | | [optional]

View File

@@ -1,4 +1,4 @@
# outer_enum.OuterEnum
# string_enum.StringEnum
## Properties
Name | Type | Description | Notes

View File

@@ -30,10 +30,11 @@ from petstore_api.model_utils import ( # noqa: F401
str,
validate_and_convert_types
)
from petstore_api.model import animal_farm
from petstore_api.model import xml_item
from petstore_api.model import outer_composite
from petstore_api.model import outer_enum
from petstore_api.model import outer_number
from petstore_api.model import number_with_validations
from petstore_api.model import object_model_with_ref_props
from petstore_api.model import string_enum
from petstore_api.model import file_schema_test_class
from petstore_api.model import user
from petstore_api.model import client
@@ -51,6 +52,226 @@ class FakeApi(object):
api_client = ApiClient()
self.api_client = api_client
def __array_model(
self,
**kwargs
):
"""array_model # noqa: E501
Test serialization of ArrayModel # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.array_model(async_req=True)
>>> result = thread.get()
Keyword Args:
body (animal_farm.AnimalFarm): Input model. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
animal_farm.AnimalFarm
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
return self.call_with_http_info(**kwargs)
self.array_model = Endpoint(
settings={
'response_type': (animal_farm.AnimalFarm,),
'auth': [],
'endpoint_path': '/fake/refs/arraymodel',
'operation_id': 'array_model',
'http_method': 'POST',
'servers': None,
},
params_map={
'all': [
'body',
],
'required': [],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'body':
(animal_farm.AnimalFarm,),
},
'attribute_map': {
},
'location_map': {
'body': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'*/*'
],
'content_type': [],
},
api_client=api_client,
callable=__array_model
)
def __boolean(
self,
**kwargs
):
"""boolean # noqa: E501
Test serialization of outer boolean types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.boolean(async_req=True)
>>> result = thread.get()
Keyword Args:
body (bool): Input boolean as post body. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
bool
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
return self.call_with_http_info(**kwargs)
self.boolean = Endpoint(
settings={
'response_type': (bool,),
'auth': [],
'endpoint_path': '/fake/refs/boolean',
'operation_id': 'boolean',
'http_method': 'POST',
'servers': None,
},
params_map={
'all': [
'body',
],
'required': [],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'body':
(bool,),
},
'attribute_map': {
},
'location_map': {
'body': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'*/*'
],
'content_type': [],
},
api_client=api_client,
callable=__boolean
)
def __create_xml_item(
self,
xml_item,
@@ -172,352 +393,22 @@ class FakeApi(object):
callable=__create_xml_item
)
def __fake_outer_boolean_serialize(
def __number_with_validations(
self,
**kwargs
):
"""fake_outer_boolean_serialize # noqa: E501
Test serialization of outer boolean types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_boolean_serialize(async_req=True)
>>> result = thread.get()
Keyword Args:
body (bool): Input boolean as post body. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
bool
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
return self.call_with_http_info(**kwargs)
self.fake_outer_boolean_serialize = Endpoint(
settings={
'response_type': (bool,),
'auth': [],
'endpoint_path': '/fake/outer/boolean',
'operation_id': 'fake_outer_boolean_serialize',
'http_method': 'POST',
'servers': None,
},
params_map={
'all': [
'body',
],
'required': [],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'body':
(bool,),
},
'attribute_map': {
},
'location_map': {
'body': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'*/*'
],
'content_type': [],
},
api_client=api_client,
callable=__fake_outer_boolean_serialize
)
def __fake_outer_composite_serialize(
self,
**kwargs
):
"""fake_outer_composite_serialize # noqa: E501
Test serialization of object with outer number type # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_composite_serialize(async_req=True)
>>> result = thread.get()
Keyword Args:
body (outer_composite.OuterComposite): Input composite as post body. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
outer_composite.OuterComposite
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
return self.call_with_http_info(**kwargs)
self.fake_outer_composite_serialize = Endpoint(
settings={
'response_type': (outer_composite.OuterComposite,),
'auth': [],
'endpoint_path': '/fake/outer/composite',
'operation_id': 'fake_outer_composite_serialize',
'http_method': 'POST',
'servers': None,
},
params_map={
'all': [
'body',
],
'required': [],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'body':
(outer_composite.OuterComposite,),
},
'attribute_map': {
},
'location_map': {
'body': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'*/*'
],
'content_type': [],
},
api_client=api_client,
callable=__fake_outer_composite_serialize
)
def __fake_outer_enum_serialize(
self,
**kwargs
):
"""fake_outer_enum_serialize # noqa: E501
Test serialization of outer enum # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_enum_serialize(async_req=True)
>>> result = thread.get()
Keyword Args:
body (outer_enum.OuterEnum): Input enum as post body. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
outer_enum.OuterEnum
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
return self.call_with_http_info(**kwargs)
self.fake_outer_enum_serialize = Endpoint(
settings={
'response_type': (outer_enum.OuterEnum,),
'auth': [],
'endpoint_path': '/fake/outer/enum',
'operation_id': 'fake_outer_enum_serialize',
'http_method': 'POST',
'servers': None,
},
params_map={
'all': [
'body',
],
'required': [],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'body':
(outer_enum.OuterEnum,),
},
'attribute_map': {
},
'location_map': {
'body': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'*/*'
],
'content_type': [],
},
api_client=api_client,
callable=__fake_outer_enum_serialize
)
def __fake_outer_number_serialize(
self,
**kwargs
):
"""fake_outer_number_serialize # noqa: E501
"""number_with_validations # noqa: E501
Test serialization of outer number types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_number_serialize(async_req=True)
>>> thread = api.number_with_validations(async_req=True)
>>> result = thread.get()
Keyword Args:
body (outer_number.OuterNumber): Input number as post body. [optional]
body (number_with_validations.NumberWithValidations): Input number as post body. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
@@ -539,7 +430,7 @@ class FakeApi(object):
async_req (bool): execute request asynchronously
Returns:
outer_number.OuterNumber
number_with_validations.NumberWithValidations
If the method is called asynchronously, returns the request
thread.
"""
@@ -564,12 +455,12 @@ class FakeApi(object):
kwargs['_host_index'] = kwargs.get('_host_index')
return self.call_with_http_info(**kwargs)
self.fake_outer_number_serialize = Endpoint(
self.number_with_validations = Endpoint(
settings={
'response_type': (outer_number.OuterNumber,),
'response_type': (number_with_validations.NumberWithValidations,),
'auth': [],
'endpoint_path': '/fake/outer/number',
'operation_id': 'fake_outer_number_serialize',
'endpoint_path': '/fake/refs/number',
'operation_id': 'number_with_validations',
'http_method': 'POST',
'servers': None,
},
@@ -592,7 +483,7 @@ class FakeApi(object):
},
'openapi_types': {
'body':
(outer_number.OuterNumber,),
(number_with_validations.NumberWithValidations,),
},
'attribute_map': {
},
@@ -609,20 +500,130 @@ class FakeApi(object):
'content_type': [],
},
api_client=api_client,
callable=__fake_outer_number_serialize
callable=__number_with_validations
)
def __fake_outer_string_serialize(
def __object_model_with_ref_props(
self,
**kwargs
):
"""fake_outer_string_serialize # noqa: E501
"""object_model_with_ref_props # noqa: E501
Test serialization of object with $refed properties # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.object_model_with_ref_props(async_req=True)
>>> result = thread.get()
Keyword Args:
body (object_model_with_ref_props.ObjectModelWithRefProps): Input model. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
object_model_with_ref_props.ObjectModelWithRefProps
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
return self.call_with_http_info(**kwargs)
self.object_model_with_ref_props = Endpoint(
settings={
'response_type': (object_model_with_ref_props.ObjectModelWithRefProps,),
'auth': [],
'endpoint_path': '/fake/refs/object_model_with_ref_props',
'operation_id': 'object_model_with_ref_props',
'http_method': 'POST',
'servers': None,
},
params_map={
'all': [
'body',
],
'required': [],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'body':
(object_model_with_ref_props.ObjectModelWithRefProps,),
},
'attribute_map': {
},
'location_map': {
'body': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'*/*'
],
'content_type': [],
},
api_client=api_client,
callable=__object_model_with_ref_props
)
def __string(
self,
**kwargs
):
"""string # noqa: E501
Test serialization of outer string types # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.fake_outer_string_serialize(async_req=True)
>>> thread = api.string(async_req=True)
>>> result = thread.get()
@@ -674,12 +675,12 @@ class FakeApi(object):
kwargs['_host_index'] = kwargs.get('_host_index')
return self.call_with_http_info(**kwargs)
self.fake_outer_string_serialize = Endpoint(
self.string = Endpoint(
settings={
'response_type': (str,),
'auth': [],
'endpoint_path': '/fake/outer/string',
'operation_id': 'fake_outer_string_serialize',
'endpoint_path': '/fake/refs/string',
'operation_id': 'string',
'http_method': 'POST',
'servers': None,
},
@@ -719,7 +720,117 @@ class FakeApi(object):
'content_type': [],
},
api_client=api_client,
callable=__fake_outer_string_serialize
callable=__string
)
def __string_enum(
self,
**kwargs
):
"""string_enum # noqa: E501
Test serialization of outer enum # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.string_enum(async_req=True)
>>> result = thread.get()
Keyword Args:
body (string_enum.StringEnum): Input enum. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
string_enum.StringEnum
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index')
return self.call_with_http_info(**kwargs)
self.string_enum = Endpoint(
settings={
'response_type': (string_enum.StringEnum,),
'auth': [],
'endpoint_path': '/fake/refs/enum',
'operation_id': 'string_enum',
'http_method': 'POST',
'servers': None,
},
params_map={
'all': [
'body',
],
'required': [],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'body':
(string_enum.StringEnum,),
},
'attribute_map': {
},
'location_map': {
'body': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'*/*'
],
'content_type': [],
},
api_client=api_client,
callable=__string_enum
)
def __test_body_with_file_schema(

View File

@@ -34,10 +34,10 @@ from petstore_api.model_utils import ( # noqa: F401
validate_get_composed_info,
)
try:
from petstore_api.model import outer_enum
from petstore_api.model import string_enum
except ImportError:
outer_enum = sys.modules[
'petstore_api.model.outer_enum']
string_enum = sys.modules[
'petstore_api.model.string_enum']
class EnumTest(ModelNormal):
@@ -107,7 +107,7 @@ class EnumTest(ModelNormal):
'enum_string': (str,), # noqa: E501
'enum_integer': (int,), # noqa: E501
'enum_number': (float,), # noqa: E501
'outer_enum': (outer_enum.OuterEnum,), # noqa: E501
'string_enum': (string_enum.StringEnum,), # noqa: E501
}
@cached_property
@@ -119,7 +119,7 @@ class EnumTest(ModelNormal):
'enum_string': 'enum_string', # noqa: E501
'enum_integer': 'enum_integer', # noqa: E501
'enum_number': 'enum_number', # noqa: E501
'outer_enum': 'outerEnum', # noqa: E501
'string_enum': 'stringEnum', # noqa: E501
}
_composed_schemas = {}
@@ -174,7 +174,7 @@ class EnumTest(ModelNormal):
enum_string (str): [optional] # noqa: E501
enum_integer (int): [optional] # noqa: E501
enum_number (float): [optional] # noqa: E501
outer_enum (outer_enum.OuterEnum): [optional] # noqa: E501
string_enum (string_enum.StringEnum): [optional] # noqa: E501
"""
_check_type = kwargs.pop('_check_type', True)

View File

@@ -35,7 +35,7 @@ from petstore_api.model_utils import ( # noqa: F401
)
class OuterNumber(ModelSimple):
class NumberWithValidations(ModelSimple):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
@@ -102,7 +102,7 @@ class OuterNumber(ModelSimple):
@convert_js_args_to_python_args
def __init__(self, value, *args, **kwargs): # noqa: E501
"""outer_number.OuterNumber - a model defined in OpenAPI
"""number_with_validations.NumberWithValidations - a model defined in OpenAPI
Args:
value (float):

View File

@@ -34,13 +34,13 @@ from petstore_api.model_utils import ( # noqa: F401
validate_get_composed_info,
)
try:
from petstore_api.model import outer_number
from petstore_api.model import number_with_validations
except ImportError:
outer_number = sys.modules[
'petstore_api.model.outer_number']
number_with_validations = sys.modules[
'petstore_api.model.number_with_validations']
class OuterComposite(ModelNormal):
class ObjectModelWithRefProps(ModelNormal):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
@@ -85,7 +85,7 @@ class OuterComposite(ModelNormal):
and the value is attribute type.
"""
return {
'my_number': (outer_number.OuterNumber,), # noqa: E501
'my_number': (number_with_validations.NumberWithValidations,), # noqa: E501
'my_string': (str,), # noqa: E501
'my_boolean': (bool,), # noqa: E501
}
@@ -113,7 +113,7 @@ class OuterComposite(ModelNormal):
@convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
"""outer_composite.OuterComposite - a model defined in OpenAPI
"""object_model_with_ref_props.ObjectModelWithRefProps - a model defined in OpenAPI
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
@@ -146,7 +146,7 @@ class OuterComposite(ModelNormal):
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
my_number (outer_number.OuterNumber): [optional] # noqa: E501
my_number (number_with_validations.NumberWithValidations): [optional] # noqa: E501
my_string (str): [optional] # noqa: E501
my_boolean (bool): [optional] # noqa: E501
"""

View File

@@ -35,7 +35,7 @@ from petstore_api.model_utils import ( # noqa: F401
)
class OuterEnum(ModelSimple):
class StringEnum(ModelSimple):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
@@ -103,7 +103,7 @@ class OuterEnum(ModelSimple):
@convert_js_args_to_python_args
def __init__(self, value, *args, **kwargs): # noqa: E501
"""outer_enum.OuterEnum - a model defined in OpenAPI
"""string_enum.StringEnum - a model defined in OpenAPI
Args:
value (str):

View File

@@ -57,10 +57,9 @@ from petstore_api.model.model200_response import Model200Response
from petstore_api.model.model_return import ModelReturn
from petstore_api.model.name import Name
from petstore_api.model.number_only import NumberOnly
from petstore_api.model.number_with_validations import NumberWithValidations
from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps
from petstore_api.model.order import Order
from petstore_api.model.outer_composite import OuterComposite
from petstore_api.model.outer_enum import OuterEnum
from petstore_api.model.outer_number import OuterNumber
from petstore_api.model.parent import Parent
from petstore_api.model.parent_all_of import ParentAllOf
from petstore_api.model.parent_pet import ParentPet
@@ -69,6 +68,7 @@ from petstore_api.model.player import Player
from petstore_api.model.read_only_first import ReadOnlyFirst
from petstore_api.model.special_model_name import SpecialModelName
from petstore_api.model.string_boolean_map import StringBooleanMap
from petstore_api.model.string_enum import StringEnum
from petstore_api.model.tag import Tag
from petstore_api.model.type_holder_default import TypeHolderDefault
from petstore_api.model.type_holder_example import TypeHolderExample

View File

@@ -16,10 +16,10 @@ import unittest
import petstore_api
try:
from petstore_api.model import outer_enum
from petstore_api.model import string_enum
except ImportError:
outer_enum = sys.modules[
'petstore_api.model.outer_enum']
string_enum = sys.modules[
'petstore_api.model.string_enum']
from petstore_api.model.enum_test import EnumTest

View File

@@ -34,43 +34,58 @@ class TestFakeApi(unittest.TestCase):
"""
pass
def test_fake_outer_boolean_serialize(self):
"""Test case for fake_outer_boolean_serialize
def test_boolean(self):
"""Test case for boolean
"""
pass
endpoint = self.api.boolean
assert endpoint.openapi_types['body'] == (bool,)
assert endpoint.settings['response_type'] == (bool,)
def test_fake_outer_composite_serialize(self):
"""Test case for fake_outer_composite_serialize
def test_string(self):
"""Test case for string
"""
pass
from petstore_api.model_utils import str
endpoint = self.api.string
assert endpoint.openapi_types['body'] == (str,)
assert endpoint.settings['response_type'] == (str,)
def test_fake_outer_enum_serialize(self):
"""Test case for fake_outer_enum_serialize
def test_object_model_with_ref_props(self):
"""Test case for object_model_with_ref_props
"""
# verify that the input and output are type OuterEnum
from petstore_api.model import outer_enum
endpoint = self.api.fake_outer_enum_serialize
assert endpoint.openapi_types['body'] == (outer_enum.OuterEnum,)
assert endpoint.settings['response_type'] == (outer_enum.OuterEnum,)
from petstore_api.model import object_model_with_ref_props
endpoint = self.api.object_model_with_ref_props
assert endpoint.openapi_types['body'] == (object_model_with_ref_props.ObjectModelWithRefProps,)
assert endpoint.settings['response_type'] == (object_model_with_ref_props.ObjectModelWithRefProps,)
def test_fake_outer_number_serialize(self):
"""Test case for fake_outer_number_serialize
def test_string_enum(self):
"""Test case for string_enum
"""
# verify that the input and output are the correct type
from petstore_api.model import outer_number
endpoint = self.api.fake_outer_number_serialize
assert endpoint.openapi_types['body'] == (outer_number.OuterNumber,)
assert endpoint.settings['response_type'] == (outer_number.OuterNumber,)
from petstore_api.model import string_enum
endpoint = self.api.string_enum
assert endpoint.openapi_types['body'] == (string_enum.StringEnum,)
assert endpoint.settings['response_type'] == (string_enum.StringEnum,)
def test_fake_outer_string_serialize(self):
"""Test case for fake_outer_string_serialize
def test_array_model(self):
"""Test case for array_model
"""
pass
from petstore_api.model import animal_farm
endpoint = self.api.array_model
assert endpoint.openapi_types['body'] == (animal_farm.AnimalFarm,)
assert endpoint.settings['response_type'] == (animal_farm.AnimalFarm,)
def test_number_with_validations(self):
"""Test case for number_with_validations
"""
from petstore_api.model import number_with_validations
endpoint = self.api.number_with_validations
assert endpoint.openapi_types['body'] == (number_with_validations.NumberWithValidations,)
assert endpoint.settings['response_type'] == (number_with_validations.NumberWithValidations,)
def test_test_body_with_file_schema(self):
"""Test case for test_body_with_file_schema

View File

@@ -0,0 +1,45 @@
# coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import sys
import unittest
import petstore_api
from petstore_api.model.number_with_validations import NumberWithValidations
class TestNumberWithValidations(unittest.TestCase):
"""NumberWithValidations unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testNumberWithValidations(self):
"""Test NumberWithValidations"""
valid_values = [10.0, 15.0, 20.0]
for valid_value in valid_values:
model = NumberWithValidations(valid_value)
assert model.value == valid_value
invalid_values = [9.0, 21.0]
for invalid_value in invalid_values:
with self.assertRaises(petstore_api.ApiValueError):
NumberWithValidations(invalid_value)
if __name__ == '__main__':
unittest.main()

View File

@@ -0,0 +1,49 @@
# coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import sys
import unittest
import petstore_api
try:
from petstore_api.model import number_with_validations
except ImportError:
number_with_validations = sys.modules[
'petstore_api.model.number_with_validations']
from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps
class TestObjectModelWithRefProps(unittest.TestCase):
"""ObjectModelWithRefProps unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testObjectModelWithRefProps(self):
"""Test ObjectModelWithRefProps"""
from petstore_api.model.object_model_with_ref_props import str, number_with_validations
self.assertEqual(
ObjectModelWithRefProps.openapi_types,
{
'my_number': (number_with_validations.NumberWithValidations,),
'my_string': (str,),
'my_boolean': (bool,),
}
)
if __name__ == '__main__':
unittest.main()

View File

@@ -15,11 +15,11 @@ import sys
import unittest
import petstore_api
from petstore_api.model.outer_enum import OuterEnum
from petstore_api.model.string_enum import StringEnum
class TestOuterEnum(unittest.TestCase):
"""OuterEnum unit test stubs"""
class TestStringEnum(unittest.TestCase):
"""StringEnum unit test stubs"""
def setUp(self):
pass
@@ -27,20 +27,22 @@ class TestOuterEnum(unittest.TestCase):
def tearDown(self):
pass
def testOuterEnum(self):
def testStringEnum(self):
"""Test StringEnum"""
"""Test OuterEnum"""
# make sure that we can access its allowed_values
assert OuterEnum.allowed_values[('value',)] == {
assert StringEnum.allowed_values[('value',)] == {
'PLACED': "placed",
'APPROVED': "approved",
'DELIVERED': "delivered"
}
# make sure that an exception is thrown on an invalid value
with self.assertRaises(petstore_api.ApiValueError):
OuterEnum('bad_value')
StringEnum('bad_value')
# make sure valid value works
valid_value = OuterEnum.allowed_values[('value',)]['PLACED']
assert valid_value == OuterEnum(valid_value).value
valid_value = StringEnum.allowed_values[('value',)]['PLACED']
assert valid_value == StringEnum(valid_value).value
if __name__ == '__main__':

View File

@@ -32,8 +32,8 @@ from petstore_api.model import (
parent_pet,
child_lizard,
category,
outer_enum,
outer_number,
string_enum,
number_with_validations,
string_boolean_map,
)
from petstore_api.model_utils import (
@@ -61,7 +61,7 @@ class DeserializationTests(unittest.TestCase):
"enum_string_required": "lower",
"enum_integer": 1,
"enum_number": 1.1,
"outerEnum": "placed"
"stringEnum": "placed"
}
}
response = MockResponse(data=json.dumps(data))
@@ -72,14 +72,14 @@ class DeserializationTests(unittest.TestCase):
self.assertTrue(
isinstance(deserialized['enum_test'], enum_test.EnumTest))
value = (
outer_enum.OuterEnum.allowed_values[('value',)]["PLACED"])
outer_enum_val = outer_enum.OuterEnum(value)
string_enum.StringEnum.allowed_values[('value',)]["PLACED"])
string_enum_val = string_enum.StringEnum(value)
sample_instance = enum_test.EnumTest(
enum_string="UPPER",
enum_string_required="lower",
enum_integer=1,
enum_number=1.1,
outer_enum=outer_enum_val
string_enum=string_enum_val
)
self.assertEqual(deserialized['enum_test'], sample_instance)
@@ -305,27 +305,27 @@ class DeserializationTests(unittest.TestCase):
with self.assertRaises(ApiValueError):
self.deserialize(
MockResponse(data=json.dumps("test str")),
(outer_enum.OuterEnum,),
(string_enum.StringEnum,),
True
)
# valid value works
placed_str = (
outer_enum.OuterEnum.allowed_values[('value',)]["PLACED"]
string_enum.StringEnum.allowed_values[('value',)]["PLACED"]
)
response = MockResponse(data=json.dumps(placed_str))
deserialized = self.deserialize(response,
(outer_enum.OuterEnum,), True)
self.assertTrue(isinstance(deserialized, outer_enum.OuterEnum))
(string_enum.StringEnum,), True)
self.assertTrue(isinstance(deserialized, string_enum.StringEnum))
self.assertTrue(deserialized.value == placed_str)
def test_deserialize_OuterNumber(self):
""" deserialize OuterNumber """
def test_deserialize_NumberWithValidations(self):
""" deserialize NumberWithValidations """
# make sure that an exception is thrown on an invalid type value
with self.assertRaises(ApiTypeError):
deserialized = self.deserialize(
MockResponse(data=json.dumps("test str")),
(outer_number.OuterNumber,),
(number_with_validations.NumberWithValidations,),
True
)
@@ -333,7 +333,7 @@ class DeserializationTests(unittest.TestCase):
with self.assertRaises(ApiValueError):
deserialized = self.deserialize(
MockResponse(data=json.dumps(21.0)),
(outer_number.OuterNumber,),
(number_with_validations.NumberWithValidations,),
True
)
@@ -341,8 +341,8 @@ class DeserializationTests(unittest.TestCase):
number_val = 11.0
response = MockResponse(data=json.dumps(number_val))
number = self.deserialize(response,
(outer_number.OuterNumber,), True)
self.assertTrue(isinstance(number, outer_number.OuterNumber))
(number_with_validations.NumberWithValidations,), True)
self.assertTrue(isinstance(number, number_with_validations.NumberWithValidations))
self.assertTrue(number.value == number_val)
def test_deserialize_file(self):

View File

@@ -32,8 +32,7 @@ from petstore_api.model import (
parent_pet,
child_lizard,
category,
outer_enum,
outer_number,
string_enum,
string_boolean_map,
)
from petstore_api.model_utils import (
@@ -56,15 +55,15 @@ class SerializationTests(unittest.TestCase):
def test_enum_test(self):
""" serialize dict(str, Enum_Test) """
value = (
outer_enum.OuterEnum.allowed_values[('value',)]["PLACED"])
outer_enum_val = outer_enum.OuterEnum(value)
string_enum.StringEnum.allowed_values[('value',)]["PLACED"])
string_enum_val = string_enum.StringEnum(value)
source = enum_test.EnumTest(
enum_string="UPPER",
enum_string_required="lower",
enum_integer=1,
enum_number=1.1,
outer_enum=outer_enum_val
string_enum=string_enum_val
)
result = {
@@ -73,7 +72,7 @@ class SerializationTests(unittest.TestCase):
"enum_string_required": "lower",
"enum_integer": 1,
"enum_number": 1.1,
"outerEnum": "placed"
"stringEnum": "placed"
}
}
serialized = self.serialize({"enum_test": source})

View File

@@ -23,7 +23,7 @@ To test special tags and operation ID starting with number
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AnotherFakeApi;
public class Example {

View File

@@ -21,7 +21,7 @@ Method | HTTP request | Description
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.DefaultApi;
public class Example {

View File

@@ -35,7 +35,7 @@ Health check endpoint
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -96,7 +96,7 @@ Test serialization of outer boolean types
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -161,7 +161,7 @@ Test serialization of object with outer number type
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -226,7 +226,7 @@ Test serialization of outer number types
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -291,7 +291,7 @@ Test serialization of outer string types
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -354,7 +354,7 @@ Array of Enums
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -415,7 +415,7 @@ For this test, the body for this request much reference a schema named `File`.
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -477,7 +477,7 @@ No authorization required
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -543,7 +543,7 @@ To test "client" model
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -613,7 +613,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -709,7 +709,7 @@ To test enum parameters
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -789,7 +789,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -872,7 +872,7 @@ test inline additionalProperties
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -934,7 +934,7 @@ test json serialization of form data
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {
@@ -1000,7 +1000,7 @@ To test the collection format in query parameters
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeApi;
public class Example {

View File

@@ -24,7 +24,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.FakeClassnameTags123Api;
public class Example {

View File

@@ -30,7 +30,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {
@@ -98,7 +98,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {
@@ -169,7 +169,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {
@@ -241,7 +241,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {
@@ -313,7 +313,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {
@@ -385,7 +385,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {
@@ -455,7 +455,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {
@@ -526,7 +526,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {
@@ -598,7 +598,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PetApi;
public class Example {

View File

@@ -26,7 +26,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.StoreApi;
public class Example {
@@ -92,7 +92,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.StoreApi;
public class Example {
@@ -159,7 +159,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.StoreApi;
public class Example {
@@ -224,7 +224,7 @@ Place an order for a pet
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.StoreApi;
public class Example {

View File

@@ -30,7 +30,7 @@ This can only be done by the logged in user.
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserApi;
public class Example {
@@ -92,7 +92,7 @@ Creates list of users with given input array
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserApi;
public class Example {
@@ -154,7 +154,7 @@ Creates list of users with given input array
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserApi;
public class Example {
@@ -218,7 +218,7 @@ This can only be done by the logged in user.
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserApi;
public class Example {
@@ -281,7 +281,7 @@ Get user by user name
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserApi;
public class Example {
@@ -346,7 +346,7 @@ Logs user into the system
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserApi;
public class Example {
@@ -412,7 +412,7 @@ Logs out current logged in user session
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserApi;
public class Example {
@@ -472,7 +472,7 @@ This can only be done by the logged in user.
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserApi;
public class Example {

View File

@@ -884,7 +884,7 @@ public class ApiClient {
* @param obj Object
* @param formParams Form parameters
* @param contentType Context type
* @param isBodyNulalble True if the body is nullable
* @param isBodyNullable True if the body is nullable
* @return String
* @throws ApiException API exception
*/

View File

@@ -55,6 +55,9 @@ docs/InlineObject3.md
docs/InlineObject4.md
docs/InlineObject5.md
docs/InlineResponseDefault.md
docs/IntegerEnum.md
docs/IntegerEnumOneValue.md
docs/IntegerEnumWithDefaultValue.md
docs/IsoscelesTriangle.md
docs/List.md
docs/Mammal.md
@@ -66,12 +69,9 @@ docs/Name.md
docs/NullableClass.md
docs/NullableShape.md
docs/NumberOnly.md
docs/NumberWithValidations.md
docs/ObjectModelWithRefProps.md
docs/Order.md
docs/OuterComposite.md
docs/OuterEnum.md
docs/OuterEnumDefaultValue.md
docs/OuterEnumInteger.md
docs/OuterEnumIntegerDefaultValue.md
docs/ParentPet.md
docs/Pet.md
docs/PetApi.md
@@ -87,6 +87,8 @@ docs/SimpleQuadrilateral.md
docs/SpecialModelName.md
docs/StoreApi.md
docs/StringBooleanMap.md
docs/StringEnum.md
docs/StringEnumWithDefaultValue.md
docs/Tag.md
docs/Triangle.md
docs/TriangleInterface.md
@@ -158,6 +160,9 @@ petstore_api/model/inline_object3.py
petstore_api/model/inline_object4.py
petstore_api/model/inline_object5.py
petstore_api/model/inline_response_default.py
petstore_api/model/integer_enum.py
petstore_api/model/integer_enum_one_value.py
petstore_api/model/integer_enum_with_default_value.py
petstore_api/model/isosceles_triangle.py
petstore_api/model/list.py
petstore_api/model/mammal.py
@@ -169,12 +174,9 @@ petstore_api/model/name.py
petstore_api/model/nullable_class.py
petstore_api/model/nullable_shape.py
petstore_api/model/number_only.py
petstore_api/model/number_with_validations.py
petstore_api/model/object_model_with_ref_props.py
petstore_api/model/order.py
petstore_api/model/outer_composite.py
petstore_api/model/outer_enum.py
petstore_api/model/outer_enum_default_value.py
petstore_api/model/outer_enum_integer.py
petstore_api/model/outer_enum_integer_default_value.py
petstore_api/model/parent_pet.py
petstore_api/model/pet.py
petstore_api/model/pig.py
@@ -188,6 +190,8 @@ petstore_api/model/shape_or_null.py
petstore_api/model/simple_quadrilateral.py
petstore_api/model/special_model_name.py
petstore_api/model/string_boolean_map.py
petstore_api/model/string_enum.py
petstore_api/model/string_enum_with_default_value.py
petstore_api/model/tag.py
petstore_api/model/triangle.py
petstore_api/model/triangle_interface.py

View File

@@ -82,13 +82,15 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo |
*FakeApi* | [**additional_properties_with_array_of_enums**](docs/FakeApi.md#additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums
*FakeApi* | [**array_model**](docs/FakeApi.md#array_model) | **POST** /fake/refs/arraymodel |
*FakeApi* | [**array_of_enums**](docs/FakeApi.md#array_of_enums) | **POST** /fake/refs/array-of-enums | Array of Enums
*FakeApi* | [**boolean**](docs/FakeApi.md#boolean) | **POST** /fake/refs/boolean |
*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
*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* | [**get_additional_properties_with_array_of_enums**](docs/FakeApi.md#get_additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums
*FakeApi* | [**get_array_of_enums**](docs/FakeApi.md#get_array_of_enums) | **GET** /fake/array-of-enums | Array of Enums
*FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number |
*FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props |
*FakeApi* | [**string**](docs/FakeApi.md#string) | **POST** /fake/refs/string |
*FakeApi* | [**string_enum**](docs/FakeApi.md#string_enum) | **POST** /fake/refs/enum |
*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \&quot;client\&quot; model
@@ -173,6 +175,9 @@ Class | Method | HTTP request | Description
- [inline_object4.InlineObject4](docs/InlineObject4.md)
- [inline_object5.InlineObject5](docs/InlineObject5.md)
- [inline_response_default.InlineResponseDefault](docs/InlineResponseDefault.md)
- [integer_enum.IntegerEnum](docs/IntegerEnum.md)
- [integer_enum_one_value.IntegerEnumOneValue](docs/IntegerEnumOneValue.md)
- [integer_enum_with_default_value.IntegerEnumWithDefaultValue](docs/IntegerEnumWithDefaultValue.md)
- [isosceles_triangle.IsoscelesTriangle](docs/IsoscelesTriangle.md)
- [list.List](docs/List.md)
- [mammal.Mammal](docs/Mammal.md)
@@ -184,12 +189,9 @@ Class | Method | HTTP request | Description
- [nullable_class.NullableClass](docs/NullableClass.md)
- [nullable_shape.NullableShape](docs/NullableShape.md)
- [number_only.NumberOnly](docs/NumberOnly.md)
- [number_with_validations.NumberWithValidations](docs/NumberWithValidations.md)
- [object_model_with_ref_props.ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md)
- [order.Order](docs/Order.md)
- [outer_composite.OuterComposite](docs/OuterComposite.md)
- [outer_enum.OuterEnum](docs/OuterEnum.md)
- [outer_enum_default_value.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md)
- [outer_enum_integer.OuterEnumInteger](docs/OuterEnumInteger.md)
- [outer_enum_integer_default_value.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
- [parent_pet.ParentPet](docs/ParentPet.md)
- [pet.Pet](docs/Pet.md)
- [pig.Pig](docs/Pig.md)
@@ -203,6 +205,8 @@ Class | Method | HTTP request | Description
- [simple_quadrilateral.SimpleQuadrilateral](docs/SimpleQuadrilateral.md)
- [special_model_name.SpecialModelName](docs/SpecialModelName.md)
- [string_boolean_map.StringBooleanMap](docs/StringBooleanMap.md)
- [string_enum.StringEnum](docs/StringEnum.md)
- [string_enum_with_default_value.StringEnumWithDefaultValue](docs/StringEnumWithDefaultValue.md)
- [tag.Tag](docs/Tag.md)
- [triangle.Triangle](docs/Triangle.md)
- [triangle_interface.TriangleInterface](docs/TriangleInterface.md)

View File

@@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | [**[outer_enum.OuterEnum, none_type]**](OuterEnum.md) | |
**value** | [**[string_enum.StringEnum, none_type]**](StringEnum.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -7,10 +7,11 @@ Name | Type | Description | Notes
**enum_string** | **str** | | [optional]
**enum_integer** | **int** | | [optional]
**enum_number** | **float** | | [optional]
**outer_enum** | [**outer_enum.OuterEnum**](OuterEnum.md) | | [optional]
**outer_enum_integer** | [**outer_enum_integer.OuterEnumInteger**](OuterEnumInteger.md) | | [optional]
**outer_enum_default_value** | [**outer_enum_default_value.OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional]
**outer_enum_integer_default_value** | [**outer_enum_integer_default_value.OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional]
**string_enum** | [**string_enum.StringEnum**](StringEnum.md) | | [optional]
**integer_enum** | [**integer_enum.IntegerEnum**](IntegerEnum.md) | | [optional]
**string_enum_with_default_value** | [**string_enum_with_default_value.StringEnumWithDefaultValue**](StringEnumWithDefaultValue.md) | | [optional]
**integer_enum_with_default_value** | [**integer_enum_with_default_value.IntegerEnumWithDefaultValue**](IntegerEnumWithDefaultValue.md) | | [optional]
**integer_enum_one_value** | [**integer_enum_one_value.IntegerEnumOneValue**](IntegerEnumOneValue.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)

View File

@@ -4,13 +4,15 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**additional_properties_with_array_of_enums**](FakeApi.md#additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums
[**array_model**](FakeApi.md#array_model) | **POST** /fake/refs/arraymodel |
[**array_of_enums**](FakeApi.md#array_of_enums) | **POST** /fake/refs/array-of-enums | Array of Enums
[**boolean**](FakeApi.md#boolean) | **POST** /fake/refs/boolean |
[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
[**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 |
[**get_additional_properties_with_array_of_enums**](FakeApi.md#get_additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums
[**get_array_of_enums**](FakeApi.md#get_array_of_enums) | **GET** /fake/array-of-enums | Array of Enums
[**number_with_validations**](FakeApi.md#number_with_validations) | **POST** /fake/refs/number |
[**object_model_with_ref_props**](FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props |
[**string**](FakeApi.md#string) | **POST** /fake/refs/string |
[**string_enum**](FakeApi.md#string_enum) | **POST** /fake/refs/enum |
[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \&quot;client\&quot; model
@@ -22,6 +24,259 @@ Method | HTTP request | Description
[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters |
# **additional_properties_with_array_of_enums**
> additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums additional_properties_with_array_of_enums()
Additional Properties with Array of Enums
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from petstore_api.model import additional_properties_with_array_of_enums
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
additional_properties_with_array_of_enums_additional_properties_with_array_of_enums = additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums() # additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums | Input enum (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
# Additional Properties with Array of Enums
api_response = api_instance.additional_properties_with_array_of_enums(additional_properties_with_array_of_enums_additional_properties_with_array_of_enums=additional_properties_with_array_of_enums_additional_properties_with_array_of_enums)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->additional_properties_with_array_of_enums: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**additional_properties_with_array_of_enums_additional_properties_with_array_of_enums** | [**additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md)| Input enum | [optional]
### Return type
[**additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Got object with additional properties with array of enums | - |
[[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)
# **array_model**
> animal_farm.AnimalFarm array_model()
Test serialization of ArrayModel
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from petstore_api.model import animal_farm
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
body = animal_farm.AnimalFarm() # animal_farm.AnimalFarm | Input model (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.array_model(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->array_model: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**animal_farm.AnimalFarm**](AnimalFarm.md)| Input model | [optional]
### Return type
[**animal_farm.AnimalFarm**](AnimalFarm.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Output model | - |
[[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)
# **array_of_enums**
> array_of_enums.ArrayOfEnums array_of_enums()
Array of Enums
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from petstore_api.model import array_of_enums
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
array_of_enums_array_of_enums = array_of_enums.ArrayOfEnums() # array_of_enums.ArrayOfEnums | Input enum (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
# Array of Enums
api_response = api_instance.array_of_enums(array_of_enums_array_of_enums=array_of_enums_array_of_enums)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->array_of_enums: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**array_of_enums_array_of_enums** | [**array_of_enums.ArrayOfEnums**](ArrayOfEnums.md)| Input enum | [optional]
### Return type
[**array_of_enums.ArrayOfEnums**](ArrayOfEnums.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Got named array of enums | - |
[[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)
# **boolean**
> bool boolean()
Test serialization of outer boolean types
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
body = True # bool | Input boolean as post body (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.boolean(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->boolean: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **bool**| Input boolean as post body | [optional]
### Return type
**bool**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Output boolean | - |
[[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_health_get**
> health_check_result.HealthCheckResult fake_health_get()
@@ -80,135 +335,8 @@ No authorization required
[[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_boolean_serialize**
> bool fake_outer_boolean_serialize()
Test serialization of outer boolean types
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
body = True # bool | Input boolean as post body (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.fake_outer_boolean_serialize(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **bool**| Input boolean as post body | [optional]
### Return type
**bool**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Output boolean | - |
[[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**
> outer_composite.OuterComposite fake_outer_composite_serialize()
Test serialization of object with outer number type
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from petstore_api.model import outer_composite
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
outer_composite_outer_composite = outer_composite.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.fake_outer_composite_serialize(outer_composite_outer_composite=outer_composite_outer_composite)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**outer_composite_outer_composite** | [**outer_composite.OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
### Return type
[**outer_composite.OuterComposite**](OuterComposite.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Output composite | - |
[[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**
> float fake_outer_number_serialize()
# **number_with_validations**
> number_with_validations.NumberWithValidations number_with_validations()
@@ -221,6 +349,7 @@ from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from petstore_api.model import number_with_validations
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -233,26 +362,26 @@ configuration = petstore_api.Configuration(
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
body = 3.4 # float | Input number as post body (optional)
body = number_with_validations.NumberWithValidations(3.4) # number_with_validations.NumberWithValidations | Input number as post body (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.fake_outer_number_serialize(body=body)
api_response = api_instance.number_with_validations(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e)
print("Exception when calling FakeApi->number_with_validations: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **float**| Input number as post body | [optional]
**body** | [**number_with_validations.NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional]
### Return type
**float**
[**number_with_validations.NumberWithValidations**](NumberWithValidations.md)
### Authorization
@@ -261,7 +390,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
@@ -270,8 +399,72 @@ No authorization required
[[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**
> str fake_outer_string_serialize()
# **object_model_with_ref_props**
> object_model_with_ref_props.ObjectModelWithRefProps object_model_with_ref_props()
Test serialization of object with $refed properties
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from petstore_api.model import object_model_with_ref_props
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
body = object_model_with_ref_props.ObjectModelWithRefProps() # object_model_with_ref_props.ObjectModelWithRefProps | Input model (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.object_model_with_ref_props(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->object_model_with_ref_props: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**object_model_with_ref_props.ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional]
### Return type
[**object_model_with_ref_props.ObjectModelWithRefProps**](ObjectModelWithRefProps.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Output model | - |
[[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)
# **string**
> str string()
@@ -301,10 +494,10 @@ with petstore_api.ApiClient() as api_client:
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.fake_outer_string_serialize(body=body)
api_response = api_instance.string(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e)
print("Exception when calling FakeApi->string: %s\n" % e)
```
### Parameters
@@ -324,7 +517,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
@@ -333,10 +526,12 @@ No authorization required
[[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)
# **get_additional_properties_with_array_of_enums**
> additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums get_additional_properties_with_array_of_enums()
# **string_enum**
> string_enum.StringEnum string_enum()
Additional Properties with Array of Enums
Test serialization of outer enum
### Example
@@ -345,7 +540,7 @@ from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from petstore_api.model import additional_properties_with_array_of_enums
from petstore_api.model import string_enum
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
@@ -358,22 +553,26 @@ configuration = petstore_api.Configuration(
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
# example, this endpoint has no required or optional parameters
body = string_enum.StringEnum("placed") # string_enum.StringEnum | Input enum (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
# Additional Properties with Array of Enums
api_response = api_instance.get_additional_properties_with_array_of_enums()
api_response = api_instance.string_enum(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->get_additional_properties_with_array_of_enums: %s\n" % e)
print("Exception when calling FakeApi->string_enum: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**string_enum.StringEnum**](StringEnum.md)| Input enum | [optional]
### Return type
[**additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md)
[**string_enum.StringEnum**](StringEnum.md)
### Authorization
@@ -381,71 +580,13 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Got object with additional properties with array of enums | - |
[[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)
# **get_array_of_enums**
> array_of_enums.ArrayOfEnums get_array_of_enums()
Array of Enums
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.api import fake_api
from petstore_api.model import array_of_enums
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient() as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
# example, this endpoint has no required or optional parameters
try:
# Array of Enums
api_response = api_instance.get_array_of_enums()
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->get_array_of_enums: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**array_of_enums.ArrayOfEnums**](ArrayOfEnums.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Got named array of enums | - |
**200** | Output enum | - |
[[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)

View File

@@ -1,4 +1,4 @@
# outer_enum_integer.OuterEnumInteger
# integer_enum.IntegerEnum
## Properties
Name | Type | Description | Notes

View File

@@ -1,4 +1,4 @@
# outer_enum_integer_default_value.OuterEnumIntegerDefaultValue
# integer_enum_one_value.IntegerEnumOneValue
## Properties
Name | Type | Description | Notes

View File

@@ -0,0 +1,10 @@
# integer_enum_with_default_value.IntegerEnumWithDefaultValue
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **int** | | defaults 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)

View File

@@ -0,0 +1,10 @@
# number_with_validations.NumberWithValidations
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **float** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -1,9 +1,10 @@
# outer_composite.OuterComposite
# object_model_with_ref_props.ObjectModelWithRefProps
a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**my_number** | **float** | | [optional]
**my_number** | [**number_with_validations.NumberWithValidations**](NumberWithValidations.md) | | [optional]
**my_string** | **str** | | [optional]
**my_boolean** | **bool** | | [optional]

View File

@@ -1,4 +1,4 @@
# outer_enum.OuterEnum
# string_enum.StringEnum
## Properties
Name | Type | Description | Notes

View File

@@ -1,4 +1,4 @@
# outer_enum_default_value.OuterEnumDefaultValue
# string_enum_with_default_value.StringEnumWithDefaultValue
## Properties
Name | Type | Description | Notes

View File

@@ -34,10 +34,10 @@ from petstore_api.model_utils import ( # noqa: F401
validate_get_composed_info,
)
try:
from petstore_api.model import outer_enum
from petstore_api.model import string_enum
except ImportError:
outer_enum = sys.modules[
'petstore_api.model.outer_enum']
string_enum = sys.modules[
'petstore_api.model.string_enum']
class ArrayOfEnums(ModelSimple):
@@ -81,7 +81,7 @@ class ArrayOfEnums(ModelSimple):
and the value is attribute type.
"""
return {
'value': ([outer_enum.OuterEnum, none_type],), # noqa: E501
'value': ([string_enum.StringEnum, none_type],), # noqa: E501
}
@cached_property
@@ -106,7 +106,7 @@ class ArrayOfEnums(ModelSimple):
"""array_of_enums.ArrayOfEnums - a model defined in OpenAPI
Args:
value ([outer_enum.OuterEnum, none_type]):
value ([string_enum.StringEnum, none_type]):
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types

View File

@@ -34,25 +34,30 @@ from petstore_api.model_utils import ( # noqa: F401
validate_get_composed_info,
)
try:
from petstore_api.model import outer_enum
from petstore_api.model import integer_enum
except ImportError:
outer_enum = sys.modules[
'petstore_api.model.outer_enum']
integer_enum = sys.modules[
'petstore_api.model.integer_enum']
try:
from petstore_api.model import outer_enum_default_value
from petstore_api.model import integer_enum_one_value
except ImportError:
outer_enum_default_value = sys.modules[
'petstore_api.model.outer_enum_default_value']
integer_enum_one_value = sys.modules[
'petstore_api.model.integer_enum_one_value']
try:
from petstore_api.model import outer_enum_integer
from petstore_api.model import integer_enum_with_default_value
except ImportError:
outer_enum_integer = sys.modules[
'petstore_api.model.outer_enum_integer']
integer_enum_with_default_value = sys.modules[
'petstore_api.model.integer_enum_with_default_value']
try:
from petstore_api.model import outer_enum_integer_default_value
from petstore_api.model import string_enum
except ImportError:
outer_enum_integer_default_value = sys.modules[
'petstore_api.model.outer_enum_integer_default_value']
string_enum = sys.modules[
'petstore_api.model.string_enum']
try:
from petstore_api.model import string_enum_with_default_value
except ImportError:
string_enum_with_default_value = sys.modules[
'petstore_api.model.string_enum_with_default_value']
class EnumTest(ModelNormal):
@@ -122,10 +127,11 @@ class EnumTest(ModelNormal):
'enum_string': (str,), # noqa: E501
'enum_integer': (int,), # noqa: E501
'enum_number': (float,), # noqa: E501
'outer_enum': (outer_enum.OuterEnum,), # noqa: E501
'outer_enum_integer': (outer_enum_integer.OuterEnumInteger,), # noqa: E501
'outer_enum_default_value': (outer_enum_default_value.OuterEnumDefaultValue,), # noqa: E501
'outer_enum_integer_default_value': (outer_enum_integer_default_value.OuterEnumIntegerDefaultValue,), # noqa: E501
'string_enum': (string_enum.StringEnum,), # noqa: E501
'integer_enum': (integer_enum.IntegerEnum,), # noqa: E501
'string_enum_with_default_value': (string_enum_with_default_value.StringEnumWithDefaultValue,), # noqa: E501
'integer_enum_with_default_value': (integer_enum_with_default_value.IntegerEnumWithDefaultValue,), # noqa: E501
'integer_enum_one_value': (integer_enum_one_value.IntegerEnumOneValue,), # noqa: E501
}
@cached_property
@@ -137,10 +143,11 @@ class EnumTest(ModelNormal):
'enum_string': 'enum_string', # noqa: E501
'enum_integer': 'enum_integer', # noqa: E501
'enum_number': 'enum_number', # noqa: E501
'outer_enum': 'outerEnum', # noqa: E501
'outer_enum_integer': 'outerEnumInteger', # noqa: E501
'outer_enum_default_value': 'outerEnumDefaultValue', # noqa: E501
'outer_enum_integer_default_value': 'outerEnumIntegerDefaultValue', # noqa: E501
'string_enum': 'stringEnum', # noqa: E501
'integer_enum': 'IntegerEnum', # noqa: E501
'string_enum_with_default_value': 'StringEnumWithDefaultValue', # noqa: E501
'integer_enum_with_default_value': 'IntegerEnumWithDefaultValue', # noqa: E501
'integer_enum_one_value': 'IntegerEnumOneValue', # noqa: E501
}
_composed_schemas = {}
@@ -195,10 +202,11 @@ class EnumTest(ModelNormal):
enum_string (str): [optional] # noqa: E501
enum_integer (int): [optional] # noqa: E501
enum_number (float): [optional] # noqa: E501
outer_enum (outer_enum.OuterEnum): [optional] # noqa: E501
outer_enum_integer (outer_enum_integer.OuterEnumInteger): [optional] # noqa: E501
outer_enum_default_value (outer_enum_default_value.OuterEnumDefaultValue): [optional] # noqa: E501
outer_enum_integer_default_value (outer_enum_integer_default_value.OuterEnumIntegerDefaultValue): [optional] # noqa: E501
string_enum (string_enum.StringEnum): [optional] # noqa: E501
integer_enum (integer_enum.IntegerEnum): [optional] # noqa: E501
string_enum_with_default_value (string_enum_with_default_value.StringEnumWithDefaultValue): [optional] # noqa: E501
integer_enum_with_default_value (integer_enum_with_default_value.IntegerEnumWithDefaultValue): [optional] # noqa: E501
integer_enum_one_value (integer_enum_one_value.IntegerEnumOneValue): [optional] # noqa: E501
"""
_check_type = kwargs.pop('_check_type', True)

View File

@@ -35,7 +35,7 @@ from petstore_api.model_utils import ( # noqa: F401
)
class OuterEnumInteger(ModelSimple):
class IntegerEnum(ModelSimple):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
@@ -103,7 +103,7 @@ class OuterEnumInteger(ModelSimple):
@convert_js_args_to_python_args
def __init__(self, value, *args, **kwargs): # noqa: E501
"""outer_enum_integer.OuterEnumInteger - a model defined in OpenAPI
"""integer_enum.IntegerEnum - a model defined in OpenAPI
Args:
value (int):

View File

@@ -0,0 +1,174 @@
# coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
class IntegerEnumOneValue(ModelSimple):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a capitalized key describing the allowed value and an allowed
value. These dicts store the allowed enum values.
validations (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
that stores validations for max_length, min_length, max_items,
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
inclusive_minimum, and regex.
additional_properties_type (tuple): A tuple of classes accepted
as additional properties values.
"""
allowed_values = {
('value',): {
'0': 0,
},
}
validations = {
}
additional_properties_type = None
_nullable = False
@cached_property
def openapi_types():
"""
This must be a class method so a model may have properties that are
of type self, this ensures that we don't create a cyclic import
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
return {
'value': (int,), # noqa: E501
}
@cached_property
def discriminator():
return None
attribute_map = {}
_composed_schemas = None
required_properties = set([
'_data_store',
'_check_type',
'_spec_property_naming',
'_path_to_item',
'_configuration',
'_visited_composed_classes',
])
@convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
"""integer_enum_one_value.IntegerEnumOneValue - a model defined in OpenAPI
Args:
Keyword Args:
value (int): defaults to 0, must be one of [0, ] # noqa: E501
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
"""
value = kwargs.get('value', 0)
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
self.value = value
for var_name, var_value in six.iteritems(kwargs):
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)

View File

@@ -35,7 +35,7 @@ from petstore_api.model_utils import ( # noqa: F401
)
class OuterEnumIntegerDefaultValue(ModelSimple):
class IntegerEnumWithDefaultValue(ModelSimple):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
@@ -103,7 +103,7 @@ class OuterEnumIntegerDefaultValue(ModelSimple):
@convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
"""outer_enum_integer_default_value.OuterEnumIntegerDefaultValue - a model defined in OpenAPI
"""integer_enum_with_default_value.IntegerEnumWithDefaultValue - a model defined in OpenAPI
Args:

View File

@@ -0,0 +1,174 @@
# coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa: F401
import six # noqa: F401
import nulltype # noqa: F401
from petstore_api.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
class NumberWithValidations(ModelSimple):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a capitalized key describing the allowed value and an allowed
value. These dicts store the allowed enum values.
validations (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
that stores validations for max_length, min_length, max_items,
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
inclusive_minimum, and regex.
additional_properties_type (tuple): A tuple of classes accepted
as additional properties values.
"""
allowed_values = {
}
validations = {
('value',): {
'inclusive_maximum': 20,
'inclusive_minimum': 10,
},
}
additional_properties_type = None
_nullable = False
@cached_property
def openapi_types():
"""
This must be a class method so a model may have properties that are
of type self, this ensures that we don't create a cyclic import
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
return {
'value': (float,), # noqa: E501
}
@cached_property
def discriminator():
return None
attribute_map = {}
_composed_schemas = None
required_properties = set([
'_data_store',
'_check_type',
'_spec_property_naming',
'_path_to_item',
'_configuration',
'_visited_composed_classes',
])
@convert_js_args_to_python_args
def __init__(self, value, *args, **kwargs): # noqa: E501
"""number_with_validations.NumberWithValidations - a model defined in OpenAPI
Args:
value (float):
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
"""
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
self.value = value
for var_name, var_value in six.iteritems(kwargs):
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)

Some files were not shown because too many files have changed in this diff Show More