Adds requiredVarsMap (#13117)

* Adds requiredVarsMap

* Fixes imports

* Adds requiredVarsMap to CodegenParameter

* Updates CodegenResponse

* Adds feature to codegenModel

* Fixes codegenProperty

* Switches to getRequiredVarsMap

* Uses curly braces for set definition

* Added blocked examples back n to test spec now that the required bug is fixed

* Sample regenerated

* Handles escaping required property names

* Fixes CI tests

* Samples regenerated

* Samples regnerated

* Fixes test
This commit is contained in:
Justin Black 2022-08-08 09:47:43 -07:00 committed by GitHub
parent 186ad25cee
commit 9610a81a13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
101 changed files with 3513 additions and 169 deletions

View File

@ -164,6 +164,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
private boolean hasDiscriminatorWithNonEmptyMapping;
private boolean isAnyType;
private boolean isUuid;
private Map<String, CodegenProperty> requiredVarsMap;
public String getAdditionalPropertiesType() {
return additionalPropertiesType;
@ -928,6 +929,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
getUniqueItems() == that.getUniqueItems() &&
getExclusiveMinimum() == that.getExclusiveMinimum() &&
getExclusiveMaximum() == that.getExclusiveMaximum() &&
Objects.equals(requiredVarsMap, that.getRequiredVarsMap()) &&
Objects.equals(composedSchemas, that.composedSchemas) &&
Objects.equals(parent, that.parent) &&
Objects.equals(parentSchema, that.parentSchema) &&
@ -1000,7 +1002,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
getMinItems(), getMaxLength(), getMinLength(), getExclusiveMinimum(), getExclusiveMaximum(), getMinimum(),
getMaximum(), getPattern(), getMultipleOf(), getItems(), getAdditionalProperties(), getIsModel(),
getAdditionalPropertiesIsAnyType(), hasDiscriminatorWithNonEmptyMapping,
isAnyType, getComposedSchemas(), hasMultipleTypes, isDecimal, isUuid);
isAnyType, getComposedSchemas(), hasMultipleTypes, isDecimal, isUuid, requiredVarsMap);
}
@Override
@ -1097,6 +1099,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
sb.append(", hasMultipleTypes=").append(hasMultipleTypes);
sb.append(", isDecimal=").append(isDecimal);
sb.append(", isUUID=").append(isUuid);
sb.append(", requiredVarsMap=").append(requiredVarsMap);
sb.append('}');
return sb.toString();
}
@ -1124,6 +1127,12 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
return this.items != null;
}
@Override
public Map<String, CodegenProperty> getRequiredVarsMap() { return requiredVarsMap; }
@Override
public void setRequiredVarsMap(Map<String, CodegenProperty> requiredVarsMap) { this.requiredVarsMap=requiredVarsMap; }
/**
* Remove duplicated properties in all variable list
*/

View File

@ -111,6 +111,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
private CodegenComposedSchemas composedSchemas;
private boolean hasMultipleTypes = false;
private LinkedHashMap<String, CodegenMediaType> content;
private Map<String, CodegenProperty> requiredVarsMap;
public CodegenParameter copy() {
CodegenParameter output = new CodegenParameter();
@ -194,6 +195,9 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
if (this.vendorExtensions != null) {
output.vendorExtensions = new HashMap<String, Object>(this.vendorExtensions);
}
if (this.requiredVarsMap != null) {
output.setRequiredVarsMap(this.requiredVarsMap);
}
output.hasValidation = this.hasValidation;
output.isNullable = this.isNullable;
output.isDeprecated = this.isDeprecated;
@ -230,7 +234,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
@Override
public int hashCode() {
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content);
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content, requiredVarsMap);
}
@Override
@ -286,6 +290,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
getExclusiveMaximum() == that.getExclusiveMaximum() &&
getExclusiveMinimum() == that.getExclusiveMinimum() &&
getUniqueItems() == that.getUniqueItems() &&
Objects.equals(requiredVarsMap, that.getRequiredVarsMap()) &&
Objects.equals(content, that.getContent()) &&
Objects.equals(schema, that.getSchema()) &&
Objects.equals(composedSchemas, that.getComposedSchemas()) &&
@ -415,6 +420,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
sb.append(", hasMultipleTypes=").append(hasMultipleTypes);
sb.append(", schema=").append(schema);
sb.append(", content=").append(content);
sb.append(", requiredVarsMap=").append(requiredVarsMap);
sb.append('}');
return sb.toString();
}
@ -815,5 +821,11 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
public String getBaseType() {
return baseType;
}
@Override
public Map<String, CodegenProperty> getRequiredVarsMap() { return requiredVarsMap; }
@Override
public void setRequiredVarsMap(Map<String, CodegenProperty> requiredVarsMap) { this.requiredVarsMap=requiredVarsMap; }
}

View File

@ -194,6 +194,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
private boolean hasDiscriminatorWithNonEmptyMapping;
private CodegenComposedSchemas composedSchemas = null;
private boolean hasMultipleTypes = false;
private Map<String, CodegenProperty> requiredVarsMap;
public String getBaseName() {
return baseName;
@ -690,6 +691,9 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
if (this.composedSchemas != null) {
cp.composedSchemas = this.composedSchemas;
}
if (this.requiredVarsMap != null) {
cp.setRequiredVarsMap(this.requiredVarsMap);
}
return cp;
} catch (CloneNotSupportedException e) {
@ -867,6 +871,12 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
public void setIsUuid(boolean isUuid) { this.isUuid = isUuid; }
@Override
public Map<String, CodegenProperty> getRequiredVarsMap() { return requiredVarsMap; }
@Override
public void setRequiredVarsMap(Map<String, CodegenProperty> requiredVarsMap) { this.requiredVarsMap=requiredVarsMap; }
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("CodegenProperty{");
@ -966,6 +976,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping);
sb.append(", composedSchemas=").append(composedSchemas);
sb.append(", hasMultipleTypes=").append(hasMultipleTypes);
sb.append(", requiredVarsMap=").append(requiredVarsMap);
sb.append('}');
return sb.toString();
}
@ -1024,6 +1035,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
getHasVars() == that.getHasVars() &&
getHasRequired() == that.getHasRequired() &&
Objects.equals(requiredVarsMap, that.getRequiredVarsMap()) &&
Objects.equals(composedSchemas, that.composedSchemas) &&
Objects.equals(openApiType, that.openApiType) &&
Objects.equals(baseName, that.baseName) &&
@ -1087,6 +1099,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInCamelCase,
nameInSnakeCase, enumName, maxItems, minItems, isXmlAttribute, xmlPrefix, xmlName,
xmlNamespace, isXmlWrapped, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired,
hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes);
hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, requiredVarsMap);
}
}

View File

@ -89,6 +89,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
private CodegenComposedSchemas composedSchemas;
private boolean hasMultipleTypes = false;
private LinkedHashMap<String, CodegenMediaType> content;
private Map<String, CodegenProperty> requiredVarsMap;
@Override
public int hashCode() {
@ -100,7 +101,8 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
getMaxProperties(), getMinProperties(), uniqueItems, getMaxItems(), getMinItems(), getMaxLength(),
getMinLength(), exclusiveMinimum, exclusiveMaximum, getMinimum(), getMaximum(), getPattern(),
is1xx, is2xx, is3xx, is4xx, is5xx, additionalPropertiesIsAnyType, hasVars, hasRequired,
hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, responseHeaders, content);
hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, responseHeaders, content,
requiredVarsMap);
}
@Override
@ -149,6 +151,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
getHasVars() == that.getHasVars() &&
getHasRequired() == that.getHasRequired() &&
Objects.equals(requiredVarsMap, that.getRequiredVarsMap()) &&
Objects.equals(content, that.getContent()) &&
Objects.equals(responseHeaders, that.getResponseHeaders()) &&
Objects.equals(composedSchemas, that.getComposedSchemas()) &&
@ -538,6 +541,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
sb.append(", hasMultipleTypes=").append(hasMultipleTypes);
sb.append(", responseHeaders=").append(responseHeaders);
sb.append(", content=").append(content);
sb.append(", requiredVarsMap=").append(requiredVarsMap);
sb.append('}');
return sb.toString();
}
@ -665,4 +669,10 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
public String getBaseType() {
return baseType;
}
@Override
public Map<String, CodegenProperty> getRequiredVarsMap() { return requiredVarsMap; }
@Override
public void setRequiredVarsMap(Map<String, CodegenProperty> requiredVarsMap) { this.requiredVarsMap=requiredVarsMap; }
}

View File

@ -2692,6 +2692,7 @@ public class DefaultCodegen implements CodegenConfig {
}
// process 'additionalProperties'
setAddProps(schema, m);
addRequiredVarsMap(schema, m);
}
protected void updateModelForAnyType(CodegenModel m, Schema schema) {
@ -2712,6 +2713,7 @@ public class DefaultCodegen implements CodegenConfig {
}
// process 'additionalProperties'
setAddProps(schema, m);
addRequiredVarsMap(schema, m);
}
protected String toTestCaseName(String specTestCaseName) {
@ -7100,11 +7102,70 @@ public class DefaultCodegen implements CodegenConfig {
return codegenParameter;
}
protected void addRequiredVarsMap(Schema schema, IJsonSchemaValidationProperties property) {
/*
this should be called after vars and additionalProperties are set
Features added by storing codegenProperty values:
- complexType stores reference to additionalProperties definition
- baseName stores original name (can be invalid in a programming language)
- nameInSnakeCase can store valid name for a programming language
*/
Map<String, Schema> properties = schema.getProperties();
Map<String, CodegenProperty> requiredVarsMap = new HashMap<>();
List<String> requiredPropertyNames = schema.getRequired();
if (requiredPropertyNames == null) {
return;
}
for (String requiredPropertyName: requiredPropertyNames) {
// required property is defined in properties, value is that CodegenProperty
String usedRequiredPropertyName = handleSpecialCharacters(requiredPropertyName);
if (properties != null && properties.containsKey(requiredPropertyName)) {
// get cp from property
boolean found = false;
for (CodegenProperty cp: property.getVars()) {
if (cp.baseName.equals(requiredPropertyName)) {
found = true;
requiredVarsMap.put(requiredPropertyName, cp);
}
}
if (found == false) {
throw new RuntimeException("Property " + requiredPropertyName + " is missing from getVars");
}
} else if (schema.getAdditionalProperties() instanceof Boolean && Boolean.FALSE.equals(schema.getAdditionalProperties())) {
// TODO add processing for requiredPropertyName
// required property is not defined in properties, and additionalProperties is false, value is null
requiredVarsMap.put(usedRequiredPropertyName, null);
} else {
// required property is not defined in properties, and additionalProperties is true or unset value is CodegenProperty made from empty schema
// required property is not defined in properties, and additionalProperties is schema, value is CodegenProperty made from schema
if (supportsAdditionalPropertiesWithComposedSchema && !disallowAdditionalPropertiesIfNotPresent) {
if (property.getAdditionalProperties() == null) {
throw new RuntimeException("additionalProperties is unset and should be set in" + schema.toString());
}
CodegenProperty cp;
if (schema.getAdditionalProperties() == null) {
cp = fromProperty(usedRequiredPropertyName, new Schema(), true);
} else if (schema.getAdditionalProperties() instanceof Boolean && Boolean.TRUE.equals(schema.getAdditionalProperties())) {
cp = fromProperty(requiredPropertyName, new Schema(), true);
} else {
CodegenProperty addPropsProp = property.getAdditionalProperties();
cp = addPropsProp;
}
requiredVarsMap.put(usedRequiredPropertyName, cp);
}
}
}
if (!requiredVarsMap.isEmpty()) {
property.setRequiredVarsMap(requiredVarsMap);
}
}
protected void addVarsRequiredVarsAdditionalProps(Schema schema, IJsonSchemaValidationProperties property) {
setAddProps(schema, property);
Set<String> mandatory = schema.getRequired() == null ? Collections.emptySet()
: new TreeSet<>(schema.getRequired());
addVars(property, property.getVars(), schema.getProperties(), mandatory);
addRequiredVarsMap(schema, property);
}
private void addJsonSchemaForBodyRequestInCaseItsNotPresent(CodegenParameter codegenParameter, RequestBody body) {
@ -7666,4 +7727,11 @@ public class DefaultCodegen implements CodegenConfig {
@Override
public boolean getUseInlineModelResolver() { return true; }
/*
A function to convert yaml or json ingested strings like property names
And convert special characters like newline, tab, carriage return
Into strings that can be rendered in the language that the generator will output to
*/
protected String handleSpecialCharacters(String name) { return name; }
}

View File

@ -3,6 +3,7 @@ package org.openapitools.codegen;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Stream;
@ -115,6 +116,17 @@ public interface IJsonSchemaValidationProperties {
void setRequiredVars(List<CodegenProperty> requiredVars);
Map<String, CodegenProperty> getRequiredVarsMap();
// goes from required propertyName to its CodegenProperty
// Use Cases:
// 1. required property is defined in properties, value is that CodegenProperty
// 2. required property is not defined in properties, and additionalProperties is true or unset value is CodegenProperty made from empty schema
// 3. required property is not defined in properties, and additionalProperties is schema, value is CodegenProperty made from schema
// 4. required property is not defined in properties, and additionalProperties is false, value is null
void setRequiredVarsMap(Map<String, CodegenProperty> requiredVarsMap);
boolean getIsNull();
void setIsNull(boolean isNull);

View File

@ -661,6 +661,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen {
}
addVars(property, property.getVars(), schema.getProperties(), requiredVars);
}
addRequiredVarsMap(schema, property);
return;
} else if (ModelUtils.isTypeObjectSchema(schema)) {
HashSet<String> requiredVars = new HashSet<>();
@ -673,6 +674,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen {
property.setHasVars(true);
}
}
addRequiredVarsMap(schema, property);
return;
}
@ -997,6 +999,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen {
@Override
public CodegenProperty fromProperty(String name, Schema p, boolean required) {
CodegenProperty cp = super.fromProperty(name, p, required);
if (cp.isAnyType && cp.isNullable) {
cp.isNullable = false;
}
@ -1339,7 +1342,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen {
return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, specTestCaseName);
}
private String processStringValue(String value) {
protected String handleSpecialCharacters(String value) {
// handles escape characters and the like
String stringValue = value;
String backslash = "\\";
@ -1379,7 +1382,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen {
} else if (value instanceof Double || value instanceof Float || value instanceof Boolean){
return value;
} else if (value instanceof String) {
return processStringValue((String) value);
return handleSpecialCharacters((String) value);
} else if (value instanceof LinkedHashMap) {
LinkedHashMap<String, Object> fixedValues = new LinkedHashMap();
for (Map.Entry entry: ((LinkedHashMap<String, Object>) value).entrySet()) {
@ -1821,7 +1824,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen {
return fullPrefix + example + closeChars;
} else if (ModelUtils.isStringSchema(schema)) {
if (example != null) {
return fullPrefix + ensureQuotes(processStringValue(example)) + closeChars;
return fullPrefix + ensureQuotes(handleSpecialCharacters(example)) + closeChars;
}
if (ModelUtils.isDateSchema(schema)) {
if (objExample == null) {
@ -2336,6 +2339,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen {
@Override
protected void updateModelForObject(CodegenModel m, Schema schema) {
// custom version of this method so properties are always added with addVars
if (schema.getProperties() != null || schema.getRequired() != null) {
// passing null to allProperties and allRequired as there's no parent
addVars(m, unaliasPropertySchema(schema.getProperties()), schema.getRequired(), null, null);
@ -2344,6 +2348,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen {
addAdditionPropertiesToCodeGenModel(m, schema);
// process 'additionalProperties'
setAddProps(schema, m);
addRequiredVarsMap(schema, m);
}
@Override
@ -2361,6 +2366,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen {
addAdditionPropertiesToCodeGenModel(m, schema);
// process 'additionalProperties'
setAddProps(schema, m);
addRequiredVarsMap(schema, m);
}
@Override

View File

@ -1,9 +1,9 @@
{{#if getHasRequired}}
_required_property_names = set((
{{#each requiredVars}}
'{{baseName}}',
{{#if getRequiredVarsMap}}
_required_property_names = {
{{#each getRequiredVarsMap}}
"{{{@key}}}",
{{/each}}
))
}
{{/if}}
{{#each vars}}
{{#if complexType}}

View File

@ -3,10 +3,12 @@ def __new__(
*args: typing.Union[{{#if isAnyType}}dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes{{/if}}{{#if isUnboundedInteger}}int, {{/if}}{{#if isNumber}}float, {{/if}}{{#if isBoolean}}bool, {{/if}}{{#if isArray}}list, tuple, {{/if}}{{#if isMap}}dict, frozendict, {{/if}}{{#if isString}}str, {{/if}}{{#if isNull}}None, {{/if}}],
{{#unless isNull}}
{{#if getHasRequired}}
{{#each requiredVars}}
{{#each getRequiredVarsMap}}
{{#with this}}
{{#unless nameInSnakeCase}}
{{baseName}}: {{baseName}},
{{/unless}}
{{/with}}
{{/each}}
{{/if}}
{{/unless}}
@ -32,10 +34,12 @@ def __new__(
*args,
{{#unless isNull}}
{{#if getHasRequired}}
{{#each requiredVars}}
{{#each getRequiredVarsMap}}
{{#with this}}
{{#unless nameInSnakeCase}}
{{baseName}}={{baseName}},
{{/unless}}
{{/with}}
{{/each}}
{{/if}}
{{/unless}}

View File

@ -7,7 +7,7 @@
{{else}}
{{#or isMap isArray isAnyType}}
{{#if isMap}}
{{#or hasVars hasValidation hasRequiredVars getHasDiscriminatorWithNonEmptyMapping}}
{{#or hasVars hasValidation getRequiredVarsMap getHasDiscriminatorWithNonEmptyMapping}}
{{> model_templates/schema_dict }}
{{else}}
{{#if additionalPropertiesIsAnyType}}
@ -25,7 +25,7 @@
{{/or}}
{{/if}}
{{#if isAnyType}}
{{#or isEnum hasVars hasValidation hasRequiredVars getHasDiscriminatorWithNonEmptyMapping items}}
{{#or isEnum hasVars hasValidation getRequiredVarsMap getHasDiscriminatorWithNonEmptyMapping items}}
{{> model_templates/schema_composed_or_anytype }}
{{else}}
{{> model_templates/var_equals_cls }}

View File

@ -7,8 +7,13 @@
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
{{#each getRequiredVarsMap}}
**{{{@key}}}** | {{#with this}}{{#unless complexType}}**{{dataType}}**{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexType}}.md){{/if}} | {{#if description}}{{description}}{{/if}} | {{#if isReadOnly}}[readonly] {{/if}}{{#if defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/if}}{{/with}}
{{/each}}
{{#each vars}}
{{#unless required}}
**{{baseName}}** | {{#unless complexType}}**{{dataType}}**{{/unless}}{{#if complexType}}[**{{dataType}}**]({{complexType}}.md){{/if}} | {{#if description}}{{description}}{{/if}} | {{#unless required}}[optional] {{/unless}}{{#if isReadOnly}}[readonly] {{/if}}{{#if defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/if}}
{{/unless}}
{{/each}}
{{#with additionalProperties}}
**any string name** | **{{dataType}}** | any string name can be used but the value must be the correct type | [optional]

View File

@ -1061,7 +1061,7 @@ class DictBase(Discriminable):
"""
path_to_schemas = {}
for property_name, value in arg.items():
if property_name in cls._required_property_names or property_name in cls._property_names:
if property_name in cls._property_names:
schema = getattr(cls, property_name)
elif cls._additional_properties:
schema = cls._additional_properties

View File

@ -2196,6 +2196,42 @@ paths:
- path.post
- contentType_json
- oneOf
/requestBody/postOneofWithRequiredRequestBody:
post:
operationId: postOneofWithRequiredRequestBody
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OneofWithRequired'
x-schema-test-examples:
$ref: '#/components/x-schema-test-examples/OneofWithRequired'
required: true
responses:
'200':
description: success
tags:
- operation.requestBody
- path.post
- contentType_json
- oneOf
/responseBody/postOneofWithRequiredResponseBodyForContentTypes:
post:
operationId: postOneofWithRequiredResponseBodyForContentTypes
responses:
'200':
description: success
content:
application/json:
schema:
$ref: '#/components/schemas/OneofWithRequired'
x-schema-test-examples:
$ref: '#/components/x-schema-test-examples/OneofWithRequired'
tags:
- response.content.contentType.schema
- path.post
- contentType_json
- oneOf
/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody:
post:
operationId: postNestedOneofToCheckValidationSemanticsRequestBody
@ -2736,6 +2772,42 @@ paths:
- path.post
- contentType_json
- required
/requestBody/postRequiredWithEscapedCharactersRequestBody:
post:
operationId: postRequiredWithEscapedCharactersRequestBody
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RequiredWithEscapedCharacters'
x-schema-test-examples:
$ref: '#/components/x-schema-test-examples/RequiredWithEscapedCharacters'
required: true
responses:
'200':
description: success
tags:
- operation.requestBody
- path.post
- contentType_json
- required
/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes:
post:
operationId: postRequiredWithEscapedCharactersResponseBodyForContentTypes
responses:
'200':
description: success
content:
application/json:
schema:
$ref: '#/components/schemas/RequiredWithEscapedCharacters'
x-schema-test-examples:
$ref: '#/components/x-schema-test-examples/RequiredWithEscapedCharacters'
tags:
- response.content.contentType.schema
- path.post
- contentType_json
- required
/requestBody/postIntegerTypeMatchesIntegersRequestBody:
post:
operationId: postIntegerTypeMatchesIntegersRequestBody
@ -3316,6 +3388,15 @@ components:
oneOf:
- type: number
- {}
OneofWithRequired:
type: object
oneOf:
- required:
- foo
- bar
- required:
- foo
- baz
NestedOneofToCheckValidationSemantics:
oneOf:
- oneOf:
@ -3382,6 +3463,16 @@ components:
properties:
foo: {}
required: []
RequiredWithEscapedCharacters:
required:
- 'foo
bar'
- foo"bar
- foo\bar
- "foo\rbar"
- "foo\tbar"
- "foo\fbar"
IntegerTypeMatchesIntegers:
type: integer
NumberTypeMatchesNumbers:
@ -4438,6 +4529,31 @@ components:
description: both valid - invalid
data: 123
valid: false
OneofWithRequired:
BothInvalidInvalid:
description: both invalid - invalid
data:
bar: 2
valid: false
FirstValidValid:
description: first valid - valid
data:
foo: 1
bar: 2
valid: true
SecondValidValid:
description: second valid - valid
data:
foo: 1
baz: 3
valid: true
BothValidInvalid:
description: both valid - invalid
data:
foo: 1
bar: 2
baz: 3
valid: false
NestedOneofToCheckValidationSemantics:
NullIsValid:
description: null is valid
@ -4658,6 +4774,29 @@ components:
description: property not required
data: {}
valid: true
RequiredWithEscapedCharacters:
ObjectWithAllPropertiesPresentIsValid:
description: object with all properties present is valid
data:
? 'foo
bar'
: 1
foo"bar: 1
foo\bar: 1
"foo\rbar": 1
"foo\tbar": 1
"foo\fbar": 1
valid: true
ObjectWithSomePropertiesMissingIsInvalid:
description: object with some properties missing is invalid
data:
? 'foo
bar'
: '1'
foo"bar: '1'
valid: false
IntegerTypeMatchesIntegers:
AnIntegerIsAnInteger:
description: an integer is an integer

View File

@ -100,7 +100,6 @@ class ExclusionReason:
swagger_parser_anytype_bug = 'Swagger parser sets type incorrectly for this anyType schema https://github.com/swagger-api/swagger-parser/issues/1603'
component_ref_component_bug = 'A component refing another component does not work, issue at https://github.com/OpenAPITools/openapi-generator/issues/12730'
not_running_the_localhost_server = 'the openapo-generator is not running the localhost server needed to serve remoteRef files'
required_vars_missing_for_anytype_schema_bug = 'fails because of a bug where required vars are forgotten, see issue https://github.com/OpenAPITools/openapi-generator/issues/8906'
v303_requires_that_the_default_value_is_an_allowed_type = 'v3.0.3 requires that the default value is an allowed type per the schema'
not_ref_import_missing = 'this test fails because of this open issue https://github.com/OpenAPITools/openapi-generator/issues/12756'
@ -149,7 +148,6 @@ FILEPATH_TO_EXCLUDED_CASE_AND_REASON = {
'oneOf with boolean schemas, one true': ExclusionReason.v303_does_not_support_boolean_schemas_in_location,
'oneOf with boolean schemas, more than one true': ExclusionReason.v303_does_not_support_boolean_schemas_in_location,
'oneOf with boolean schemas, all false': ExclusionReason.v303_does_not_support_boolean_schemas_in_location,
'oneOf with required': ExclusionReason.required_vars_missing_for_anytype_schema_bug,
},
(json_schema_test_draft, 'properties.json'): {
'properties, patternProperties, additionalProperties interaction': ExclusionReason.v303_does_not_support_patternProperties,
@ -193,9 +191,6 @@ FILEPATH_TO_EXCLUDED_CASE_AND_REASON = {
'fragment within remote ref': ExclusionReason.not_running_the_localhost_server,
'ref within remote ref': ExclusionReason.not_running_the_localhost_server,
},
(json_schema_test_draft, 'required.json'): {
'required with escaped characters': ExclusionReason.required_vars_missing_for_anytype_schema_bug,
},
(json_schema_test_draft, 'type.json'): {
'multiple types can be specified in an array': ExclusionReason.v303_does_not_support_array_of_types,
'type as array with one item': ExclusionReason.v303_does_not_support_array_of_types,

View File

@ -92,6 +92,7 @@ docs/models/Oneof.md
docs/models/OneofComplexTypes.md
docs/models/OneofWithBaseSchema.md
docs/models/OneofWithEmptySchema.md
docs/models/OneofWithRequired.md
docs/models/PatternIsNotAnchored.md
docs/models/PatternValidation.md
docs/models/PropertiesWithEscapedCharacters.md
@ -105,6 +106,7 @@ docs/models/RefInProperty.md
docs/models/RequiredDefaultValidation.md
docs/models/RequiredValidation.md
docs/models/RequiredWithEmptyArray.md
docs/models/RequiredWithEscapedCharacters.md
docs/models/SimpleEnumValidation.md
docs/models/StringTypeMatchesStrings.md
docs/models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md
@ -182,6 +184,7 @@ test/test_models/test_oneof.py
test/test_models/test_oneof_complex_types.py
test/test_models/test_oneof_with_base_schema.py
test/test_models/test_oneof_with_empty_schema.py
test/test_models/test_oneof_with_required.py
test/test_models/test_pattern_is_not_anchored.py
test/test_models/test_pattern_validation.py
test/test_models/test_properties_with_escaped_characters.py
@ -195,6 +198,7 @@ test/test_models/test_ref_in_property.py
test/test_models/test_required_default_validation.py
test/test_models/test_required_validation.py
test/test_models/test_required_with_empty_array.py
test/test_models/test_required_with_escaped_characters.py
test/test_models/test_simple_enum_validation.py
test/test_models/test_string_type_matches_strings.py
test/test_models/test_the_default_keyword_does_not_do_anything_if_the_property_is_missing.py
@ -300,6 +304,7 @@ unit_test_api/model/oneof.py
unit_test_api/model/oneof_complex_types.py
unit_test_api/model/oneof_with_base_schema.py
unit_test_api/model/oneof_with_empty_schema.py
unit_test_api/model/oneof_with_required.py
unit_test_api/model/pattern_is_not_anchored.py
unit_test_api/model/pattern_validation.py
unit_test_api/model/properties_with_escaped_characters.py
@ -313,6 +318,7 @@ unit_test_api/model/ref_in_property.py
unit_test_api/model/required_default_validation.py
unit_test_api/model/required_validation.py
unit_test_api/model/required_with_empty_array.py
unit_test_api/model/required_with_escaped_characters.py
unit_test_api/model/simple_enum_validation.py
unit_test_api/model/string_type_matches_strings.py
unit_test_api/model/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py

View File

@ -260,6 +260,8 @@ Class | Method | HTTP request | Description
*ContentTypeJsonApi* | [**post_oneof_with_base_schema_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_oneof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes |
*ContentTypeJsonApi* | [**post_oneof_with_empty_schema_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_oneof_with_empty_schema_request_body) | **post** /requestBody/postOneofWithEmptySchemaRequestBody |
*ContentTypeJsonApi* | [**post_oneof_with_empty_schema_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_oneof_with_empty_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes |
*ContentTypeJsonApi* | [**post_oneof_with_required_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_oneof_with_required_request_body) | **post** /requestBody/postOneofWithRequiredRequestBody |
*ContentTypeJsonApi* | [**post_oneof_with_required_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_oneof_with_required_response_body_for_content_types) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes |
*ContentTypeJsonApi* | [**post_pattern_is_not_anchored_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_pattern_is_not_anchored_request_body) | **post** /requestBody/postPatternIsNotAnchoredRequestBody |
*ContentTypeJsonApi* | [**post_pattern_is_not_anchored_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_pattern_is_not_anchored_response_body_for_content_types) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes |
*ContentTypeJsonApi* | [**post_pattern_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_pattern_validation_request_body) | **post** /requestBody/postPatternValidationRequestBody |
@ -286,6 +288,8 @@ Class | Method | HTTP request | Description
*ContentTypeJsonApi* | [**post_required_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_required_validation_response_body_for_content_types) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes |
*ContentTypeJsonApi* | [**post_required_with_empty_array_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_required_with_empty_array_request_body) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody |
*ContentTypeJsonApi* | [**post_required_with_empty_array_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_required_with_empty_array_response_body_for_content_types) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes |
*ContentTypeJsonApi* | [**post_required_with_escaped_characters_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_required_with_escaped_characters_request_body) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody |
*ContentTypeJsonApi* | [**post_required_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_required_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes |
*ContentTypeJsonApi* | [**post_simple_enum_validation_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_simple_enum_validation_request_body) | **post** /requestBody/postSimpleEnumValidationRequestBody |
*ContentTypeJsonApi* | [**post_simple_enum_validation_response_body_for_content_types**](docs/apis/tags/ContentTypeJsonApi.md#post_simple_enum_validation_response_body_for_content_types) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes |
*ContentTypeJsonApi* | [**post_string_type_matches_strings_request_body**](docs/apis/tags/ContentTypeJsonApi.md#post_string_type_matches_strings_request_body) | **post** /requestBody/postStringTypeMatchesStringsRequestBody |
@ -388,6 +392,8 @@ Class | Method | HTTP request | Description
*OneOfApi* | [**post_oneof_with_base_schema_response_body_for_content_types**](docs/apis/tags/OneOfApi.md#post_oneof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes |
*OneOfApi* | [**post_oneof_with_empty_schema_request_body**](docs/apis/tags/OneOfApi.md#post_oneof_with_empty_schema_request_body) | **post** /requestBody/postOneofWithEmptySchemaRequestBody |
*OneOfApi* | [**post_oneof_with_empty_schema_response_body_for_content_types**](docs/apis/tags/OneOfApi.md#post_oneof_with_empty_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes |
*OneOfApi* | [**post_oneof_with_required_request_body**](docs/apis/tags/OneOfApi.md#post_oneof_with_required_request_body) | **post** /requestBody/postOneofWithRequiredRequestBody |
*OneOfApi* | [**post_oneof_with_required_response_body_for_content_types**](docs/apis/tags/OneOfApi.md#post_oneof_with_required_response_body_for_content_types) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes |
*OperationRequestBodyApi* | [**post_additionalproperties_allows_a_schema_which_should_validate_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_additionalproperties_allows_a_schema_which_should_validate_request_body) | **post** /requestBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody |
*OperationRequestBodyApi* | [**post_additionalproperties_are_allowed_by_default_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_additionalproperties_are_allowed_by_default_request_body) | **post** /requestBody/postAdditionalpropertiesAreAllowedByDefaultRequestBody |
*OperationRequestBodyApi* | [**post_additionalproperties_can_exist_by_itself_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_additionalproperties_can_exist_by_itself_request_body) | **post** /requestBody/postAdditionalpropertiesCanExistByItselfRequestBody |
@ -451,6 +457,7 @@ Class | Method | HTTP request | Description
*OperationRequestBodyApi* | [**post_oneof_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_oneof_request_body) | **post** /requestBody/postOneofRequestBody |
*OperationRequestBodyApi* | [**post_oneof_with_base_schema_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_oneof_with_base_schema_request_body) | **post** /requestBody/postOneofWithBaseSchemaRequestBody |
*OperationRequestBodyApi* | [**post_oneof_with_empty_schema_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_oneof_with_empty_schema_request_body) | **post** /requestBody/postOneofWithEmptySchemaRequestBody |
*OperationRequestBodyApi* | [**post_oneof_with_required_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_oneof_with_required_request_body) | **post** /requestBody/postOneofWithRequiredRequestBody |
*OperationRequestBodyApi* | [**post_pattern_is_not_anchored_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_pattern_is_not_anchored_request_body) | **post** /requestBody/postPatternIsNotAnchoredRequestBody |
*OperationRequestBodyApi* | [**post_pattern_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_pattern_validation_request_body) | **post** /requestBody/postPatternValidationRequestBody |
*OperationRequestBodyApi* | [**post_properties_with_escaped_characters_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_properties_with_escaped_characters_request_body) | **post** /requestBody/postPropertiesWithEscapedCharactersRequestBody |
@ -464,6 +471,7 @@ Class | Method | HTTP request | Description
*OperationRequestBodyApi* | [**post_required_default_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_required_default_validation_request_body) | **post** /requestBody/postRequiredDefaultValidationRequestBody |
*OperationRequestBodyApi* | [**post_required_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_required_validation_request_body) | **post** /requestBody/postRequiredValidationRequestBody |
*OperationRequestBodyApi* | [**post_required_with_empty_array_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_required_with_empty_array_request_body) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody |
*OperationRequestBodyApi* | [**post_required_with_escaped_characters_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_required_with_escaped_characters_request_body) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody |
*OperationRequestBodyApi* | [**post_simple_enum_validation_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_simple_enum_validation_request_body) | **post** /requestBody/postSimpleEnumValidationRequestBody |
*OperationRequestBodyApi* | [**post_string_type_matches_strings_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_string_type_matches_strings_request_body) | **post** /requestBody/postStringTypeMatchesStringsRequestBody |
*OperationRequestBodyApi* | [**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](docs/apis/tags/OperationRequestBodyApi.md#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body) | **post** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody |
@ -598,6 +606,8 @@ Class | Method | HTTP request | Description
*PathPostApi* | [**post_oneof_with_base_schema_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_oneof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes |
*PathPostApi* | [**post_oneof_with_empty_schema_request_body**](docs/apis/tags/PathPostApi.md#post_oneof_with_empty_schema_request_body) | **post** /requestBody/postOneofWithEmptySchemaRequestBody |
*PathPostApi* | [**post_oneof_with_empty_schema_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_oneof_with_empty_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes |
*PathPostApi* | [**post_oneof_with_required_request_body**](docs/apis/tags/PathPostApi.md#post_oneof_with_required_request_body) | **post** /requestBody/postOneofWithRequiredRequestBody |
*PathPostApi* | [**post_oneof_with_required_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_oneof_with_required_response_body_for_content_types) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes |
*PathPostApi* | [**post_pattern_is_not_anchored_request_body**](docs/apis/tags/PathPostApi.md#post_pattern_is_not_anchored_request_body) | **post** /requestBody/postPatternIsNotAnchoredRequestBody |
*PathPostApi* | [**post_pattern_is_not_anchored_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_pattern_is_not_anchored_response_body_for_content_types) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes |
*PathPostApi* | [**post_pattern_validation_request_body**](docs/apis/tags/PathPostApi.md#post_pattern_validation_request_body) | **post** /requestBody/postPatternValidationRequestBody |
@ -624,6 +634,8 @@ Class | Method | HTTP request | Description
*PathPostApi* | [**post_required_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_required_validation_response_body_for_content_types) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes |
*PathPostApi* | [**post_required_with_empty_array_request_body**](docs/apis/tags/PathPostApi.md#post_required_with_empty_array_request_body) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody |
*PathPostApi* | [**post_required_with_empty_array_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_required_with_empty_array_response_body_for_content_types) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes |
*PathPostApi* | [**post_required_with_escaped_characters_request_body**](docs/apis/tags/PathPostApi.md#post_required_with_escaped_characters_request_body) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody |
*PathPostApi* | [**post_required_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_required_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes |
*PathPostApi* | [**post_simple_enum_validation_request_body**](docs/apis/tags/PathPostApi.md#post_simple_enum_validation_request_body) | **post** /requestBody/postSimpleEnumValidationRequestBody |
*PathPostApi* | [**post_simple_enum_validation_response_body_for_content_types**](docs/apis/tags/PathPostApi.md#post_simple_enum_validation_response_body_for_content_types) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes |
*PathPostApi* | [**post_string_type_matches_strings_request_body**](docs/apis/tags/PathPostApi.md#post_string_type_matches_strings_request_body) | **post** /requestBody/postStringTypeMatchesStringsRequestBody |
@ -654,6 +666,8 @@ Class | Method | HTTP request | Description
*RequiredApi* | [**post_required_validation_response_body_for_content_types**](docs/apis/tags/RequiredApi.md#post_required_validation_response_body_for_content_types) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes |
*RequiredApi* | [**post_required_with_empty_array_request_body**](docs/apis/tags/RequiredApi.md#post_required_with_empty_array_request_body) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody |
*RequiredApi* | [**post_required_with_empty_array_response_body_for_content_types**](docs/apis/tags/RequiredApi.md#post_required_with_empty_array_response_body_for_content_types) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes |
*RequiredApi* | [**post_required_with_escaped_characters_request_body**](docs/apis/tags/RequiredApi.md#post_required_with_escaped_characters_request_body) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody |
*RequiredApi* | [**post_required_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/RequiredApi.md#post_required_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes |
*ResponseContentContentTypeSchemaApi* | [**post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAllowsASchemaWhichShouldValidateResponseBodyForContentTypes |
*ResponseContentContentTypeSchemaApi* | [**post_additionalproperties_are_allowed_by_default_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_additionalproperties_are_allowed_by_default_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesAreAllowedByDefaultResponseBodyForContentTypes |
*ResponseContentContentTypeSchemaApi* | [**post_additionalproperties_can_exist_by_itself_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_additionalproperties_can_exist_by_itself_response_body_for_content_types) | **post** /responseBody/postAdditionalpropertiesCanExistByItselfResponseBodyForContentTypes |
@ -717,6 +731,7 @@ Class | Method | HTTP request | Description
*ResponseContentContentTypeSchemaApi* | [**post_oneof_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_oneof_response_body_for_content_types) | **post** /responseBody/postOneofResponseBodyForContentTypes |
*ResponseContentContentTypeSchemaApi* | [**post_oneof_with_base_schema_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_oneof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes |
*ResponseContentContentTypeSchemaApi* | [**post_oneof_with_empty_schema_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_oneof_with_empty_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes |
*ResponseContentContentTypeSchemaApi* | [**post_oneof_with_required_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_oneof_with_required_response_body_for_content_types) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes |
*ResponseContentContentTypeSchemaApi* | [**post_pattern_is_not_anchored_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_pattern_is_not_anchored_response_body_for_content_types) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes |
*ResponseContentContentTypeSchemaApi* | [**post_pattern_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_pattern_validation_response_body_for_content_types) | **post** /responseBody/postPatternValidationResponseBodyForContentTypes |
*ResponseContentContentTypeSchemaApi* | [**post_properties_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_properties_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes |
@ -730,6 +745,7 @@ Class | Method | HTTP request | Description
*ResponseContentContentTypeSchemaApi* | [**post_required_default_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_required_default_validation_response_body_for_content_types) | **post** /responseBody/postRequiredDefaultValidationResponseBodyForContentTypes |
*ResponseContentContentTypeSchemaApi* | [**post_required_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_required_validation_response_body_for_content_types) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes |
*ResponseContentContentTypeSchemaApi* | [**post_required_with_empty_array_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_required_with_empty_array_response_body_for_content_types) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes |
*ResponseContentContentTypeSchemaApi* | [**post_required_with_escaped_characters_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_required_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes |
*ResponseContentContentTypeSchemaApi* | [**post_simple_enum_validation_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_simple_enum_validation_response_body_for_content_types) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes |
*ResponseContentContentTypeSchemaApi* | [**post_string_type_matches_strings_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_string_type_matches_strings_response_body_for_content_types) | **post** /responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes |
*ResponseContentContentTypeSchemaApi* | [**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](docs/apis/tags/ResponseContentContentTypeSchemaApi.md#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types) | **post** /responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes |
@ -821,6 +837,7 @@ Class | Method | HTTP request | Description
- [OneofComplexTypes](docs/models/OneofComplexTypes.md)
- [OneofWithBaseSchema](docs/models/OneofWithBaseSchema.md)
- [OneofWithEmptySchema](docs/models/OneofWithEmptySchema.md)
- [OneofWithRequired](docs/models/OneofWithRequired.md)
- [PatternIsNotAnchored](docs/models/PatternIsNotAnchored.md)
- [PatternValidation](docs/models/PatternValidation.md)
- [PropertiesWithEscapedCharacters](docs/models/PropertiesWithEscapedCharacters.md)
@ -834,6 +851,7 @@ Class | Method | HTTP request | Description
- [RequiredDefaultValidation](docs/models/RequiredDefaultValidation.md)
- [RequiredValidation](docs/models/RequiredValidation.md)
- [RequiredWithEmptyArray](docs/models/RequiredWithEmptyArray.md)
- [RequiredWithEscapedCharacters](docs/models/RequiredWithEscapedCharacters.md)
- [SimpleEnumValidation](docs/models/SimpleEnumValidation.md)
- [StringTypeMatchesStrings](docs/models/StringTypeMatchesStrings.md)
- [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing](docs/models/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md)

View File

@ -131,6 +131,8 @@ Method | HTTP request | Description
[**post_oneof_with_base_schema_response_body_for_content_types**](#post_oneof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes |
[**post_oneof_with_empty_schema_request_body**](#post_oneof_with_empty_schema_request_body) | **post** /requestBody/postOneofWithEmptySchemaRequestBody |
[**post_oneof_with_empty_schema_response_body_for_content_types**](#post_oneof_with_empty_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes |
[**post_oneof_with_required_request_body**](#post_oneof_with_required_request_body) | **post** /requestBody/postOneofWithRequiredRequestBody |
[**post_oneof_with_required_response_body_for_content_types**](#post_oneof_with_required_response_body_for_content_types) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes |
[**post_pattern_is_not_anchored_request_body**](#post_pattern_is_not_anchored_request_body) | **post** /requestBody/postPatternIsNotAnchoredRequestBody |
[**post_pattern_is_not_anchored_response_body_for_content_types**](#post_pattern_is_not_anchored_response_body_for_content_types) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes |
[**post_pattern_validation_request_body**](#post_pattern_validation_request_body) | **post** /requestBody/postPatternValidationRequestBody |
@ -157,6 +159,8 @@ Method | HTTP request | Description
[**post_required_validation_response_body_for_content_types**](#post_required_validation_response_body_for_content_types) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes |
[**post_required_with_empty_array_request_body**](#post_required_with_empty_array_request_body) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody |
[**post_required_with_empty_array_response_body_for_content_types**](#post_required_with_empty_array_response_body_for_content_types) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes |
[**post_required_with_escaped_characters_request_body**](#post_required_with_escaped_characters_request_body) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody |
[**post_required_with_escaped_characters_response_body_for_content_types**](#post_required_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes |
[**post_simple_enum_validation_request_body**](#post_simple_enum_validation_request_body) | **post** /requestBody/postSimpleEnumValidationRequestBody |
[**post_simple_enum_validation_response_body_for_content_types**](#post_simple_enum_validation_response_body_for_content_types) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes |
[**post_string_type_matches_strings_request_body**](#post_string_type_matches_strings_request_body) | **post** /requestBody/postStringTypeMatchesStringsRequestBody |
@ -8815,6 +8819,143 @@ No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_oneof_with_required_request_body**
<a name="post_oneof_with_required_request_body"></a>
> post_oneof_with_required_request_body(oneof_with_required)
### Example
```python
import unit_test_api
from unit_test_api.apis.tags import content_type_json_api
from unit_test_api.model.oneof_with_required import OneofWithRequired
from pprint import pprint
# Defining the host is optional and defaults to https://someserver.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = unit_test_api.Configuration(
host = "https://someserver.com/v1"
)
# Enter a context with an instance of the API client
with unit_test_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = content_type_json_api.ContentTypeJsonApi(api_client)
# example passing only required values which don't have defaults set
body = OneofWithRequired()
try:
api_response = api_instance.post_oneof_with_required_request_body(
body=body,
)
except unit_test_api.ApiException as e:
print("Exception when calling ContentTypeJsonApi->post_oneof_with_required_request_body: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
body | typing.Union[SchemaForRequestBodyApplicationJson] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
### body
#### SchemaForRequestBodyApplicationJson
Type | Description | Notes
------------- | ------------- | -------------
[**OneofWithRequired**](OneofWithRequired.md) | |
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | success
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | Unset | body was not defined |
headers | Unset | headers were not defined |
void (empty response body)
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_oneof_with_required_response_body_for_content_types**
<a name="post_oneof_with_required_response_body_for_content_types"></a>
> OneofWithRequired post_oneof_with_required_response_body_for_content_types()
### Example
```python
import unit_test_api
from unit_test_api.apis.tags import content_type_json_api
from unit_test_api.model.oneof_with_required import OneofWithRequired
from pprint import pprint
# Defining the host is optional and defaults to https://someserver.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = unit_test_api.Configuration(
host = "https://someserver.com/v1"
)
# Enter a context with an instance of the API client
with unit_test_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = content_type_json_api.ContentTypeJsonApi(api_client)
# example, this endpoint has no required or optional parameters
try:
api_response = api_instance.post_oneof_with_required_response_body_for_content_types()
pprint(api_response)
except unit_test_api.ApiException as e:
print("Exception when calling ContentTypeJsonApi->post_oneof_with_required_response_body_for_content_types: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | success
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | |
headers | Unset | headers were not defined |
#### SchemaFor200ResponseBodyApplicationJson
Type | Description | Notes
------------- | ------------- | -------------
[**OneofWithRequired**](OneofWithRequired.md) | |
[**OneofWithRequired**](OneofWithRequired.md)
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_pattern_is_not_anchored_request_body**
<a name="post_pattern_is_not_anchored_request_body"></a>
> post_pattern_is_not_anchored_request_body(body)
@ -10600,6 +10741,155 @@ No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_required_with_escaped_characters_request_body**
<a name="post_required_with_escaped_characters_request_body"></a>
> post_required_with_escaped_characters_request_body(body)
### Example
```python
import unit_test_api
from unit_test_api.apis.tags import content_type_json_api
from pprint import pprint
# Defining the host is optional and defaults to https://someserver.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = unit_test_api.Configuration(
host = "https://someserver.com/v1"
)
# Enter a context with an instance of the API client
with unit_test_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = content_type_json_api.ContentTypeJsonApi(api_client)
# example passing only required values which don't have defaults set
body = None
try:
api_response = api_instance.post_required_with_escaped_characters_request_body(
body=body,
)
except unit_test_api.ApiException as e:
print("Exception when calling ContentTypeJsonApi->post_required_with_escaped_characters_request_body: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
body | typing.Union[SchemaForRequestBodyApplicationJson] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
### body
#### SchemaForRequestBodyApplicationJson
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\rbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\\bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | success
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | Unset | body was not defined |
headers | Unset | headers were not defined |
void (empty response body)
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_required_with_escaped_characters_response_body_for_content_types**
<a name="post_required_with_escaped_characters_response_body_for_content_types"></a>
> bool, date, datetime, dict, float, int, list, str, none_type post_required_with_escaped_characters_response_body_for_content_types()
### Example
```python
import unit_test_api
from unit_test_api.apis.tags import content_type_json_api
from pprint import pprint
# Defining the host is optional and defaults to https://someserver.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = unit_test_api.Configuration(
host = "https://someserver.com/v1"
)
# Enter a context with an instance of the API client
with unit_test_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = content_type_json_api.ContentTypeJsonApi(api_client)
# example, this endpoint has no required or optional parameters
try:
api_response = api_instance.post_required_with_escaped_characters_response_body_for_content_types()
pprint(api_response)
except unit_test_api.ApiException as e:
print("Exception when calling ContentTypeJsonApi->post_required_with_escaped_characters_response_body_for_content_types: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | success
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | |
headers | Unset | headers were not defined |
#### SchemaFor200ResponseBodyApplicationJson
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\rbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\\bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
**bool, date, datetime, dict, float, int, list, str, none_type**
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_simple_enum_validation_request_body**
<a name="post_simple_enum_validation_request_body"></a>
> post_simple_enum_validation_request_body(body)

View File

@ -15,6 +15,8 @@ Method | HTTP request | Description
[**post_oneof_with_base_schema_response_body_for_content_types**](#post_oneof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes |
[**post_oneof_with_empty_schema_request_body**](#post_oneof_with_empty_schema_request_body) | **post** /requestBody/postOneofWithEmptySchemaRequestBody |
[**post_oneof_with_empty_schema_response_body_for_content_types**](#post_oneof_with_empty_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes |
[**post_oneof_with_required_request_body**](#post_oneof_with_required_request_body) | **post** /requestBody/postOneofWithRequiredRequestBody |
[**post_oneof_with_required_response_body_for_content_types**](#post_oneof_with_required_response_body_for_content_types) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes |
# **post_nested_oneof_to_check_validation_semantics_request_body**
<a name="post_nested_oneof_to_check_validation_semantics_request_body"></a>
@ -701,3 +703,140 @@ No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_oneof_with_required_request_body**
<a name="post_oneof_with_required_request_body"></a>
> post_oneof_with_required_request_body(oneof_with_required)
### Example
```python
import unit_test_api
from unit_test_api.apis.tags import one_of_api
from unit_test_api.model.oneof_with_required import OneofWithRequired
from pprint import pprint
# Defining the host is optional and defaults to https://someserver.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = unit_test_api.Configuration(
host = "https://someserver.com/v1"
)
# Enter a context with an instance of the API client
with unit_test_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = one_of_api.OneOfApi(api_client)
# example passing only required values which don't have defaults set
body = OneofWithRequired()
try:
api_response = api_instance.post_oneof_with_required_request_body(
body=body,
)
except unit_test_api.ApiException as e:
print("Exception when calling OneOfApi->post_oneof_with_required_request_body: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
body | typing.Union[SchemaForRequestBodyApplicationJson] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
### body
#### SchemaForRequestBodyApplicationJson
Type | Description | Notes
------------- | ------------- | -------------
[**OneofWithRequired**](OneofWithRequired.md) | |
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | success
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | Unset | body was not defined |
headers | Unset | headers were not defined |
void (empty response body)
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_oneof_with_required_response_body_for_content_types**
<a name="post_oneof_with_required_response_body_for_content_types"></a>
> OneofWithRequired post_oneof_with_required_response_body_for_content_types()
### Example
```python
import unit_test_api
from unit_test_api.apis.tags import one_of_api
from unit_test_api.model.oneof_with_required import OneofWithRequired
from pprint import pprint
# Defining the host is optional and defaults to https://someserver.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = unit_test_api.Configuration(
host = "https://someserver.com/v1"
)
# Enter a context with an instance of the API client
with unit_test_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = one_of_api.OneOfApi(api_client)
# example, this endpoint has no required or optional parameters
try:
api_response = api_instance.post_oneof_with_required_response_body_for_content_types()
pprint(api_response)
except unit_test_api.ApiException as e:
print("Exception when calling OneOfApi->post_oneof_with_required_response_body_for_content_types: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | success
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | |
headers | Unset | headers were not defined |
#### SchemaFor200ResponseBodyApplicationJson
Type | Description | Notes
------------- | ------------- | -------------
[**OneofWithRequired**](OneofWithRequired.md) | |
[**OneofWithRequired**](OneofWithRequired.md)
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[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

@ -68,6 +68,7 @@ Method | HTTP request | Description
[**post_oneof_request_body**](#post_oneof_request_body) | **post** /requestBody/postOneofRequestBody |
[**post_oneof_with_base_schema_request_body**](#post_oneof_with_base_schema_request_body) | **post** /requestBody/postOneofWithBaseSchemaRequestBody |
[**post_oneof_with_empty_schema_request_body**](#post_oneof_with_empty_schema_request_body) | **post** /requestBody/postOneofWithEmptySchemaRequestBody |
[**post_oneof_with_required_request_body**](#post_oneof_with_required_request_body) | **post** /requestBody/postOneofWithRequiredRequestBody |
[**post_pattern_is_not_anchored_request_body**](#post_pattern_is_not_anchored_request_body) | **post** /requestBody/postPatternIsNotAnchoredRequestBody |
[**post_pattern_validation_request_body**](#post_pattern_validation_request_body) | **post** /requestBody/postPatternValidationRequestBody |
[**post_properties_with_escaped_characters_request_body**](#post_properties_with_escaped_characters_request_body) | **post** /requestBody/postPropertiesWithEscapedCharactersRequestBody |
@ -81,6 +82,7 @@ Method | HTTP request | Description
[**post_required_default_validation_request_body**](#post_required_default_validation_request_body) | **post** /requestBody/postRequiredDefaultValidationRequestBody |
[**post_required_validation_request_body**](#post_required_validation_request_body) | **post** /requestBody/postRequiredValidationRequestBody |
[**post_required_with_empty_array_request_body**](#post_required_with_empty_array_request_body) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody |
[**post_required_with_escaped_characters_request_body**](#post_required_with_escaped_characters_request_body) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody |
[**post_simple_enum_validation_request_body**](#post_simple_enum_validation_request_body) | **post** /requestBody/postSimpleEnumValidationRequestBody |
[**post_string_type_matches_strings_request_body**](#post_string_type_matches_strings_request_body) | **post** /requestBody/postStringTypeMatchesStringsRequestBody |
[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body**](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body) | **post** /requestBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody |
@ -4758,6 +4760,80 @@ body | Unset | body was not defined |
headers | Unset | headers were not defined |
void (empty response body)
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_oneof_with_required_request_body**
<a name="post_oneof_with_required_request_body"></a>
> post_oneof_with_required_request_body(oneof_with_required)
### Example
```python
import unit_test_api
from unit_test_api.apis.tags import operation_request_body_api
from unit_test_api.model.oneof_with_required import OneofWithRequired
from pprint import pprint
# Defining the host is optional and defaults to https://someserver.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = unit_test_api.Configuration(
host = "https://someserver.com/v1"
)
# Enter a context with an instance of the API client
with unit_test_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = operation_request_body_api.OperationRequestBodyApi(api_client)
# example passing only required values which don't have defaults set
body = OneofWithRequired()
try:
api_response = api_instance.post_oneof_with_required_request_body(
body=body,
)
except unit_test_api.ApiException as e:
print("Exception when calling OperationRequestBodyApi->post_oneof_with_required_request_body: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
body | typing.Union[SchemaForRequestBodyApplicationJson] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
### body
#### SchemaForRequestBodyApplicationJson
Type | Description | Notes
------------- | ------------- | -------------
[**OneofWithRequired**](OneofWithRequired.md) | |
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | success
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | Unset | body was not defined |
headers | Unset | headers were not defined |
void (empty response body)
### Authorization
@ -5724,6 +5800,86 @@ body | Unset | body was not defined |
headers | Unset | headers were not defined |
void (empty response body)
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_required_with_escaped_characters_request_body**
<a name="post_required_with_escaped_characters_request_body"></a>
> post_required_with_escaped_characters_request_body(body)
### Example
```python
import unit_test_api
from unit_test_api.apis.tags import operation_request_body_api
from pprint import pprint
# Defining the host is optional and defaults to https://someserver.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = unit_test_api.Configuration(
host = "https://someserver.com/v1"
)
# Enter a context with an instance of the API client
with unit_test_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = operation_request_body_api.OperationRequestBodyApi(api_client)
# example passing only required values which don't have defaults set
body = None
try:
api_response = api_instance.post_required_with_escaped_characters_request_body(
body=body,
)
except unit_test_api.ApiException as e:
print("Exception when calling OperationRequestBodyApi->post_required_with_escaped_characters_request_body: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
body | typing.Union[SchemaForRequestBodyApplicationJson] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
### body
#### SchemaForRequestBodyApplicationJson
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\rbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\\bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | success
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | Unset | body was not defined |
headers | Unset | headers were not defined |
void (empty response body)
### Authorization

View File

@ -131,6 +131,8 @@ Method | HTTP request | Description
[**post_oneof_with_base_schema_response_body_for_content_types**](#post_oneof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes |
[**post_oneof_with_empty_schema_request_body**](#post_oneof_with_empty_schema_request_body) | **post** /requestBody/postOneofWithEmptySchemaRequestBody |
[**post_oneof_with_empty_schema_response_body_for_content_types**](#post_oneof_with_empty_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes |
[**post_oneof_with_required_request_body**](#post_oneof_with_required_request_body) | **post** /requestBody/postOneofWithRequiredRequestBody |
[**post_oneof_with_required_response_body_for_content_types**](#post_oneof_with_required_response_body_for_content_types) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes |
[**post_pattern_is_not_anchored_request_body**](#post_pattern_is_not_anchored_request_body) | **post** /requestBody/postPatternIsNotAnchoredRequestBody |
[**post_pattern_is_not_anchored_response_body_for_content_types**](#post_pattern_is_not_anchored_response_body_for_content_types) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes |
[**post_pattern_validation_request_body**](#post_pattern_validation_request_body) | **post** /requestBody/postPatternValidationRequestBody |
@ -157,6 +159,8 @@ Method | HTTP request | Description
[**post_required_validation_response_body_for_content_types**](#post_required_validation_response_body_for_content_types) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes |
[**post_required_with_empty_array_request_body**](#post_required_with_empty_array_request_body) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody |
[**post_required_with_empty_array_response_body_for_content_types**](#post_required_with_empty_array_response_body_for_content_types) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes |
[**post_required_with_escaped_characters_request_body**](#post_required_with_escaped_characters_request_body) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody |
[**post_required_with_escaped_characters_response_body_for_content_types**](#post_required_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes |
[**post_simple_enum_validation_request_body**](#post_simple_enum_validation_request_body) | **post** /requestBody/postSimpleEnumValidationRequestBody |
[**post_simple_enum_validation_response_body_for_content_types**](#post_simple_enum_validation_response_body_for_content_types) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes |
[**post_string_type_matches_strings_request_body**](#post_string_type_matches_strings_request_body) | **post** /requestBody/postStringTypeMatchesStringsRequestBody |
@ -8815,6 +8819,143 @@ No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_oneof_with_required_request_body**
<a name="post_oneof_with_required_request_body"></a>
> post_oneof_with_required_request_body(oneof_with_required)
### Example
```python
import unit_test_api
from unit_test_api.apis.tags import path_post_api
from unit_test_api.model.oneof_with_required import OneofWithRequired
from pprint import pprint
# Defining the host is optional and defaults to https://someserver.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = unit_test_api.Configuration(
host = "https://someserver.com/v1"
)
# Enter a context with an instance of the API client
with unit_test_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = path_post_api.PathPostApi(api_client)
# example passing only required values which don't have defaults set
body = OneofWithRequired()
try:
api_response = api_instance.post_oneof_with_required_request_body(
body=body,
)
except unit_test_api.ApiException as e:
print("Exception when calling PathPostApi->post_oneof_with_required_request_body: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
body | typing.Union[SchemaForRequestBodyApplicationJson] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
### body
#### SchemaForRequestBodyApplicationJson
Type | Description | Notes
------------- | ------------- | -------------
[**OneofWithRequired**](OneofWithRequired.md) | |
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | success
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | Unset | body was not defined |
headers | Unset | headers were not defined |
void (empty response body)
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_oneof_with_required_response_body_for_content_types**
<a name="post_oneof_with_required_response_body_for_content_types"></a>
> OneofWithRequired post_oneof_with_required_response_body_for_content_types()
### Example
```python
import unit_test_api
from unit_test_api.apis.tags import path_post_api
from unit_test_api.model.oneof_with_required import OneofWithRequired
from pprint import pprint
# Defining the host is optional and defaults to https://someserver.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = unit_test_api.Configuration(
host = "https://someserver.com/v1"
)
# Enter a context with an instance of the API client
with unit_test_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = path_post_api.PathPostApi(api_client)
# example, this endpoint has no required or optional parameters
try:
api_response = api_instance.post_oneof_with_required_response_body_for_content_types()
pprint(api_response)
except unit_test_api.ApiException as e:
print("Exception when calling PathPostApi->post_oneof_with_required_response_body_for_content_types: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | success
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | |
headers | Unset | headers were not defined |
#### SchemaFor200ResponseBodyApplicationJson
Type | Description | Notes
------------- | ------------- | -------------
[**OneofWithRequired**](OneofWithRequired.md) | |
[**OneofWithRequired**](OneofWithRequired.md)
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_pattern_is_not_anchored_request_body**
<a name="post_pattern_is_not_anchored_request_body"></a>
> post_pattern_is_not_anchored_request_body(body)
@ -10600,6 +10741,155 @@ No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_required_with_escaped_characters_request_body**
<a name="post_required_with_escaped_characters_request_body"></a>
> post_required_with_escaped_characters_request_body(body)
### Example
```python
import unit_test_api
from unit_test_api.apis.tags import path_post_api
from pprint import pprint
# Defining the host is optional and defaults to https://someserver.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = unit_test_api.Configuration(
host = "https://someserver.com/v1"
)
# Enter a context with an instance of the API client
with unit_test_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = path_post_api.PathPostApi(api_client)
# example passing only required values which don't have defaults set
body = None
try:
api_response = api_instance.post_required_with_escaped_characters_request_body(
body=body,
)
except unit_test_api.ApiException as e:
print("Exception when calling PathPostApi->post_required_with_escaped_characters_request_body: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
body | typing.Union[SchemaForRequestBodyApplicationJson] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
### body
#### SchemaForRequestBodyApplicationJson
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\rbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\\bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | success
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | Unset | body was not defined |
headers | Unset | headers were not defined |
void (empty response body)
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_required_with_escaped_characters_response_body_for_content_types**
<a name="post_required_with_escaped_characters_response_body_for_content_types"></a>
> bool, date, datetime, dict, float, int, list, str, none_type post_required_with_escaped_characters_response_body_for_content_types()
### Example
```python
import unit_test_api
from unit_test_api.apis.tags import path_post_api
from pprint import pprint
# Defining the host is optional and defaults to https://someserver.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = unit_test_api.Configuration(
host = "https://someserver.com/v1"
)
# Enter a context with an instance of the API client
with unit_test_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = path_post_api.PathPostApi(api_client)
# example, this endpoint has no required or optional parameters
try:
api_response = api_instance.post_required_with_escaped_characters_response_body_for_content_types()
pprint(api_response)
except unit_test_api.ApiException as e:
print("Exception when calling PathPostApi->post_required_with_escaped_characters_response_body_for_content_types: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | success
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | |
headers | Unset | headers were not defined |
#### SchemaFor200ResponseBodyApplicationJson
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\rbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\\bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
**bool, date, datetime, dict, float, int, list, str, none_type**
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_simple_enum_validation_request_body**
<a name="post_simple_enum_validation_request_body"></a>
> post_simple_enum_validation_request_body(body)

View File

@ -11,6 +11,8 @@ Method | HTTP request | Description
[**post_required_validation_response_body_for_content_types**](#post_required_validation_response_body_for_content_types) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes |
[**post_required_with_empty_array_request_body**](#post_required_with_empty_array_request_body) | **post** /requestBody/postRequiredWithEmptyArrayRequestBody |
[**post_required_with_empty_array_response_body_for_content_types**](#post_required_with_empty_array_response_body_for_content_types) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes |
[**post_required_with_escaped_characters_request_body**](#post_required_with_escaped_characters_request_body) | **post** /requestBody/postRequiredWithEscapedCharactersRequestBody |
[**post_required_with_escaped_characters_response_body_for_content_types**](#post_required_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes |
# **post_required_default_validation_request_body**
<a name="post_required_default_validation_request_body"></a>
@ -423,3 +425,152 @@ No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_required_with_escaped_characters_request_body**
<a name="post_required_with_escaped_characters_request_body"></a>
> post_required_with_escaped_characters_request_body(body)
### Example
```python
import unit_test_api
from unit_test_api.apis.tags import required_api
from pprint import pprint
# Defining the host is optional and defaults to https://someserver.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = unit_test_api.Configuration(
host = "https://someserver.com/v1"
)
# Enter a context with an instance of the API client
with unit_test_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = required_api.RequiredApi(api_client)
# example passing only required values which don't have defaults set
body = None
try:
api_response = api_instance.post_required_with_escaped_characters_request_body(
body=body,
)
except unit_test_api.ApiException as e:
print("Exception when calling RequiredApi->post_required_with_escaped_characters_request_body: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
body | typing.Union[SchemaForRequestBodyApplicationJson] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
### body
#### SchemaForRequestBodyApplicationJson
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\rbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\\bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | success
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | Unset | body was not defined |
headers | Unset | headers were not defined |
void (empty response body)
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_required_with_escaped_characters_response_body_for_content_types**
<a name="post_required_with_escaped_characters_response_body_for_content_types"></a>
> bool, date, datetime, dict, float, int, list, str, none_type post_required_with_escaped_characters_response_body_for_content_types()
### Example
```python
import unit_test_api
from unit_test_api.apis.tags import required_api
from pprint import pprint
# Defining the host is optional and defaults to https://someserver.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = unit_test_api.Configuration(
host = "https://someserver.com/v1"
)
# Enter a context with an instance of the API client
with unit_test_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = required_api.RequiredApi(api_client)
# example, this endpoint has no required or optional parameters
try:
api_response = api_instance.post_required_with_escaped_characters_response_body_for_content_types()
pprint(api_response)
except unit_test_api.ApiException as e:
print("Exception when calling RequiredApi->post_required_with_escaped_characters_response_body_for_content_types: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | success
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | |
headers | Unset | headers were not defined |
#### SchemaFor200ResponseBodyApplicationJson
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\rbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\\bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
**bool, date, datetime, dict, float, int, list, str, none_type**
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[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

@ -68,6 +68,7 @@ Method | HTTP request | Description
[**post_oneof_response_body_for_content_types**](#post_oneof_response_body_for_content_types) | **post** /responseBody/postOneofResponseBodyForContentTypes |
[**post_oneof_with_base_schema_response_body_for_content_types**](#post_oneof_with_base_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithBaseSchemaResponseBodyForContentTypes |
[**post_oneof_with_empty_schema_response_body_for_content_types**](#post_oneof_with_empty_schema_response_body_for_content_types) | **post** /responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes |
[**post_oneof_with_required_response_body_for_content_types**](#post_oneof_with_required_response_body_for_content_types) | **post** /responseBody/postOneofWithRequiredResponseBodyForContentTypes |
[**post_pattern_is_not_anchored_response_body_for_content_types**](#post_pattern_is_not_anchored_response_body_for_content_types) | **post** /responseBody/postPatternIsNotAnchoredResponseBodyForContentTypes |
[**post_pattern_validation_response_body_for_content_types**](#post_pattern_validation_response_body_for_content_types) | **post** /responseBody/postPatternValidationResponseBodyForContentTypes |
[**post_properties_with_escaped_characters_response_body_for_content_types**](#post_properties_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postPropertiesWithEscapedCharactersResponseBodyForContentTypes |
@ -81,6 +82,7 @@ Method | HTTP request | Description
[**post_required_default_validation_response_body_for_content_types**](#post_required_default_validation_response_body_for_content_types) | **post** /responseBody/postRequiredDefaultValidationResponseBodyForContentTypes |
[**post_required_validation_response_body_for_content_types**](#post_required_validation_response_body_for_content_types) | **post** /responseBody/postRequiredValidationResponseBodyForContentTypes |
[**post_required_with_empty_array_response_body_for_content_types**](#post_required_with_empty_array_response_body_for_content_types) | **post** /responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes |
[**post_required_with_escaped_characters_response_body_for_content_types**](#post_required_with_escaped_characters_response_body_for_content_types) | **post** /responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes |
[**post_simple_enum_validation_response_body_for_content_types**](#post_simple_enum_validation_response_body_for_content_types) | **post** /responseBody/postSimpleEnumValidationResponseBodyForContentTypes |
[**post_string_type_matches_strings_response_body_for_content_types**](#post_string_type_matches_strings_response_body_for_content_types) | **post** /responseBody/postStringTypeMatchesStringsResponseBodyForContentTypes |
[**post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types**](#post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types) | **post** /responseBody/postTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes |
@ -4055,6 +4057,69 @@ No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_oneof_with_required_response_body_for_content_types**
<a name="post_oneof_with_required_response_body_for_content_types"></a>
> OneofWithRequired post_oneof_with_required_response_body_for_content_types()
### Example
```python
import unit_test_api
from unit_test_api.apis.tags import response_content_content_type_schema_api
from unit_test_api.model.oneof_with_required import OneofWithRequired
from pprint import pprint
# Defining the host is optional and defaults to https://someserver.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = unit_test_api.Configuration(
host = "https://someserver.com/v1"
)
# Enter a context with an instance of the API client
with unit_test_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client)
# example, this endpoint has no required or optional parameters
try:
api_response = api_instance.post_oneof_with_required_response_body_for_content_types()
pprint(api_response)
except unit_test_api.ApiException as e:
print("Exception when calling ResponseContentContentTypeSchemaApi->post_oneof_with_required_response_body_for_content_types: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | success
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | |
headers | Unset | headers were not defined |
#### SchemaFor200ResponseBodyApplicationJson
Type | Description | Notes
------------- | ------------- | -------------
[**OneofWithRequired**](OneofWithRequired.md) | |
[**OneofWithRequired**](OneofWithRequired.md)
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_pattern_is_not_anchored_response_body_for_content_types**
<a name="post_pattern_is_not_anchored_response_body_for_content_types"></a>
> PatternIsNotAnchored post_pattern_is_not_anchored_response_body_for_content_types()
@ -4874,6 +4939,75 @@ No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_required_with_escaped_characters_response_body_for_content_types**
<a name="post_required_with_escaped_characters_response_body_for_content_types"></a>
> bool, date, datetime, dict, float, int, list, str, none_type post_required_with_escaped_characters_response_body_for_content_types()
### Example
```python
import unit_test_api
from unit_test_api.apis.tags import response_content_content_type_schema_api
from pprint import pprint
# Defining the host is optional and defaults to https://someserver.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = unit_test_api.Configuration(
host = "https://someserver.com/v1"
)
# Enter a context with an instance of the API client
with unit_test_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = response_content_content_type_schema_api.ResponseContentContentTypeSchemaApi(api_client)
# example, this endpoint has no required or optional parameters
try:
api_response = api_instance.post_required_with_escaped_characters_response_body_for_content_types()
pprint(api_response)
except unit_test_api.ApiException as e:
print("Exception when calling ResponseContentContentTypeSchemaApi->post_required_with_escaped_characters_response_body_for_content_types: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | success
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | |
headers | Unset | headers were not defined |
#### SchemaFor200ResponseBodyApplicationJson
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\rbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\\bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
**bool, date, datetime, dict, float, int, list, str, none_type**
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **post_simple_enum_validation_response_body_for_content_types**
<a name="post_simple_enum_validation_response_body_for_content_types"></a>
> SimpleEnumValidation post_simple_enum_validation_response_body_for_content_types()

View File

@ -3,8 +3,8 @@
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**foo** | **str** | | [optional]
**bar** | **str** | |
**foo** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [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

@ -0,0 +1,9 @@
# unit_test_api.model.oneof_with_required.OneofWithRequired
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [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

@ -0,0 +1,15 @@
# unit_test_api.model.required_with_escaped_characters.RequiredWithEscapedCharacters
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**foo\"bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\nbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\fbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\tbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\rbar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**foo\\bar** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [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

@ -0,0 +1,75 @@
# coding: utf-8
"""
openapi 3.0.3 sample spec
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
"""
import unittest
import unit_test_api
from unit_test_api.model.oneof_with_required import OneofWithRequired
from unit_test_api import configuration
class TestOneofWithRequired(unittest.TestCase):
"""OneofWithRequired unit test stubs"""
_configuration = configuration.Configuration()
def test_both_valid_invalid_fails(self):
# both valid - invalid
with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)):
OneofWithRequired._from_openapi_data(
{
"foo":
1,
"bar":
2,
"baz":
3,
},
_configuration=self._configuration
)
def test_both_invalid_invalid_fails(self):
# both invalid - invalid
with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)):
OneofWithRequired._from_openapi_data(
{
"bar":
2,
},
_configuration=self._configuration
)
def test_first_valid_valid_passes(self):
# first valid - valid
OneofWithRequired._from_openapi_data(
{
"foo":
1,
"bar":
2,
},
_configuration=self._configuration
)
def test_second_valid_valid_passes(self):
# second valid - valid
OneofWithRequired._from_openapi_data(
{
"foo":
1,
"baz":
3,
},
_configuration=self._configuration
)
if __name__ == '__main__':
unittest.main()

View File

@ -0,0 +1,58 @@
# coding: utf-8
"""
openapi 3.0.3 sample spec
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
"""
import unittest
import unit_test_api
from unit_test_api.model.required_with_escaped_characters import RequiredWithEscapedCharacters
from unit_test_api import configuration
class TestRequiredWithEscapedCharacters(unittest.TestCase):
"""RequiredWithEscapedCharacters unit test stubs"""
_configuration = configuration.Configuration()
def test_object_with_some_properties_missing_is_invalid_fails(self):
# object with some properties missing is invalid
with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)):
RequiredWithEscapedCharacters._from_openapi_data(
{
"foo\nbar":
"1",
"foo\"bar":
"1",
},
_configuration=self._configuration
)
def test_object_with_all_properties_present_is_valid_passes(self):
# object with all properties present is valid
RequiredWithEscapedCharacters._from_openapi_data(
{
"foo\nbar":
1,
"foo\"bar":
1,
"foo\\bar":
1,
"foo\rbar":
1,
"foo\tbar":
1,
"foo\fbar":
1,
},
_configuration=self._configuration
)
if __name__ == '__main__':
unittest.main()

View File

@ -0,0 +1,149 @@
# coding: utf-8
"""
Generated by: https://openapi-generator.tech
"""
import unittest
from unittest.mock import patch
import urllib3
import unit_test_api
from unit_test_api.paths.request_body_post_oneof_with_required_request_body import post # noqa: E501
from unit_test_api import configuration, schemas, api_client
from .. import ApiTestMixin
class TestRequestBodyPostOneofWithRequiredRequestBody(ApiTestMixin, unittest.TestCase):
"""
RequestBodyPostOneofWithRequiredRequestBody unit test stubs
"""
_configuration = configuration.Configuration()
def setUp(self):
used_api_client = api_client.ApiClient(configuration=self._configuration)
self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501
def tearDown(self):
pass
response_status = 200
response_body = ''
def test_both_valid_invalid_fails(self):
content_type = 'application/json'
# both valid - invalid
with patch.object(urllib3.PoolManager, 'request') as mock_request:
payload = (
{
"foo":
1,
"bar":
2,
"baz":
3,
}
)
with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)):
body = post.SchemaForRequestBodyApplicationJson._from_openapi_data(
payload,
_configuration=self._configuration
)
self.api.post(body=body)
def test_both_invalid_invalid_fails(self):
content_type = 'application/json'
# both invalid - invalid
with patch.object(urllib3.PoolManager, 'request') as mock_request:
payload = (
{
"bar":
2,
}
)
with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)):
body = post.SchemaForRequestBodyApplicationJson._from_openapi_data(
payload,
_configuration=self._configuration
)
self.api.post(body=body)
def test_first_valid_valid_passes(self):
content_type = 'application/json'
# first valid - valid
with patch.object(urllib3.PoolManager, 'request') as mock_request:
payload = (
{
"foo":
1,
"bar":
2,
}
)
body = post.SchemaForRequestBodyApplicationJson._from_openapi_data(
payload,
_configuration=self._configuration
)
mock_request.return_value = self.response(
self.json_bytes(self.response_body),
status=self.response_status
)
api_response = self.api.post(
body=body,
content_type=content_type
)
self.assert_pool_manager_request_called_with(
mock_request,
self._configuration.host + '/requestBody/postOneofWithRequiredRequestBody',
method='post'.upper(),
body=self.json_bytes(payload),
content_type=content_type,
)
assert isinstance(api_response.response, urllib3.HTTPResponse)
assert isinstance(api_response.body, schemas.Unset)
def test_second_valid_valid_passes(self):
content_type = 'application/json'
# second valid - valid
with patch.object(urllib3.PoolManager, 'request') as mock_request:
payload = (
{
"foo":
1,
"baz":
3,
}
)
body = post.SchemaForRequestBodyApplicationJson._from_openapi_data(
payload,
_configuration=self._configuration
)
mock_request.return_value = self.response(
self.json_bytes(self.response_body),
status=self.response_status
)
api_response = self.api.post(
body=body,
content_type=content_type
)
self.assert_pool_manager_request_called_with(
mock_request,
self._configuration.host + '/requestBody/postOneofWithRequiredRequestBody',
method='post'.upper(),
body=self.json_bytes(payload),
content_type=content_type,
)
assert isinstance(api_response.response, urllib3.HTTPResponse)
assert isinstance(api_response.body, schemas.Unset)
if __name__ == '__main__':
unittest.main()

View File

@ -0,0 +1,103 @@
# coding: utf-8
"""
Generated by: https://openapi-generator.tech
"""
import unittest
from unittest.mock import patch
import urllib3
import unit_test_api
from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body import post # noqa: E501
from unit_test_api import configuration, schemas, api_client
from .. import ApiTestMixin
class TestRequestBodyPostRequiredWithEscapedCharactersRequestBody(ApiTestMixin, unittest.TestCase):
"""
RequestBodyPostRequiredWithEscapedCharactersRequestBody unit test stubs
"""
_configuration = configuration.Configuration()
def setUp(self):
used_api_client = api_client.ApiClient(configuration=self._configuration)
self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501
def tearDown(self):
pass
response_status = 200
response_body = ''
def test_object_with_some_properties_missing_is_invalid_fails(self):
content_type = 'application/json'
# object with some properties missing is invalid
with patch.object(urllib3.PoolManager, 'request') as mock_request:
payload = (
{
"foo\nbar":
"1",
"foo\"bar":
"1",
}
)
with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)):
body = post.SchemaForRequestBodyApplicationJson._from_openapi_data(
payload,
_configuration=self._configuration
)
self.api.post(body=body)
def test_object_with_all_properties_present_is_valid_passes(self):
content_type = 'application/json'
# object with all properties present is valid
with patch.object(urllib3.PoolManager, 'request') as mock_request:
payload = (
{
"foo\nbar":
1,
"foo\"bar":
1,
"foo\\bar":
1,
"foo\rbar":
1,
"foo\tbar":
1,
"foo\fbar":
1,
}
)
body = post.SchemaForRequestBodyApplicationJson._from_openapi_data(
payload,
_configuration=self._configuration
)
mock_request.return_value = self.response(
self.json_bytes(self.response_body),
status=self.response_status
)
api_response = self.api.post(
body=body,
content_type=content_type
)
self.assert_pool_manager_request_called_with(
mock_request,
self._configuration.host + '/requestBody/postRequiredWithEscapedCharactersRequestBody',
method='post'.upper(),
body=self.json_bytes(payload),
content_type=content_type,
)
assert isinstance(api_response.response, urllib3.HTTPResponse)
assert isinstance(api_response.body, schemas.Unset)
if __name__ == '__main__':
unittest.main()

View File

@ -0,0 +1,168 @@
# coding: utf-8
"""
Generated by: https://openapi-generator.tech
"""
import unittest
from unittest.mock import patch
import urllib3
import unit_test_api
from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types import post # noqa: E501
from unit_test_api import configuration, schemas, api_client
from .. import ApiTestMixin
class TestResponseBodyPostOneofWithRequiredResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase):
"""
ResponseBodyPostOneofWithRequiredResponseBodyForContentTypes unit test stubs
"""
_configuration = configuration.Configuration()
def setUp(self):
used_api_client = api_client.ApiClient(configuration=self._configuration)
self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501
def tearDown(self):
pass
response_status = 200
def test_both_valid_invalid_fails(self):
# both valid - invalid
accept_content_type = 'application/json'
with patch.object(urllib3.PoolManager, 'request') as mock_request:
payload = (
{
"foo":
1,
"bar":
2,
"baz":
3,
}
)
mock_request.return_value = self.response(
self.json_bytes(payload),
status=self.response_status
)
with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)):
self.api.post(
accept_content_types=(accept_content_type,)
)
self.assert_pool_manager_request_called_with(
mock_request,
self._configuration.host + '/responseBody/postOneofWithRequiredResponseBodyForContentTypes',
method='post'.upper(),
content_type=None,
accept_content_type=accept_content_type,
)
def test_both_invalid_invalid_fails(self):
# both invalid - invalid
accept_content_type = 'application/json'
with patch.object(urllib3.PoolManager, 'request') as mock_request:
payload = (
{
"bar":
2,
}
)
mock_request.return_value = self.response(
self.json_bytes(payload),
status=self.response_status
)
with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)):
self.api.post(
accept_content_types=(accept_content_type,)
)
self.assert_pool_manager_request_called_with(
mock_request,
self._configuration.host + '/responseBody/postOneofWithRequiredResponseBodyForContentTypes',
method='post'.upper(),
content_type=None,
accept_content_type=accept_content_type,
)
def test_first_valid_valid_passes(self):
# first valid - valid
accept_content_type = 'application/json'
with patch.object(urllib3.PoolManager, 'request') as mock_request:
payload = (
{
"foo":
1,
"bar":
2,
}
)
mock_request.return_value = self.response(
self.json_bytes(payload),
status=self.response_status
)
api_response = self.api.post(
accept_content_types=(accept_content_type,)
)
self.assert_pool_manager_request_called_with(
mock_request,
self._configuration.host + '/responseBody/postOneofWithRequiredResponseBodyForContentTypes',
method='post'.upper(),
accept_content_type=accept_content_type,
)
assert isinstance(api_response.response, urllib3.HTTPResponse)
assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson)
deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson._from_openapi_data(
payload,
_configuration=self._configuration
)
assert api_response.body == deserialized_response_body
def test_second_valid_valid_passes(self):
# second valid - valid
accept_content_type = 'application/json'
with patch.object(urllib3.PoolManager, 'request') as mock_request:
payload = (
{
"foo":
1,
"baz":
3,
}
)
mock_request.return_value = self.response(
self.json_bytes(payload),
status=self.response_status
)
api_response = self.api.post(
accept_content_types=(accept_content_type,)
)
self.assert_pool_manager_request_called_with(
mock_request,
self._configuration.host + '/responseBody/postOneofWithRequiredResponseBodyForContentTypes',
method='post'.upper(),
accept_content_type=accept_content_type,
)
assert isinstance(api_response.response, urllib3.HTTPResponse)
assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson)
deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson._from_openapi_data(
payload,
_configuration=self._configuration
)
assert api_response.body == deserialized_response_body
if __name__ == '__main__':
unittest.main()

View File

@ -0,0 +1,112 @@
# coding: utf-8
"""
Generated by: https://openapi-generator.tech
"""
import unittest
from unittest.mock import patch
import urllib3
import unit_test_api
from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types import post # noqa: E501
from unit_test_api import configuration, schemas, api_client
from .. import ApiTestMixin
class TestResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes(ApiTestMixin, unittest.TestCase):
"""
ResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes unit test stubs
"""
_configuration = configuration.Configuration()
def setUp(self):
used_api_client = api_client.ApiClient(configuration=self._configuration)
self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501
def tearDown(self):
pass
response_status = 200
def test_object_with_some_properties_missing_is_invalid_fails(self):
# object with some properties missing is invalid
accept_content_type = 'application/json'
with patch.object(urllib3.PoolManager, 'request') as mock_request:
payload = (
{
"foo\nbar":
"1",
"foo\"bar":
"1",
}
)
mock_request.return_value = self.response(
self.json_bytes(payload),
status=self.response_status
)
with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)):
self.api.post(
accept_content_types=(accept_content_type,)
)
self.assert_pool_manager_request_called_with(
mock_request,
self._configuration.host + '/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes',
method='post'.upper(),
content_type=None,
accept_content_type=accept_content_type,
)
def test_object_with_all_properties_present_is_valid_passes(self):
# object with all properties present is valid
accept_content_type = 'application/json'
with patch.object(urllib3.PoolManager, 'request') as mock_request:
payload = (
{
"foo\nbar":
1,
"foo\"bar":
1,
"foo\\bar":
1,
"foo\rbar":
1,
"foo\tbar":
1,
"foo\fbar":
1,
}
)
mock_request.return_value = self.response(
self.json_bytes(payload),
status=self.response_status
)
api_response = self.api.post(
accept_content_types=(accept_content_type,)
)
self.assert_pool_manager_request_called_with(
mock_request,
self._configuration.host + '/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes',
method='post'.upper(),
accept_content_type=accept_content_type,
)
assert isinstance(api_response.response, urllib3.HTTPResponse)
assert isinstance(api_response.body, post.SchemaFor200ResponseBodyApplicationJson)
deserialized_response_body = post.SchemaFor200ResponseBodyApplicationJson._from_openapi_data(
payload,
_configuration=self._configuration
)
assert api_response.body == deserialized_response_body
if __name__ == '__main__':
unittest.main()

View File

@ -121,6 +121,8 @@ from unit_test_api.apis.paths.request_body_post_oneof_complex_types_request_body
from unit_test_api.apis.paths.response_body_post_oneof_complex_types_response_body_for_content_types import ResponseBodyPostOneofComplexTypesResponseBodyForContentTypes
from unit_test_api.apis.paths.request_body_post_oneof_with_empty_schema_request_body import RequestBodyPostOneofWithEmptySchemaRequestBody
from unit_test_api.apis.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types import ResponseBodyPostOneofWithEmptySchemaResponseBodyForContentTypes
from unit_test_api.apis.paths.request_body_post_oneof_with_required_request_body import RequestBodyPostOneofWithRequiredRequestBody
from unit_test_api.apis.paths.response_body_post_oneof_with_required_response_body_for_content_types import ResponseBodyPostOneofWithRequiredResponseBodyForContentTypes
from unit_test_api.apis.paths.request_body_post_nested_oneof_to_check_validation_semantics_request_body import RequestBodyPostNestedOneofToCheckValidationSemanticsRequestBody
from unit_test_api.apis.paths.response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types import ResponseBodyPostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes
from unit_test_api.apis.paths.request_body_post_pattern_validation_request_body import RequestBodyPostPatternValidationRequestBody
@ -151,6 +153,8 @@ from unit_test_api.apis.paths.request_body_post_required_default_validation_requ
from unit_test_api.apis.paths.response_body_post_required_default_validation_response_body_for_content_types import ResponseBodyPostRequiredDefaultValidationResponseBodyForContentTypes
from unit_test_api.apis.paths.request_body_post_required_with_empty_array_request_body import RequestBodyPostRequiredWithEmptyArrayRequestBody
from unit_test_api.apis.paths.response_body_post_required_with_empty_array_response_body_for_content_types import ResponseBodyPostRequiredWithEmptyArrayResponseBodyForContentTypes
from unit_test_api.apis.paths.request_body_post_required_with_escaped_characters_request_body import RequestBodyPostRequiredWithEscapedCharactersRequestBody
from unit_test_api.apis.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types import ResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes
from unit_test_api.apis.paths.request_body_post_integer_type_matches_integers_request_body import RequestBodyPostIntegerTypeMatchesIntegersRequestBody
from unit_test_api.apis.paths.response_body_post_integer_type_matches_integers_response_body_for_content_types import ResponseBodyPostIntegerTypeMatchesIntegersResponseBodyForContentTypes
from unit_test_api.apis.paths.request_body_post_number_type_matches_numbers_request_body import RequestBodyPostNumberTypeMatchesNumbersRequestBody
@ -293,6 +297,8 @@ PathToApi = typing.TypedDict(
PathValues.RESPONSE_BODY_POST_ONEOF_COMPLEX_TYPES_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostOneofComplexTypesResponseBodyForContentTypes,
PathValues.REQUEST_BODY_POST_ONEOF_WITH_EMPTY_SCHEMA_REQUEST_BODY: RequestBodyPostOneofWithEmptySchemaRequestBody,
PathValues.RESPONSE_BODY_POST_ONEOF_WITH_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostOneofWithEmptySchemaResponseBodyForContentTypes,
PathValues.REQUEST_BODY_POST_ONEOF_WITH_REQUIRED_REQUEST_BODY: RequestBodyPostOneofWithRequiredRequestBody,
PathValues.RESPONSE_BODY_POST_ONEOF_WITH_REQUIRED_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostOneofWithRequiredResponseBodyForContentTypes,
PathValues.REQUEST_BODY_POST_NESTED_ONEOF_TO_CHECK_VALIDATION_SEMANTICS_REQUEST_BODY: RequestBodyPostNestedOneofToCheckValidationSemanticsRequestBody,
PathValues.RESPONSE_BODY_POST_NESTED_ONEOF_TO_CHECK_VALIDATION_SEMANTICS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes,
PathValues.REQUEST_BODY_POST_PATTERN_VALIDATION_REQUEST_BODY: RequestBodyPostPatternValidationRequestBody,
@ -323,6 +329,8 @@ PathToApi = typing.TypedDict(
PathValues.RESPONSE_BODY_POST_REQUIRED_DEFAULT_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRequiredDefaultValidationResponseBodyForContentTypes,
PathValues.REQUEST_BODY_POST_REQUIRED_WITH_EMPTY_ARRAY_REQUEST_BODY: RequestBodyPostRequiredWithEmptyArrayRequestBody,
PathValues.RESPONSE_BODY_POST_REQUIRED_WITH_EMPTY_ARRAY_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRequiredWithEmptyArrayResponseBodyForContentTypes,
PathValues.REQUEST_BODY_POST_REQUIRED_WITH_ESCAPED_CHARACTERS_REQUEST_BODY: RequestBodyPostRequiredWithEscapedCharactersRequestBody,
PathValues.RESPONSE_BODY_POST_REQUIRED_WITH_ESCAPED_CHARACTERS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes,
PathValues.REQUEST_BODY_POST_INTEGER_TYPE_MATCHES_INTEGERS_REQUEST_BODY: RequestBodyPostIntegerTypeMatchesIntegersRequestBody,
PathValues.RESPONSE_BODY_POST_INTEGER_TYPE_MATCHES_INTEGERS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostIntegerTypeMatchesIntegersResponseBodyForContentTypes,
PathValues.REQUEST_BODY_POST_NUMBER_TYPE_MATCHES_NUMBERS_REQUEST_BODY: RequestBodyPostNumberTypeMatchesNumbersRequestBody,
@ -466,6 +474,8 @@ path_to_api = PathToApi(
PathValues.RESPONSE_BODY_POST_ONEOF_COMPLEX_TYPES_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostOneofComplexTypesResponseBodyForContentTypes,
PathValues.REQUEST_BODY_POST_ONEOF_WITH_EMPTY_SCHEMA_REQUEST_BODY: RequestBodyPostOneofWithEmptySchemaRequestBody,
PathValues.RESPONSE_BODY_POST_ONEOF_WITH_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostOneofWithEmptySchemaResponseBodyForContentTypes,
PathValues.REQUEST_BODY_POST_ONEOF_WITH_REQUIRED_REQUEST_BODY: RequestBodyPostOneofWithRequiredRequestBody,
PathValues.RESPONSE_BODY_POST_ONEOF_WITH_REQUIRED_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostOneofWithRequiredResponseBodyForContentTypes,
PathValues.REQUEST_BODY_POST_NESTED_ONEOF_TO_CHECK_VALIDATION_SEMANTICS_REQUEST_BODY: RequestBodyPostNestedOneofToCheckValidationSemanticsRequestBody,
PathValues.RESPONSE_BODY_POST_NESTED_ONEOF_TO_CHECK_VALIDATION_SEMANTICS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes,
PathValues.REQUEST_BODY_POST_PATTERN_VALIDATION_REQUEST_BODY: RequestBodyPostPatternValidationRequestBody,
@ -496,6 +506,8 @@ path_to_api = PathToApi(
PathValues.RESPONSE_BODY_POST_REQUIRED_DEFAULT_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRequiredDefaultValidationResponseBodyForContentTypes,
PathValues.REQUEST_BODY_POST_REQUIRED_WITH_EMPTY_ARRAY_REQUEST_BODY: RequestBodyPostRequiredWithEmptyArrayRequestBody,
PathValues.RESPONSE_BODY_POST_REQUIRED_WITH_EMPTY_ARRAY_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRequiredWithEmptyArrayResponseBodyForContentTypes,
PathValues.REQUEST_BODY_POST_REQUIRED_WITH_ESCAPED_CHARACTERS_REQUEST_BODY: RequestBodyPostRequiredWithEscapedCharactersRequestBody,
PathValues.RESPONSE_BODY_POST_REQUIRED_WITH_ESCAPED_CHARACTERS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes,
PathValues.REQUEST_BODY_POST_INTEGER_TYPE_MATCHES_INTEGERS_REQUEST_BODY: RequestBodyPostIntegerTypeMatchesIntegersRequestBody,
PathValues.RESPONSE_BODY_POST_INTEGER_TYPE_MATCHES_INTEGERS_RESPONSE_BODY_FOR_CONTENT_TYPES: ResponseBodyPostIntegerTypeMatchesIntegersResponseBodyForContentTypes,
PathValues.REQUEST_BODY_POST_NUMBER_TYPE_MATCHES_NUMBERS_REQUEST_BODY: RequestBodyPostNumberTypeMatchesNumbersRequestBody,

View File

@ -0,0 +1,7 @@
from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post import ApiForpost
class RequestBodyPostOneofWithRequiredRequestBody(
ApiForpost,
):
pass

View File

@ -0,0 +1,7 @@
from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post import ApiForpost
class RequestBodyPostRequiredWithEscapedCharactersRequestBody(
ApiForpost,
):
pass

View File

@ -0,0 +1,7 @@
from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post import ApiForpost
class ResponseBodyPostOneofWithRequiredResponseBodyForContentTypes(
ApiForpost,
):
pass

View File

@ -0,0 +1,7 @@
from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post import ApiForpost
class ResponseBodyPostRequiredWithEscapedCharactersResponseBodyForContentTypes(
ApiForpost,
):
pass

View File

@ -135,6 +135,8 @@ from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.p
from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.post import PostOneofWithBaseSchemaResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.post import PostOneofWithEmptySchemaRequestBody
from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.post import PostOneofWithEmptySchemaResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post import PostOneofWithRequiredRequestBody
from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post import PostOneofWithRequiredResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body.post import PostPatternIsNotAnchoredRequestBody
from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types.post import PostPatternIsNotAnchoredResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_pattern_validation_request_body.post import PostPatternValidationRequestBody
@ -161,6 +163,8 @@ from unit_test_api.paths.request_body_post_required_validation_request_body.post
from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.post import PostRequiredValidationResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_required_with_empty_array_request_body.post import PostRequiredWithEmptyArrayRequestBody
from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.post import PostRequiredWithEmptyArrayResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post import PostRequiredWithEscapedCharactersRequestBody
from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post import PostRequiredWithEscapedCharactersResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_simple_enum_validation_request_body.post import PostSimpleEnumValidationRequestBody
from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types.post import PostSimpleEnumValidationResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body.post import PostStringTypeMatchesStringsRequestBody
@ -306,6 +310,8 @@ class ContentTypeJsonApi(
PostOneofWithBaseSchemaResponseBodyForContentTypes,
PostOneofWithEmptySchemaRequestBody,
PostOneofWithEmptySchemaResponseBodyForContentTypes,
PostOneofWithRequiredRequestBody,
PostOneofWithRequiredResponseBodyForContentTypes,
PostPatternIsNotAnchoredRequestBody,
PostPatternIsNotAnchoredResponseBodyForContentTypes,
PostPatternValidationRequestBody,
@ -332,6 +338,8 @@ class ContentTypeJsonApi(
PostRequiredValidationResponseBodyForContentTypes,
PostRequiredWithEmptyArrayRequestBody,
PostRequiredWithEmptyArrayResponseBodyForContentTypes,
PostRequiredWithEscapedCharactersRequestBody,
PostRequiredWithEscapedCharactersResponseBodyForContentTypes,
PostSimpleEnumValidationRequestBody,
PostSimpleEnumValidationResponseBodyForContentTypes,
PostStringTypeMatchesStringsRequestBody,

View File

@ -19,6 +19,8 @@ from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.p
from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.post import PostOneofWithBaseSchemaResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.post import PostOneofWithEmptySchemaRequestBody
from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.post import PostOneofWithEmptySchemaResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post import PostOneofWithRequiredRequestBody
from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post import PostOneofWithRequiredResponseBodyForContentTypes
class OneOfApi(
@ -32,6 +34,8 @@ class OneOfApi(
PostOneofWithBaseSchemaResponseBodyForContentTypes,
PostOneofWithEmptySchemaRequestBody,
PostOneofWithEmptySchemaResponseBodyForContentTypes,
PostOneofWithRequiredRequestBody,
PostOneofWithRequiredResponseBodyForContentTypes,
):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech

View File

@ -72,6 +72,7 @@ from unit_test_api.paths.request_body_post_oneof_complex_types_request_body.post
from unit_test_api.paths.request_body_post_oneof_request_body.post import PostOneofRequestBody
from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.post import PostOneofWithBaseSchemaRequestBody
from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.post import PostOneofWithEmptySchemaRequestBody
from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post import PostOneofWithRequiredRequestBody
from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body.post import PostPatternIsNotAnchoredRequestBody
from unit_test_api.paths.request_body_post_pattern_validation_request_body.post import PostPatternValidationRequestBody
from unit_test_api.paths.request_body_post_properties_with_escaped_characters_request_body.post import PostPropertiesWithEscapedCharactersRequestBody
@ -85,6 +86,7 @@ from unit_test_api.paths.request_body_post_ref_in_property_request_body.post imp
from unit_test_api.paths.request_body_post_required_default_validation_request_body.post import PostRequiredDefaultValidationRequestBody
from unit_test_api.paths.request_body_post_required_validation_request_body.post import PostRequiredValidationRequestBody
from unit_test_api.paths.request_body_post_required_with_empty_array_request_body.post import PostRequiredWithEmptyArrayRequestBody
from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post import PostRequiredWithEscapedCharactersRequestBody
from unit_test_api.paths.request_body_post_simple_enum_validation_request_body.post import PostSimpleEnumValidationRequestBody
from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body.post import PostStringTypeMatchesStringsRequestBody
from unit_test_api.paths.request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body.post import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody
@ -159,6 +161,7 @@ class OperationRequestBodyApi(
PostOneofRequestBody,
PostOneofWithBaseSchemaRequestBody,
PostOneofWithEmptySchemaRequestBody,
PostOneofWithRequiredRequestBody,
PostPatternIsNotAnchoredRequestBody,
PostPatternValidationRequestBody,
PostPropertiesWithEscapedCharactersRequestBody,
@ -172,6 +175,7 @@ class OperationRequestBodyApi(
PostRequiredDefaultValidationRequestBody,
PostRequiredValidationRequestBody,
PostRequiredWithEmptyArrayRequestBody,
PostRequiredWithEscapedCharactersRequestBody,
PostSimpleEnumValidationRequestBody,
PostStringTypeMatchesStringsRequestBody,
PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingRequestBody,

View File

@ -135,6 +135,8 @@ from unit_test_api.paths.request_body_post_oneof_with_base_schema_request_body.p
from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.post import PostOneofWithBaseSchemaResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_oneof_with_empty_schema_request_body.post import PostOneofWithEmptySchemaRequestBody
from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.post import PostOneofWithEmptySchemaResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_oneof_with_required_request_body.post import PostOneofWithRequiredRequestBody
from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post import PostOneofWithRequiredResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_pattern_is_not_anchored_request_body.post import PostPatternIsNotAnchoredRequestBody
from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types.post import PostPatternIsNotAnchoredResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_pattern_validation_request_body.post import PostPatternValidationRequestBody
@ -161,6 +163,8 @@ from unit_test_api.paths.request_body_post_required_validation_request_body.post
from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.post import PostRequiredValidationResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_required_with_empty_array_request_body.post import PostRequiredWithEmptyArrayRequestBody
from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.post import PostRequiredWithEmptyArrayResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post import PostRequiredWithEscapedCharactersRequestBody
from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post import PostRequiredWithEscapedCharactersResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_simple_enum_validation_request_body.post import PostSimpleEnumValidationRequestBody
from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types.post import PostSimpleEnumValidationResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_string_type_matches_strings_request_body.post import PostStringTypeMatchesStringsRequestBody
@ -306,6 +310,8 @@ class PathPostApi(
PostOneofWithBaseSchemaResponseBodyForContentTypes,
PostOneofWithEmptySchemaRequestBody,
PostOneofWithEmptySchemaResponseBodyForContentTypes,
PostOneofWithRequiredRequestBody,
PostOneofWithRequiredResponseBodyForContentTypes,
PostPatternIsNotAnchoredRequestBody,
PostPatternIsNotAnchoredResponseBodyForContentTypes,
PostPatternValidationRequestBody,
@ -332,6 +338,8 @@ class PathPostApi(
PostRequiredValidationResponseBodyForContentTypes,
PostRequiredWithEmptyArrayRequestBody,
PostRequiredWithEmptyArrayResponseBodyForContentTypes,
PostRequiredWithEscapedCharactersRequestBody,
PostRequiredWithEscapedCharactersResponseBodyForContentTypes,
PostSimpleEnumValidationRequestBody,
PostSimpleEnumValidationResponseBodyForContentTypes,
PostStringTypeMatchesStringsRequestBody,

View File

@ -15,6 +15,8 @@ from unit_test_api.paths.request_body_post_required_validation_request_body.post
from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.post import PostRequiredValidationResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_required_with_empty_array_request_body.post import PostRequiredWithEmptyArrayRequestBody
from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.post import PostRequiredWithEmptyArrayResponseBodyForContentTypes
from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body.post import PostRequiredWithEscapedCharactersRequestBody
from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post import PostRequiredWithEscapedCharactersResponseBodyForContentTypes
class RequiredApi(
@ -24,6 +26,8 @@ class RequiredApi(
PostRequiredValidationResponseBodyForContentTypes,
PostRequiredWithEmptyArrayRequestBody,
PostRequiredWithEmptyArrayResponseBodyForContentTypes,
PostRequiredWithEscapedCharactersRequestBody,
PostRequiredWithEscapedCharactersResponseBodyForContentTypes,
):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech

View File

@ -72,6 +72,7 @@ from unit_test_api.paths.response_body_post_oneof_complex_types_response_body_fo
from unit_test_api.paths.response_body_post_oneof_response_body_for_content_types.post import PostOneofResponseBodyForContentTypes
from unit_test_api.paths.response_body_post_oneof_with_base_schema_response_body_for_content_types.post import PostOneofWithBaseSchemaResponseBodyForContentTypes
from unit_test_api.paths.response_body_post_oneof_with_empty_schema_response_body_for_content_types.post import PostOneofWithEmptySchemaResponseBodyForContentTypes
from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types.post import PostOneofWithRequiredResponseBodyForContentTypes
from unit_test_api.paths.response_body_post_pattern_is_not_anchored_response_body_for_content_types.post import PostPatternIsNotAnchoredResponseBodyForContentTypes
from unit_test_api.paths.response_body_post_pattern_validation_response_body_for_content_types.post import PostPatternValidationResponseBodyForContentTypes
from unit_test_api.paths.response_body_post_properties_with_escaped_characters_response_body_for_content_types.post import PostPropertiesWithEscapedCharactersResponseBodyForContentTypes
@ -85,6 +86,7 @@ from unit_test_api.paths.response_body_post_ref_in_property_response_body_for_co
from unit_test_api.paths.response_body_post_required_default_validation_response_body_for_content_types.post import PostRequiredDefaultValidationResponseBodyForContentTypes
from unit_test_api.paths.response_body_post_required_validation_response_body_for_content_types.post import PostRequiredValidationResponseBodyForContentTypes
from unit_test_api.paths.response_body_post_required_with_empty_array_response_body_for_content_types.post import PostRequiredWithEmptyArrayResponseBodyForContentTypes
from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types.post import PostRequiredWithEscapedCharactersResponseBodyForContentTypes
from unit_test_api.paths.response_body_post_simple_enum_validation_response_body_for_content_types.post import PostSimpleEnumValidationResponseBodyForContentTypes
from unit_test_api.paths.response_body_post_string_type_matches_strings_response_body_for_content_types.post import PostStringTypeMatchesStringsResponseBodyForContentTypes
from unit_test_api.paths.response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types.post import PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes
@ -159,6 +161,7 @@ class ResponseContentContentTypeSchemaApi(
PostOneofResponseBodyForContentTypes,
PostOneofWithBaseSchemaResponseBodyForContentTypes,
PostOneofWithEmptySchemaResponseBodyForContentTypes,
PostOneofWithRequiredResponseBodyForContentTypes,
PostPatternIsNotAnchoredResponseBodyForContentTypes,
PostPatternValidationResponseBodyForContentTypes,
PostPropertiesWithEscapedCharactersResponseBodyForContentTypes,
@ -172,6 +175,7 @@ class ResponseContentContentTypeSchemaApi(
PostRequiredDefaultValidationResponseBodyForContentTypes,
PostRequiredValidationResponseBodyForContentTypes,
PostRequiredWithEmptyArrayResponseBodyForContentTypes,
PostRequiredWithEscapedCharactersResponseBodyForContentTypes,
PostSimpleEnumValidationResponseBodyForContentTypes,
PostStringTypeMatchesStringsResponseBodyForContentTypes,
PostTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingResponseBodyForContentTypes,

View File

@ -93,9 +93,9 @@ class Allof(
class allOf_0(
AnyTypeSchema
):
_required_property_names = set((
'bar',
))
_required_property_names = {
"bar",
}
bar = IntSchema
def __new__(
@ -117,9 +117,9 @@ class Allof(
class allOf_1(
AnyTypeSchema
):
_required_property_names = set((
'foo',
))
_required_property_names = {
"foo",
}
foo = StrSchema
def __new__(

View File

@ -76,9 +76,9 @@ class AllofWithBaseSchema(
Do not edit the class manually.
"""
_required_property_names = set((
'bar',
))
_required_property_names = {
"bar",
}
bar = IntSchema
@classmethod
@ -97,9 +97,9 @@ class AllofWithBaseSchema(
class allOf_0(
AnyTypeSchema
):
_required_property_names = set((
'foo',
))
_required_property_names = {
"foo",
}
foo = StrSchema
def __new__(
@ -121,9 +121,9 @@ class AllofWithBaseSchema(
class allOf_1(
AnyTypeSchema
):
_required_property_names = set((
'baz',
))
_required_property_names = {
"baz",
}
baz = NoneSchema
def __new__(

View File

@ -93,9 +93,9 @@ class AnyofComplexTypes(
class anyOf_0(
AnyTypeSchema
):
_required_property_names = set((
'bar',
))
_required_property_names = {
"bar",
}
bar = IntSchema
def __new__(
@ -117,9 +117,9 @@ class AnyofComplexTypes(
class anyOf_1(
AnyTypeSchema
):
_required_property_names = set((
'foo',
))
_required_property_names = {
"foo",
}
foo = StrSchema
def __new__(

View File

@ -76,9 +76,9 @@ class EnumsInProperties(
Do not edit the class manually.
"""
_required_property_names = set((
'bar',
))
_required_property_names = {
"bar",
}
class foo(

View File

@ -93,9 +93,9 @@ class OneofComplexTypes(
class oneOf_0(
AnyTypeSchema
):
_required_property_names = set((
'bar',
))
_required_property_names = {
"bar",
}
bar = IntSchema
def __new__(
@ -117,9 +117,9 @@ class OneofComplexTypes(
class oneOf_1(
AnyTypeSchema
):
_required_property_names = set((
'foo',
))
_required_property_names = {
"foo",
}
foo = StrSchema
def __new__(

View File

@ -0,0 +1,160 @@
# coding: utf-8
"""
openapi 3.0.3 sample spec
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
import typing # noqa: F401
import functools # noqa: F401
from frozendict import frozendict # noqa: F401
import decimal # noqa: F401
from datetime import date, datetime # noqa: F401
from frozendict import frozendict # noqa: F401
from unit_test_api.schemas import ( # noqa: F401
AnyTypeSchema,
ComposedSchema,
DictSchema,
ListSchema,
StrSchema,
IntSchema,
Int32Schema,
Int64Schema,
Float32Schema,
Float64Schema,
NumberSchema,
UUIDSchema,
DateSchema,
DateTimeSchema,
DecimalSchema,
BoolSchema,
BinarySchema,
NoneSchema,
none_type,
Configuration,
Unset,
unset,
ComposedBase,
ListBase,
DictBase,
NoneBase,
StrBase,
IntBase,
Int32Base,
Int64Base,
Float32Base,
Float64Base,
NumberBase,
UUIDBase,
DateBase,
DateTimeBase,
BoolBase,
BinaryBase,
Schema,
NoneClass,
BoolClass,
_SchemaValidator,
_SchemaTypeChecker,
_SchemaEnumMaker
)
class OneofWithRequired(
ComposedBase,
DictSchema
):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
@classmethod
@property
@functools.cache
def _composed_schemas(cls):
# we need this here to make our import statements work
# we must store _composed_schemas in here so the code is only run
# when we invoke this method. If we kept this at the class
# level we would get an error because the class level
# code would be run when this module is imported, and these composed
# classes don't exist yet because their module has not finished
# loading
class oneOf_0(
AnyTypeSchema
):
_required_property_names = {
"bar",
"foo",
}
def __new__(
cls,
*args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes],
_configuration: typing.Optional[Configuration] = None,
**kwargs: typing.Type[Schema],
) -> 'oneOf_0':
return super().__new__(
cls,
*args,
_configuration=_configuration,
**kwargs,
)
class oneOf_1(
AnyTypeSchema
):
_required_property_names = {
"foo",
"baz",
}
def __new__(
cls,
*args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes],
_configuration: typing.Optional[Configuration] = None,
**kwargs: typing.Type[Schema],
) -> 'oneOf_1':
return super().__new__(
cls,
*args,
_configuration=_configuration,
**kwargs,
)
return {
'allOf': [
],
'oneOf': [
oneOf_0,
oneOf_1,
],
'anyOf': [
],
'not':
None
}
def __new__(
cls,
*args: typing.Union[dict, frozendict, ],
_configuration: typing.Optional[Configuration] = None,
**kwargs: typing.Type[Schema],
) -> 'OneofWithRequired':
return super().__new__(
cls,
*args,
_configuration=_configuration,
**kwargs,
)

View File

@ -76,9 +76,9 @@ class RequiredValidation(
Do not edit the class manually.
"""
_required_property_names = set((
'foo',
))
_required_property_names = {
"foo",
}
foo = AnyTypeSchema
bar = AnyTypeSchema

View File

@ -0,0 +1,99 @@
# coding: utf-8
"""
openapi 3.0.3 sample spec
sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501
The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
import typing # noqa: F401
import functools # noqa: F401
from frozendict import frozendict # noqa: F401
import decimal # noqa: F401
from datetime import date, datetime # noqa: F401
from frozendict import frozendict # noqa: F401
from unit_test_api.schemas import ( # noqa: F401
AnyTypeSchema,
ComposedSchema,
DictSchema,
ListSchema,
StrSchema,
IntSchema,
Int32Schema,
Int64Schema,
Float32Schema,
Float64Schema,
NumberSchema,
UUIDSchema,
DateSchema,
DateTimeSchema,
DecimalSchema,
BoolSchema,
BinarySchema,
NoneSchema,
none_type,
Configuration,
Unset,
unset,
ComposedBase,
ListBase,
DictBase,
NoneBase,
StrBase,
IntBase,
Int32Base,
Int64Base,
Float32Base,
Float64Base,
NumberBase,
UUIDBase,
DateBase,
DateTimeBase,
BoolBase,
BinaryBase,
Schema,
NoneClass,
BoolClass,
_SchemaValidator,
_SchemaTypeChecker,
_SchemaEnumMaker
)
class RequiredWithEscapedCharacters(
AnyTypeSchema
):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
_required_property_names = {
"foo\"bar",
"foo\nbar",
"foo\fbar",
"foo\tbar",
"foo\rbar",
"foo\\bar",
}
def __new__(
cls,
*args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes],
_configuration: typing.Optional[Configuration] = None,
**kwargs: typing.Type[Schema],
) -> 'RequiredWithEscapedCharacters':
return super().__new__(
cls,
*args,
_configuration=_configuration,
**kwargs,
)

View File

@ -73,6 +73,7 @@ from unit_test_api.model.oneof import Oneof
from unit_test_api.model.oneof_complex_types import OneofComplexTypes
from unit_test_api.model.oneof_with_base_schema import OneofWithBaseSchema
from unit_test_api.model.oneof_with_empty_schema import OneofWithEmptySchema
from unit_test_api.model.oneof_with_required import OneofWithRequired
from unit_test_api.model.pattern_is_not_anchored import PatternIsNotAnchored
from unit_test_api.model.pattern_validation import PatternValidation
from unit_test_api.model.properties_with_escaped_characters import PropertiesWithEscapedCharacters
@ -86,6 +87,7 @@ from unit_test_api.model.ref_in_property import RefInProperty
from unit_test_api.model.required_default_validation import RequiredDefaultValidation
from unit_test_api.model.required_validation import RequiredValidation
from unit_test_api.model.required_with_empty_array import RequiredWithEmptyArray
from unit_test_api.model.required_with_escaped_characters import RequiredWithEscapedCharacters
from unit_test_api.model.simple_enum_validation import SimpleEnumValidation
from unit_test_api.model.string_type_matches_strings import StringTypeMatchesStrings
from unit_test_api.model.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing

View File

@ -126,6 +126,8 @@ class PathValues(str, enum.Enum):
RESPONSE_BODY_POST_ONEOF_COMPLEX_TYPES_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postOneofComplexTypesResponseBodyForContentTypes"
REQUEST_BODY_POST_ONEOF_WITH_EMPTY_SCHEMA_REQUEST_BODY = "/requestBody/postOneofWithEmptySchemaRequestBody"
RESPONSE_BODY_POST_ONEOF_WITH_EMPTY_SCHEMA_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postOneofWithEmptySchemaResponseBodyForContentTypes"
REQUEST_BODY_POST_ONEOF_WITH_REQUIRED_REQUEST_BODY = "/requestBody/postOneofWithRequiredRequestBody"
RESPONSE_BODY_POST_ONEOF_WITH_REQUIRED_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postOneofWithRequiredResponseBodyForContentTypes"
REQUEST_BODY_POST_NESTED_ONEOF_TO_CHECK_VALIDATION_SEMANTICS_REQUEST_BODY = "/requestBody/postNestedOneofToCheckValidationSemanticsRequestBody"
RESPONSE_BODY_POST_NESTED_ONEOF_TO_CHECK_VALIDATION_SEMANTICS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postNestedOneofToCheckValidationSemanticsResponseBodyForContentTypes"
REQUEST_BODY_POST_PATTERN_VALIDATION_REQUEST_BODY = "/requestBody/postPatternValidationRequestBody"
@ -156,6 +158,8 @@ class PathValues(str, enum.Enum):
RESPONSE_BODY_POST_REQUIRED_DEFAULT_VALIDATION_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postRequiredDefaultValidationResponseBodyForContentTypes"
REQUEST_BODY_POST_REQUIRED_WITH_EMPTY_ARRAY_REQUEST_BODY = "/requestBody/postRequiredWithEmptyArrayRequestBody"
RESPONSE_BODY_POST_REQUIRED_WITH_EMPTY_ARRAY_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postRequiredWithEmptyArrayResponseBodyForContentTypes"
REQUEST_BODY_POST_REQUIRED_WITH_ESCAPED_CHARACTERS_REQUEST_BODY = "/requestBody/postRequiredWithEscapedCharactersRequestBody"
RESPONSE_BODY_POST_REQUIRED_WITH_ESCAPED_CHARACTERS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postRequiredWithEscapedCharactersResponseBodyForContentTypes"
REQUEST_BODY_POST_INTEGER_TYPE_MATCHES_INTEGERS_REQUEST_BODY = "/requestBody/postIntegerTypeMatchesIntegersRequestBody"
RESPONSE_BODY_POST_INTEGER_TYPE_MATCHES_INTEGERS_RESPONSE_BODY_FOR_CONTENT_TYPES = "/responseBody/postIntegerTypeMatchesIntegersResponseBodyForContentTypes"
REQUEST_BODY_POST_NUMBER_TYPE_MATCHES_NUMBERS_REQUEST_BODY = "/requestBody/postNumberTypeMatchesNumbersRequestBody"

View File

@ -0,0 +1,7 @@
# do not import all endpoints into this module because that uses a lot of memory and stack frames
# if you need the ability to import all endpoints from this module, import them with
# from unit_test_api.paths.request_body_post_oneof_with_required_request_body import Api
from unit_test_api.paths import PathValues
path = PathValues.REQUEST_BODY_POST_ONEOF_WITH_REQUIRED_REQUEST_BODY

View File

@ -0,0 +1,205 @@
# coding: utf-8
"""
Generated by: https://openapi-generator.tech
"""
from dataclasses import dataclass
import re # noqa: F401
import sys # noqa: F401
import typing
import urllib3
import functools # noqa: F401
from urllib3._collections import HTTPHeaderDict
from unit_test_api import api_client, exceptions
import decimal # noqa: F401
from datetime import date, datetime # noqa: F401
from frozendict import frozendict # noqa: F401
from unit_test_api.schemas import ( # noqa: F401
AnyTypeSchema,
ComposedSchema,
DictSchema,
ListSchema,
StrSchema,
IntSchema,
Int32Schema,
Int64Schema,
Float32Schema,
Float64Schema,
NumberSchema,
UUIDSchema,
DateSchema,
DateTimeSchema,
DecimalSchema,
BoolSchema,
BinarySchema,
NoneSchema,
none_type,
Configuration,
Unset,
unset,
ComposedBase,
ListBase,
DictBase,
NoneBase,
StrBase,
IntBase,
Int32Base,
Int64Base,
Float32Base,
Float64Base,
NumberBase,
UUIDBase,
DateBase,
DateTimeBase,
BoolBase,
BinaryBase,
Schema,
NoneClass,
BoolClass,
_SchemaValidator,
_SchemaTypeChecker,
_SchemaEnumMaker
)
from unit_test_api.model.oneof_with_required import OneofWithRequired
from . import path
# body param
SchemaForRequestBodyApplicationJson = OneofWithRequired
request_body_oneof_with_required = api_client.RequestBody(
content={
'application/json': api_client.MediaType(
schema=SchemaForRequestBodyApplicationJson),
},
required=True,
)
@dataclass
class ApiResponseFor200(api_client.ApiResponse):
response: urllib3.HTTPResponse
body: Unset = unset
headers: Unset = unset
_response_for_200 = api_client.OpenApiResponse(
response_cls=ApiResponseFor200,
)
_status_code_to_response = {
'200': _response_for_200,
}
class BaseApi(api_client.Api):
def _post_oneof_with_required_request_body(
self: api_client.Api,
body: typing.Union[SchemaForRequestBodyApplicationJson],
content_type: str = 'application/json',
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponseWithoutDeserialization
]:
"""
:param skip_deserialization: If true then api_response.response will be set but
api_response.body and api_response.headers will not be deserialized into schema
class instances
"""
used_path = path.value
_headers = HTTPHeaderDict()
# TODO add cookie handling
if body is unset:
raise exceptions.ApiValueError(
'The required body parameter has an invalid value of: unset. Set a valid value instead')
_fields = None
_body = None
serialized_data = request_body_oneof_with_required.serialize(body, content_type)
_headers.add('Content-Type', content_type)
if 'fields' in serialized_data:
_fields = serialized_data['fields']
elif 'body' in serialized_data:
_body = serialized_data['body']
response = self.api_client.call_api(
resource_path=used_path,
method='post'.upper(),
headers=_headers,
fields=_fields,
body=_body,
stream=stream,
timeout=timeout,
)
if skip_deserialization:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)
else:
response_for_status = _status_code_to_response.get(str(response.status))
if response_for_status:
api_response = response_for_status.deserialize(response, self.api_client.configuration)
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)
if not 200 <= response.status <= 299:
raise exceptions.ApiException(api_response=api_response)
return api_response
class PostOneofWithRequiredRequestBody(BaseApi):
# this class is used by api classes that refer to endpoints with operationId fn names
def post_oneof_with_required_request_body(
self: BaseApi,
body: typing.Union[SchemaForRequestBodyApplicationJson],
content_type: str = 'application/json',
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponseWithoutDeserialization
]:
return self._post_oneof_with_required_request_body(
body=body,
content_type=content_type,
stream=stream,
timeout=timeout,
skip_deserialization=skip_deserialization
)
class ApiForpost(BaseApi):
# this class is used by api classes that refer to endpoints by path and http method names
def post(
self: BaseApi,
body: typing.Union[SchemaForRequestBodyApplicationJson],
content_type: str = 'application/json',
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponseWithoutDeserialization
]:
return self._post_oneof_with_required_request_body(
body=body,
content_type=content_type,
stream=stream,
timeout=timeout,
skip_deserialization=skip_deserialization
)

View File

@ -0,0 +1,7 @@
# do not import all endpoints into this module because that uses a lot of memory and stack frames
# if you need the ability to import all endpoints from this module, import them with
# from unit_test_api.paths.request_body_post_required_with_escaped_characters_request_body import Api
from unit_test_api.paths import PathValues
path = PathValues.REQUEST_BODY_POST_REQUIRED_WITH_ESCAPED_CHARACTERS_REQUEST_BODY

View File

@ -0,0 +1,228 @@
# coding: utf-8
"""
Generated by: https://openapi-generator.tech
"""
from dataclasses import dataclass
import re # noqa: F401
import sys # noqa: F401
import typing
import urllib3
import functools # noqa: F401
from urllib3._collections import HTTPHeaderDict
from unit_test_api import api_client, exceptions
import decimal # noqa: F401
from datetime import date, datetime # noqa: F401
from frozendict import frozendict # noqa: F401
from unit_test_api.schemas import ( # noqa: F401
AnyTypeSchema,
ComposedSchema,
DictSchema,
ListSchema,
StrSchema,
IntSchema,
Int32Schema,
Int64Schema,
Float32Schema,
Float64Schema,
NumberSchema,
UUIDSchema,
DateSchema,
DateTimeSchema,
DecimalSchema,
BoolSchema,
BinarySchema,
NoneSchema,
none_type,
Configuration,
Unset,
unset,
ComposedBase,
ListBase,
DictBase,
NoneBase,
StrBase,
IntBase,
Int32Base,
Int64Base,
Float32Base,
Float64Base,
NumberBase,
UUIDBase,
DateBase,
DateTimeBase,
BoolBase,
BinaryBase,
Schema,
NoneClass,
BoolClass,
_SchemaValidator,
_SchemaTypeChecker,
_SchemaEnumMaker
)
from . import path
# body param
class SchemaForRequestBodyApplicationJson(
AnyTypeSchema
):
_required_property_names = {
"foo\"bar",
"foo\nbar",
"foo\fbar",
"foo\tbar",
"foo\rbar",
"foo\\bar",
}
def __new__(
cls,
*args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes],
_configuration: typing.Optional[Configuration] = None,
**kwargs: typing.Type[Schema],
) -> 'SchemaForRequestBodyApplicationJson':
return super().__new__(
cls,
*args,
_configuration=_configuration,
**kwargs,
)
request_body_body = api_client.RequestBody(
content={
'application/json': api_client.MediaType(
schema=SchemaForRequestBodyApplicationJson),
},
required=True,
)
@dataclass
class ApiResponseFor200(api_client.ApiResponse):
response: urllib3.HTTPResponse
body: Unset = unset
headers: Unset = unset
_response_for_200 = api_client.OpenApiResponse(
response_cls=ApiResponseFor200,
)
_status_code_to_response = {
'200': _response_for_200,
}
class BaseApi(api_client.Api):
def _post_required_with_escaped_characters_request_body(
self: api_client.Api,
body: typing.Union[SchemaForRequestBodyApplicationJson],
content_type: str = 'application/json',
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponseWithoutDeserialization
]:
"""
:param skip_deserialization: If true then api_response.response will be set but
api_response.body and api_response.headers will not be deserialized into schema
class instances
"""
used_path = path.value
_headers = HTTPHeaderDict()
# TODO add cookie handling
if body is unset:
raise exceptions.ApiValueError(
'The required body parameter has an invalid value of: unset. Set a valid value instead')
_fields = None
_body = None
serialized_data = request_body_body.serialize(body, content_type)
_headers.add('Content-Type', content_type)
if 'fields' in serialized_data:
_fields = serialized_data['fields']
elif 'body' in serialized_data:
_body = serialized_data['body']
response = self.api_client.call_api(
resource_path=used_path,
method='post'.upper(),
headers=_headers,
fields=_fields,
body=_body,
stream=stream,
timeout=timeout,
)
if skip_deserialization:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)
else:
response_for_status = _status_code_to_response.get(str(response.status))
if response_for_status:
api_response = response_for_status.deserialize(response, self.api_client.configuration)
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)
if not 200 <= response.status <= 299:
raise exceptions.ApiException(api_response=api_response)
return api_response
class PostRequiredWithEscapedCharactersRequestBody(BaseApi):
# this class is used by api classes that refer to endpoints with operationId fn names
def post_required_with_escaped_characters_request_body(
self: BaseApi,
body: typing.Union[SchemaForRequestBodyApplicationJson],
content_type: str = 'application/json',
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponseWithoutDeserialization
]:
return self._post_required_with_escaped_characters_request_body(
body=body,
content_type=content_type,
stream=stream,
timeout=timeout,
skip_deserialization=skip_deserialization
)
class ApiForpost(BaseApi):
# this class is used by api classes that refer to endpoints by path and http method names
def post(
self: BaseApi,
body: typing.Union[SchemaForRequestBodyApplicationJson],
content_type: str = 'application/json',
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponseWithoutDeserialization
]:
return self._post_required_with_escaped_characters_request_body(
body=body,
content_type=content_type,
stream=stream,
timeout=timeout,
skip_deserialization=skip_deserialization
)

View File

@ -0,0 +1,7 @@
# do not import all endpoints into this module because that uses a lot of memory and stack frames
# if you need the ability to import all endpoints from this module, import them with
# from unit_test_api.paths.response_body_post_oneof_with_required_response_body_for_content_types import Api
from unit_test_api.paths import PathValues
path = PathValues.RESPONSE_BODY_POST_ONEOF_WITH_REQUIRED_RESPONSE_BODY_FOR_CONTENT_TYPES

View File

@ -0,0 +1,189 @@
# coding: utf-8
"""
Generated by: https://openapi-generator.tech
"""
from dataclasses import dataclass
import re # noqa: F401
import sys # noqa: F401
import typing
import urllib3
import functools # noqa: F401
from urllib3._collections import HTTPHeaderDict
from unit_test_api import api_client, exceptions
import decimal # noqa: F401
from datetime import date, datetime # noqa: F401
from frozendict import frozendict # noqa: F401
from unit_test_api.schemas import ( # noqa: F401
AnyTypeSchema,
ComposedSchema,
DictSchema,
ListSchema,
StrSchema,
IntSchema,
Int32Schema,
Int64Schema,
Float32Schema,
Float64Schema,
NumberSchema,
UUIDSchema,
DateSchema,
DateTimeSchema,
DecimalSchema,
BoolSchema,
BinarySchema,
NoneSchema,
none_type,
Configuration,
Unset,
unset,
ComposedBase,
ListBase,
DictBase,
NoneBase,
StrBase,
IntBase,
Int32Base,
Int64Base,
Float32Base,
Float64Base,
NumberBase,
UUIDBase,
DateBase,
DateTimeBase,
BoolBase,
BinaryBase,
Schema,
NoneClass,
BoolClass,
_SchemaValidator,
_SchemaTypeChecker,
_SchemaEnumMaker
)
from unit_test_api.model.oneof_with_required import OneofWithRequired
from . import path
SchemaFor200ResponseBodyApplicationJson = OneofWithRequired
@dataclass
class ApiResponseFor200(api_client.ApiResponse):
response: urllib3.HTTPResponse
body: typing.Union[
SchemaFor200ResponseBodyApplicationJson,
]
headers: Unset = unset
_response_for_200 = api_client.OpenApiResponse(
response_cls=ApiResponseFor200,
content={
'application/json': api_client.MediaType(
schema=SchemaFor200ResponseBodyApplicationJson),
},
)
_status_code_to_response = {
'200': _response_for_200,
}
_all_accept_content_types = (
'application/json',
)
class BaseApi(api_client.Api):
def _post_oneof_with_required_response_body_for_content_types(
self: api_client.Api,
accept_content_types: typing.Tuple[str] = _all_accept_content_types,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponseWithoutDeserialization
]:
"""
:param skip_deserialization: If true then api_response.response will be set but
api_response.body and api_response.headers will not be deserialized into schema
class instances
"""
used_path = path.value
_headers = HTTPHeaderDict()
# TODO add cookie handling
if accept_content_types:
for accept_content_type in accept_content_types:
_headers.add('Accept', accept_content_type)
response = self.api_client.call_api(
resource_path=used_path,
method='post'.upper(),
headers=_headers,
stream=stream,
timeout=timeout,
)
if skip_deserialization:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)
else:
response_for_status = _status_code_to_response.get(str(response.status))
if response_for_status:
api_response = response_for_status.deserialize(response, self.api_client.configuration)
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)
if not 200 <= response.status <= 299:
raise exceptions.ApiException(api_response=api_response)
return api_response
class PostOneofWithRequiredResponseBodyForContentTypes(BaseApi):
# this class is used by api classes that refer to endpoints with operationId fn names
def post_oneof_with_required_response_body_for_content_types(
self: BaseApi,
accept_content_types: typing.Tuple[str] = _all_accept_content_types,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponseWithoutDeserialization
]:
return self._post_oneof_with_required_response_body_for_content_types(
accept_content_types=accept_content_types,
stream=stream,
timeout=timeout,
skip_deserialization=skip_deserialization
)
class ApiForpost(BaseApi):
# this class is used by api classes that refer to endpoints by path and http method names
def post(
self: BaseApi,
accept_content_types: typing.Tuple[str] = _all_accept_content_types,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponseWithoutDeserialization
]:
return self._post_oneof_with_required_response_body_for_content_types(
accept_content_types=accept_content_types,
stream=stream,
timeout=timeout,
skip_deserialization=skip_deserialization
)

View File

@ -0,0 +1,7 @@
# do not import all endpoints into this module because that uses a lot of memory and stack frames
# if you need the ability to import all endpoints from this module, import them with
# from unit_test_api.paths.response_body_post_required_with_escaped_characters_response_body_for_content_types import Api
from unit_test_api.paths import PathValues
path = PathValues.RESPONSE_BODY_POST_REQUIRED_WITH_ESCAPED_CHARACTERS_RESPONSE_BODY_FOR_CONTENT_TYPES

View File

@ -0,0 +1,212 @@
# coding: utf-8
"""
Generated by: https://openapi-generator.tech
"""
from dataclasses import dataclass
import re # noqa: F401
import sys # noqa: F401
import typing
import urllib3
import functools # noqa: F401
from urllib3._collections import HTTPHeaderDict
from unit_test_api import api_client, exceptions
import decimal # noqa: F401
from datetime import date, datetime # noqa: F401
from frozendict import frozendict # noqa: F401
from unit_test_api.schemas import ( # noqa: F401
AnyTypeSchema,
ComposedSchema,
DictSchema,
ListSchema,
StrSchema,
IntSchema,
Int32Schema,
Int64Schema,
Float32Schema,
Float64Schema,
NumberSchema,
UUIDSchema,
DateSchema,
DateTimeSchema,
DecimalSchema,
BoolSchema,
BinarySchema,
NoneSchema,
none_type,
Configuration,
Unset,
unset,
ComposedBase,
ListBase,
DictBase,
NoneBase,
StrBase,
IntBase,
Int32Base,
Int64Base,
Float32Base,
Float64Base,
NumberBase,
UUIDBase,
DateBase,
DateTimeBase,
BoolBase,
BinaryBase,
Schema,
NoneClass,
BoolClass,
_SchemaValidator,
_SchemaTypeChecker,
_SchemaEnumMaker
)
from . import path
class SchemaFor200ResponseBodyApplicationJson(
AnyTypeSchema
):
_required_property_names = {
"foo\"bar",
"foo\nbar",
"foo\fbar",
"foo\tbar",
"foo\rbar",
"foo\\bar",
}
def __new__(
cls,
*args: typing.Union[dict, frozendict, str, date, datetime, int, float, decimal.Decimal, None, list, tuple, bytes],
_configuration: typing.Optional[Configuration] = None,
**kwargs: typing.Type[Schema],
) -> 'SchemaFor200ResponseBodyApplicationJson':
return super().__new__(
cls,
*args,
_configuration=_configuration,
**kwargs,
)
@dataclass
class ApiResponseFor200(api_client.ApiResponse):
response: urllib3.HTTPResponse
body: typing.Union[
SchemaFor200ResponseBodyApplicationJson,
]
headers: Unset = unset
_response_for_200 = api_client.OpenApiResponse(
response_cls=ApiResponseFor200,
content={
'application/json': api_client.MediaType(
schema=SchemaFor200ResponseBodyApplicationJson),
},
)
_status_code_to_response = {
'200': _response_for_200,
}
_all_accept_content_types = (
'application/json',
)
class BaseApi(api_client.Api):
def _post_required_with_escaped_characters_response_body_for_content_types(
self: api_client.Api,
accept_content_types: typing.Tuple[str] = _all_accept_content_types,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponseWithoutDeserialization
]:
"""
:param skip_deserialization: If true then api_response.response will be set but
api_response.body and api_response.headers will not be deserialized into schema
class instances
"""
used_path = path.value
_headers = HTTPHeaderDict()
# TODO add cookie handling
if accept_content_types:
for accept_content_type in accept_content_types:
_headers.add('Accept', accept_content_type)
response = self.api_client.call_api(
resource_path=used_path,
method='post'.upper(),
headers=_headers,
stream=stream,
timeout=timeout,
)
if skip_deserialization:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)
else:
response_for_status = _status_code_to_response.get(str(response.status))
if response_for_status:
api_response = response_for_status.deserialize(response, self.api_client.configuration)
else:
api_response = api_client.ApiResponseWithoutDeserialization(response=response)
if not 200 <= response.status <= 299:
raise exceptions.ApiException(api_response=api_response)
return api_response
class PostRequiredWithEscapedCharactersResponseBodyForContentTypes(BaseApi):
# this class is used by api classes that refer to endpoints with operationId fn names
def post_required_with_escaped_characters_response_body_for_content_types(
self: BaseApi,
accept_content_types: typing.Tuple[str] = _all_accept_content_types,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponseWithoutDeserialization
]:
return self._post_required_with_escaped_characters_response_body_for_content_types(
accept_content_types=accept_content_types,
stream=stream,
timeout=timeout,
skip_deserialization=skip_deserialization
)
class ApiForpost(BaseApi):
# this class is used by api classes that refer to endpoints by path and http method names
def post(
self: BaseApi,
accept_content_types: typing.Tuple[str] = _all_accept_content_types,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponseWithoutDeserialization
]:
return self._post_required_with_escaped_characters_response_body_for_content_types(
accept_content_types=accept_content_types,
stream=stream,
timeout=timeout,
skip_deserialization=skip_deserialization
)

View File

@ -1068,7 +1068,7 @@ class DictBase(Discriminable):
"""
path_to_schemas = {}
for property_name, value in arg.items():
if property_name in cls._required_property_names or property_name in cls._property_names:
if property_name in cls._property_names:
schema = getattr(cls, property_name)
elif cls._additional_properties:
schema = cls._additional_properties

View File

@ -1005,15 +1005,15 @@ skip_deserialization | bool | default is False | when True, headers and body wil
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**number** | **int, float** | None |
**pattern_without_delimiter** | **str** | None |
**byte** | **str** | None |
**double** | **int, float** | None |
**integer** | **int** | None | [optional]
**int32** | **int** | None | [optional]
**int64** | **int** | None | [optional]
**number** | **int, float** | None |
**float** | **int, float** | None | [optional]
**double** | **int, float** | None |
**string** | **str** | None | [optional]
**pattern_without_delimiter** | **str** | None |
**byte** | **str** | None |
**binary** | **file_type** | None | [optional]
**date** | **date** | None | [optional]
**dateTime** | **datetime** | None | [optional] if omitted the server will use the default value of 2010-02-01T10:20:10.11111+01:00
@ -3040,8 +3040,8 @@ skip_deserialization | bool | default is False | when True, headers and body wil
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**additionalMetadata** | **str** | Additional data to pass to server | [optional]
**file** | **file_type** | file to upload |
**additionalMetadata** | **str** | Additional data to pass to server | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
### Return Types, Responses

View File

@ -1193,8 +1193,8 @@ skip_deserialization | bool | default is False | when True, headers and body wil
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**additionalMetadata** | **str** | Additional data to pass to server | [optional]
**requiredFile** | **file_type** | file to upload |
**additionalMetadata** | **str** | Additional data to pass to server | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
### path_params

View File

@ -3,8 +3,8 @@
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional]
**name** | **str** | | if omitted the server will use the default value of "default-name"
**id** | **int** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [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

@ -3,8 +3,8 @@
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enum_string** | **str** | | [optional]
**enum_string_required** | **str** | |
**enum_string** | **str** | | [optional]
**enum_integer** | **int** | | [optional]
**enum_number** | **int, float** | | [optional]
**stringEnum** | [**StringEnum**](StringEnum.md) | | [optional]

View File

@ -3,24 +3,24 @@
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**date** | **date** | |
**number** | **int, float** | |
**password** | **str** | |
**byte** | **str** | |
**integer** | **int** | | [optional]
**int32** | **int** | | [optional]
**int32withValidations** | **int** | | [optional]
**int64** | **int** | | [optional]
**number** | **int, float** | |
**float** | **int, float** | this is a reserved python keyword | [optional]
**float32** | **int, float** | | [optional]
**double** | **int, float** | | [optional]
**float64** | **int, float** | | [optional]
**arrayWithUniqueItems** | **[int, float]** | | [optional]
**string** | **str** | | [optional]
**byte** | **str** | |
**binary** | **file_type** | | [optional]
**date** | **date** | |
**dateTime** | **datetime** | | [optional]
**uuid** | **str** | | [optional]
**uuidNoExample** | **str** | | [optional]
**password** | **str** | |
**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**pattern_with_digits_and_delimiter** | **str** | A string starting with &#x27;image_&#x27; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
**noneProp** | **none_type** | | [optional]

View File

@ -5,8 +5,8 @@ model with properties that have invalid names for python
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**$special[property.name]** | **int** | | [optional]
**123-list** | **str** | |
**$special[property.name]** | **int** | | [optional]
**123Number** | **int** | | [optional] [readonly]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

View File

@ -5,10 +5,10 @@ Pet object that needs to be added to the store
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**photoUrls** | **[str]** | |
**name** | **str** | |
**id** | **int** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
**name** | **str** | |
**photoUrls** | **[str]** | |
**tags** | **[Tag]** | | [optional]
**status** | **str** | pet status in the store | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

View File

@ -3,9 +3,9 @@
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**className** | **str** | |
**hasBaleen** | **bool** | | [optional]
**hasTeeth** | **bool** | | [optional]
**className** | **str** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [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

@ -3,8 +3,8 @@
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **str** | | [optional]
**className** | **str** | |
**type** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [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

@ -76,9 +76,9 @@ class Animal(
Do not edit the class manually.
"""
_required_property_names = set((
'className',
))
_required_property_names = {
"className",
}
className = StrSchema
color = StrSchema

View File

@ -79,9 +79,9 @@ class Apple(
Do not edit the class manually.
"""
_required_property_names = set((
'cultivar',
))
_required_property_names = {
"cultivar",
}
class cultivar(

View File

@ -76,9 +76,9 @@ class AppleReq(
Do not edit the class manually.
"""
_required_property_names = set((
'cultivar',
))
_required_property_names = {
"cultivar",
}
cultivar = StrSchema
mealy = BoolSchema
_additional_properties = None

View File

@ -76,9 +76,9 @@ class Banana(
Do not edit the class manually.
"""
_required_property_names = set((
'lengthCm',
))
_required_property_names = {
"lengthCm",
}
lengthCm = NumberSchema

View File

@ -76,9 +76,9 @@ class BananaReq(
Do not edit the class manually.
"""
_required_property_names = set((
'lengthCm',
))
_required_property_names = {
"lengthCm",
}
lengthCm = NumberSchema
sweet = BoolSchema
_additional_properties = None

View File

@ -76,9 +76,9 @@ class BasquePig(
Do not edit the class manually.
"""
_required_property_names = set((
'className',
))
_required_property_names = {
"className",
}
class className(

View File

@ -76,9 +76,9 @@ class Category(
Do not edit the class manually.
"""
_required_property_names = set((
'name',
))
_required_property_names = {
"name",
}
id = Int64Schema
name = StrSchema

View File

@ -76,9 +76,9 @@ class DanishPig(
Do not edit the class manually.
"""
_required_property_names = set((
'className',
))
_required_property_names = {
"className",
}
class className(

View File

@ -76,9 +76,9 @@ class EnumTest(
Do not edit the class manually.
"""
_required_property_names = set((
'enum_string_required',
))
_required_property_names = {
"enum_string_required",
}
class enum_string(

View File

@ -76,12 +76,12 @@ class FormatTest(
Do not edit the class manually.
"""
_required_property_names = set((
'number',
'byte',
'date',
'password',
))
_required_property_names = {
"date",
"number",
"password",
"byte",
}
class integer(
@ -210,10 +210,10 @@ class FormatTest(
def __new__(
cls,
*args: typing.Union[dict, frozendict, ],
number: number,
byte: byte,
date: date,
number: number,
password: password,
byte: byte,
integer: typing.Union[integer, Unset] = unset,
int32: typing.Union[int32, Unset] = unset,
int32withValidations: typing.Union[int32withValidations, Unset] = unset,
@ -236,10 +236,10 @@ class FormatTest(
return super().__new__(
cls,
*args,
number=number,
byte=byte,
date=date,
number=number,
password=password,
byte=byte,
integer=integer,
int32=int32,
int32withValidations=int32withValidations,

View File

@ -76,9 +76,9 @@ class GrandparentAnimal(
Do not edit the class manually.
"""
_required_property_names = set((
'pet_type',
))
_required_property_names = {
"pet_type",
}
pet_type = StrSchema
@classmethod

View File

@ -76,10 +76,10 @@ class Money(
Do not edit the class manually.
"""
_required_property_names = set((
'amount',
'currency',
))
_required_property_names = {
"amount",
"currency",
}
amount = DecimalSchema
@classmethod

View File

@ -78,9 +78,9 @@ class Name(
Model for testing model name same as property name
"""
_required_property_names = set((
'name',
))
_required_property_names = {
"name",
}
name = Int32Schema
snake_case = Int32Schema
_property = StrSchema

View File

@ -76,9 +76,9 @@ class NoAdditionalProperties(
Do not edit the class manually.
"""
_required_property_names = set((
'id',
))
_required_property_names = {
"id",
}
id = Int64Schema
petId = Int64Schema
_additional_properties = None

View File

@ -78,9 +78,9 @@ class ObjectWithDifficultlyNamedProps(
model with properties that have invalid names for python
"""
_required_property_names = set((
'123-list',
))
_required_property_names = {
"123-list",
}
special_property_name = Int64Schema
locals()["$special[property.name]"] = special_property_name
del locals()['special_property_name']

View File

@ -78,10 +78,10 @@ class Pet(
Pet object that needs to be added to the store
"""
_required_property_names = set((
'name',
'photoUrls',
))
_required_property_names = {
"photoUrls",
"name",
}
id = Int64Schema
@classmethod
@ -137,8 +137,8 @@ class Pet(
def __new__(
cls,
*args: typing.Union[dict, frozendict, ],
name: name,
photoUrls: photoUrls,
name: name,
id: typing.Union[id, Unset] = unset,
category: typing.Union['Category', Unset] = unset,
tags: typing.Union[tags, Unset] = unset,
@ -149,8 +149,8 @@ class Pet(
return super().__new__(
cls,
*args,
name=name,
photoUrls=photoUrls,
name=name,
id=id,
category=category,
tags=tags,

View File

@ -76,10 +76,10 @@ class QuadrilateralInterface(
Do not edit the class manually.
"""
_required_property_names = set((
'shapeType',
'quadrilateralType',
))
_required_property_names = {
"shapeType",
"quadrilateralType",
}
class shapeType(

View File

@ -76,10 +76,10 @@ class TriangleInterface(
Do not edit the class manually.
"""
_required_property_names = set((
'shapeType',
'triangleType',
))
_required_property_names = {
"shapeType",
"triangleType",
}
class shapeType(

View File

@ -76,9 +76,9 @@ class Whale(
Do not edit the class manually.
"""
_required_property_names = set((
'className',
))
_required_property_names = {
"className",
}
hasBaleen = BoolSchema
hasTeeth = BoolSchema

View File

@ -76,9 +76,9 @@ class Zebra(
Do not edit the class manually.
"""
_required_property_names = set((
'className',
))
_required_property_names = {
"className",
}
class type(

View File

@ -74,12 +74,12 @@ from . import path
class SchemaForRequestBodyApplicationXWwwFormUrlencoded(
DictSchema
):
_required_property_names = set((
'number',
'double',
'pattern_without_delimiter',
'byte',
))
_required_property_names = {
"number",
"pattern_without_delimiter",
"byte",
"double",
}
class integer(
@ -178,9 +178,9 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded(
cls,
*args: typing.Union[dict, frozendict, ],
number: number,
double: double,
pattern_without_delimiter: pattern_without_delimiter,
byte: byte,
double: double,
integer: typing.Union[integer, Unset] = unset,
int32: typing.Union[int32, Unset] = unset,
int64: typing.Union[int64, Unset] = unset,
@ -197,9 +197,9 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded(
cls,
*args,
number=number,
double=double,
pattern_without_delimiter=pattern_without_delimiter,
byte=byte,
double=double,
integer=integer,
int32=int32,
int64=int64,

View File

@ -74,10 +74,10 @@ from . import path
class SchemaForRequestBodyApplicationXWwwFormUrlencoded(
DictSchema
):
_required_property_names = set((
'param',
'param2',
))
_required_property_names = {
"param",
"param2",
}
param = StrSchema
param2 = StrSchema

View File

@ -102,9 +102,9 @@ request_path_pet_id = api_client.PathParameter(
class SchemaForRequestBodyMultipartFormData(
DictSchema
):
_required_property_names = set((
'requiredFile',
))
_required_property_names = {
"requiredFile",
}
additionalMetadata = StrSchema
requiredFile = BinarySchema

View File

@ -76,9 +76,9 @@ from . import path
class SchemaForRequestBodyMultipartFormData(
DictSchema
):
_required_property_names = set((
'file',
))
_required_property_names = {
"file",
}
additionalMetadata = StrSchema
file = BinarySchema

View File

@ -1068,7 +1068,7 @@ class DictBase(Discriminable):
"""
path_to_schemas = {}
for property_name, value in arg.items():
if property_name in cls._required_property_names or property_name in cls._property_names:
if property_name in cls._property_names:
schema = getattr(cls, property_name)
elif cls._additional_properties:
schema = cls._additional_properties

View File

@ -48,7 +48,7 @@ class ConfigurationTests(unittest.TestCase):
'User-Agent': 'OpenAPI-Generator/1.0.0/python'
}),
fields=None,
body=b'{"name":"pet","photoUrls":[]}',
body=b'{"photoUrls":[],"name":"pet"}',
stream=False,
timeout=None,
)

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